http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57191



             Bug #: 57191

           Summary: GCC cross-compilers built with MinGW do no include

                    correct directory

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: preprocessor

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: matthews.grochowal...@ge.com





It appears MinGW always overrides the definition of NATIVE_SYSTEM_HEADER_DIR

given on the command line. Running:



echo "NATIVE_SYSTEM_HEADER_DIR" | cpp -DNATIVE_SYSTEM_HEADER_DIR=/usr/include



produces:



c:/MinGW2/msys/1.0/include



I believe this change was introduced as a fix for bug 52947.



When building gcc with the "--with-sysroot" config option,

NATIVE_SYSTEM_HEADER_DIR is supposed to be defined as the TARGET system's

default include directory in gcc/cppdefault.c. In my case, this would be

/usr/include as I'm targeting GNU/Linux.

"-DNATIVE_SYSTEM_HEADER_DIR=/usr/include" is being passed to the build system

gcc (i686-pc-mingw32-gcc).



Because of MinGW's silent changing of NATIVE_SYSTEM_HEADER_DIR, the resulting

cross-compiler tries to look in $SYSROOTc:/MinGW2/msys/1.0/include for the

target system includes instead of $SYSROOT/usr/include.

Reply via email to