Dongsheng Song <dongsheng.s...@gmail.com> writes:

> When I cross build gcc on linux-amd64 box, I got a include files
> search order error:

This question is not appropriate for the mailing list
g...@gcc.gnu.org.  It would be appropriate for gcc-h...@gcc.gnu.org.
Please take any followups to gcc-help.  Thanks.

> /root/obj/gcc-4.2/./gcc/xgcc -B/root/obj/gcc-4.2/./gcc/
> -L/root/obj/gcc-4.2/i686-pc-mingw32/winsup/mingw
> -L/root/obj/gcc-4.2/i686-pc-mingw32/winsup/w32api/lib -isystem
> /root/src/gcc-4.2.4/winsup/mingw/include -isystem
> /root/src/gcc-4.2.4/winsup/w32api/include
> -B/root/mingw32/i686-pc-mingw32/bin/
> -B/root/mingw32/i686-pc-mingw32/lib/ -isystem
> /root/mingw32/i686-pc-mingw32/include -isystem
> /root/mingw32/i686-pc-mingw32/sys-include -O2
> -I/root/src/gcc-4.2.4/gcc/../winsup/w32api/include -O2 -O2 -pipe
> -DIN_GCC -DCROSS_COMPILE   -W -Wall -Wwrite-strings
> -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition
> -isystem ./include   -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2
> -D__GCC_FLOAT_NOT_NEEDED -Dinhibit_libc -I. -I.
> -I/root/src/gcc-4.2.4/gcc -I/root/src/gcc-4.2.4/gcc/.
> -I/root/src/gcc-4.2.4/gcc/../include
> -I/root/src/gcc-4.2.4/gcc/../libcpp/include -I/usr/include
> -I/usr/include -I/root/src/gcc-4.2.4/gcc/../libdecnumber
> -I../libdecnumber -c /root/src/gcc-4.2.4/gcc/config/i386/gthr-win32.c
> -o libgcc/./gthr-win32.o
> In file included from /usr/include/sys/select.h:46,
>                  from /usr/include/sys/types.h:220,
>                  from /usr/include/stdlib.h:320,
>                  from /root/mingw32/i686-pc-mingw32/include/objbase.h:12,
>                  from /root/mingw32/i686-pc-mingw32/include/ole2.h:9,
>                  from /root/mingw32/i686-pc-mingw32/include/windows.h:114,
>                  from /root/src/gcc-4.2.4/gcc/config/i386/gthr-win32.c:34:
> /usr/include/bits/time.h:70: error: redefinition of ‘struct timeval’
> In file included from /usr/include/sys/types.h:220,
>                  from /usr/include/stdlib.h:320,
>                  from /root/mingw32/i686-pc-mingw32/include/objbase.h:12,
>                  from /root/mingw32/i686-pc-mingw32/include/ole2.h:9,
>                  from /root/mingw32/i686-pc-mingw32/include/windows.h:114,
>                  from /root/src/gcc-4.2.4/gcc/config/i386/gthr-win32.c:34:
>
> Why gcc use stdlib.h in the path '/usr/include', not the path
> '/root/mingw32/i686-pc-mingw32/include' ?

Because there is an explicit -I/usr/include in the compilation line.
I don't know where that is coming from.  It seems likely that you
should be using --with-sysroot on your configure line; see the
installation instructions.

Ian

Reply via email to