This report is to track the progress of the first in issue of PR11890. When configuring a cross- compiler using --with-sysroot=... for some reason it is assumed that headers are in $prefix/ $TARGET/include, even when one explicitly indicates otherwise. Building 3.3 branch (on i686-linux) with ../gcc/configure --target=sparc-sun-solaris2.8 -- prefix=/tmp/dara/sparc-sun-solaris2.8/sysroot fails with: /tmp/objdir/gcc/xgcc -B/tmp/objdir/gcc/ -B/tmp/dara/sparc-sun-solaris2.8//sparc-sun- solaris2.8/bin/ -B/tmp/dara/sparc-sun-solaris2.8//sparc-sun-solaris2.8/lib/ -isystem /tmp/ dara/sparc-sun-solaris2.8//sparc-sun-solaris2.8/include -DIN_GCC -DCROSS_COMPILE -W - Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -I. -I. -I../../ gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/config -I../../gcc/gcc/../include \ -c ../../gcc/gcc/config/sparc/gmon-sol2.c -o gmon.o In file included from ../../gcc/gcc/config/sparc/gmon-sol2.c:36: ../../gcc/gcc/system.h:45:19: stdio.h: No such file or directory ../../gcc/gcc/system.h:107:23: sys/types.h: No such file or directory ../../gcc/gcc/system.h:109:19: errno.h: No such file or directory ../../gcc/gcc/system.h:116:21: string.h: No such file or directory ../../gcc/gcc/system.h:117:22: strings.h: No such file or directory ../../gcc/gcc/system.h:129:21: stdlib.h: No such file or directory ../../gcc/gcc/system.h:152:21: unistd.h: No such file or directory ../../gcc/gcc/system.h:156:24: sys/param.h: No such file or directory ../../gcc/gcc/system.h:195:23: sys/time.h: No such file or directory ../../gcc/gcc/system.h:196:19: time.h: No such file or directory ../../gcc/gcc/system.h:208:20: fcntl.h: No such file or directory ../../gcc/gcc/system.h:246:22: sys/wait.h: No such file or directory ../../gcc/gcc/system.h:313:20: malloc.h: No such file or directory ../../gcc/gcc/system.h:382:23: sys/stat.h: No such file or directory ../../gcc/gcc/config/sparc/gmon-sol2.c: In function `monstartup': Observer that the -isystem is include $prefix/$target/include, not $prefix/sysroot/include as the documentation indicates should happen. While I've only seen this on sparc-sun-solaris2.8 target, this appears to be a generic cross-build bug.
Oops, the configure line above _should_ read (ie I did actually use --with-sysroot): ../gcc/configure --enable-languages=c++ --target=sparc-sun-solaris2.8 --with-sysroot=/tmp/ dara/sparc-sun-solaris2.8/sysroot --prefix=/tmp/dara/sparc-sun-solaris2.8/
Subject: Re: New: cross build using sysroot fails when headers not in $prefix/$target/include On Mon, Aug 18, 2003 at 04:02:23PM -0000, dhazeghi at yahoo dot com wrote: > Building 3.3 branch (on i686-linux) with ../gcc/configure --target=sparc-sun-solaris2.8 -- > prefix=/tmp/dara/sparc-sun-solaris2.8/sysroot fails with: That's because the 3.3 branch does not include the sysroot patches.
Dan, you added sysroot support to gcc (not too long in fact). Would you mind commenting on this report? Thanks!
This looks related to bug 11894.
Well I'll be darned. You're completely right! I assume sysroot won't be put on the branch then?
Subject: Re: cross build using sysroot fails when headers not in $prefix/$target/include Probably not, since it was initially rejected.
Okay (I'd prefer to have it in 3.3, but I suspect it doesn't quite fit the category of bug/ regression fixes). Thanks for the quick response and sorry for the noise!