Bug 11967 - cross build using sysroot fails when headers not in $prefix/$target/include
Summary: cross build using sysroot fails when headers not in $prefix/$target/include
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: build
Depends on:
Blocks: 11890
  Show dependency treegraph
 
Reported: 2003-08-18 16:02 UTC by Dara Hazeghi
Modified: 2003-08-18 17:45 UTC (History)
2 users (show)

See Also:
Host:
Target: sparc-sun-solaris2.8
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-08-18 16:07:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dara Hazeghi 2003-08-18 16:02:18 UTC
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.
Comment 1 Dara Hazeghi 2003-08-18 16:07:05 UTC
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/
Comment 2 Daniel Jacobowitz 2003-08-18 16:09:28 UTC
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.
Comment 3 Dara Hazeghi 2003-08-18 16:09:41 UTC
Dan, you added sysroot support to gcc (not too long in fact). Would you mind commenting on this 
report? Thanks!
Comment 4 Dara Hazeghi 2003-08-18 16:10:50 UTC
Dan, you added sysroot support to gcc (not too long in fact). Would you mind commenting on this 
report? Thanks!
Comment 5 Andrew Pinski 2003-08-18 16:13:47 UTC
This looks related to bug 11894.
Comment 6 Dara Hazeghi 2003-08-18 17:25:45 UTC
Well I'll be darned. You're completely right! I assume sysroot won't be put on the branch then?
Comment 7 Daniel Jacobowitz 2003-08-18 17:28:40 UTC
Subject: Re:  cross build using sysroot fails when headers not in $prefix/$target/include

Probably not, since it was initially rejected.
Comment 8 Dara Hazeghi 2003-08-18 17:45:29 UTC
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!