Bug 30832 - [regression] --with-sysroot=foobar wrong handled
Summary: [regression] --with-sysroot=foobar wrong handled
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-17 10:10 UTC by Marco Trudel
Modified: 2007-02-20 10:42 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Trudel 2007-02-17 10:10:16 UTC
Configuring with:
/usr/local/src/gcc/configure --prefix=/home/Marco/Desktop/manual-test/gcc --with-sysroot=/home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root --enable-languages=c,c++ --with-gmp=/home/Marco/Desktop/compile-lin-lin/gmp-out --with-mpfr=/home/Marco/Desktop/compile-lin-lin/mpfr-out

leads to a failing make:
/home/Marco/Desktop/manual-test/build/./gcc/xgcc -B/home/Marco/Desktop/manual-test/build/./gcc/ -B/home/Marco/Desktop/manual-test/gcc/i686-pc-linux-gnu/bin/ -B/home/Marco/Desktop/manual-test/gcc/i686-pc-linux-gnu/lib/ -isystem /home/Marco/Desktop/manual-test/gcc/i686-pc-linux-gnu/include -isystem /home/Marco/Desktop/manual-test/gcc/i686-pc-linux-gnu/sys-include -g -fkeep-inline-functions -O2  -O2 -g -O2  -DIN_GCC    -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -fPIC -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I. -I../.././gcc -I/usr/local/src/gcc/libgcc -I/usr/local/src/gcc/libgcc/. -I/usr/local/src/gcc/libgcc/../gcc -I/usr/local/src/gcc/libgcc/../include -I/usr/local/src/gcc/libgcc/../libdecnumber -I../../libdecnumber -o _muldi3.o -MT _muldi3.o -MD -MP -MF _muldi3.dep -DL_muldi3 -c /usr/local/src/gcc/libgcc/../gcc/libgcc2.c \
          -fvisibility=hidden -DHIDE_EXPORTS
In file included from /home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/errno.h:36,
                 from /usr/local/src/gcc/libgcc/../gcc/tsystem.h:96,
                 from /usr/local/src/gcc/libgcc/../gcc/libgcc2.c:33:
/home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/bits/errno.h:25:26: error: linux/errno.h: No such file or directory
In file included from /home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/bits/posix1_lim.h:153,
                 from /home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/limits.h:145,
                 from /home/Marco/Desktop/manual-test/build/./gcc/include/limits.h:122,
                 from /home/Marco/Desktop/manual-test/build/./gcc/include/syslimits.h:7,
                 from /home/Marco/Desktop/manual-test/build/./gcc/include/limits.h:11,
                 from /usr/local/src/gcc/libgcc/../gcc/tsystem.h:108,
                 from /usr/local/src/gcc/libgcc/../gcc/libgcc2.c:33:
/home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/bits/local_lim.h:36:26: error: linux/limits.h: No such file or directory
make[3]: *** [_muldi3.o] Error 1
make[3]: Leaving directory `/home/Marco/Desktop/manual-test/build/i686-pc-linux-gnu/libgcc'

In sysroot, I have glibc and glibc-devel. This worked with gcc 4.2 and with gcc 4.3 for every build, host, target combination except all linux-gnu. The most interesting one is a build=linux host=mingw target=linux where sysroot contains the exactly same files. This, as said already, works...

This should work at least because I use --with-sysroot and not --with-build-sysroot.
Comment 1 Andreas Schwab 2007-02-17 10:16:32 UTC
Your sysroot is missing the kernel headers.  There should be a dependency of glibc-devel on the appropriate package that contains them.
Comment 2 Marco Trudel 2007-02-17 11:30:54 UTC
No, for these reasons:
- It worked for 4.2
- I would agree if I used --with-build-sysroot
- It works with a cross host=mingw target=linux
- It doesn't work if I copy the missing headers to sysroot
Comment 3 Andreas Schwab 2007-02-17 12:12:00 UTC
Please show the output of "ls /home/Marco/Desktop/compile-lin-lin/gcc-XYZXYZ-lin/sys-root/usr/include/linux/errno.h".
Comment 4 Marco Trudel 2007-02-17 12:23:50 UTC
Update:
It works if I copy the kernel-headers into $SYS_ROOT/usr/include instead of $SYS_ROOT/include.
However, I really think this should not be required since it worked with gcc 4.2 and everything else is the same. So either it was a catastrophic build error on 4.2 and miracle that the compiled gcc worked (without linux/limits.h) or it's a regression now.

Comment 5 Andreas Schwab 2007-02-17 14:31:01 UTC
$SYS_ROOT/include has no significance.  The standard include directory is /usr/include, and sysroot mirrors exactly the standard directory layout.
Comment 6 Daniel Jacobowitz 2007-02-17 21:24:34 UTC
Subject: Re:  [regression] --with-sysroot=foobar wrong handled

On Sat, Feb 17, 2007 at 12:23:51PM -0000, mtrudel at gmx dot ch wrote:
> However, I really think this should not be required since it worked with gcc
> 4.2 and everything else is the same. So either it was a catastrophic build
> error on 4.2 and miracle that the compiled gcc worked (without linux/limits.h)
> or it's a regression now.

Sounds more like the former.  4.2 may have been using your system's
headers in this case.

Comment 7 Marco Trudel 2007-02-19 08:25:57 UTC
Well, it makes sense that the kernel-source is also needed. But then again, we have four setups:
1. GCC 4.2, build=linux, host=linux, target=linux
2. GCC 4.2, build=linux, host=mingw, target=linux
3. GCC 4.3, build=linux, host=linux, target=linux
4. GCC 4.3, build=linux, host=mingw, target=linux

For all, I specify --with-sysroot but not --with-build-sysroot and put glibc and glibc-devel into the specified sysroot. For setup 1, 2 and 4 this works. Only setup 3 is missing "linux/limits.h". So, how probable is that we have 3 builds that work although they shouldn't and only one that does the right thing by failing?
Comment 8 Marco Trudel 2007-02-20 10:42:13 UTC
Since there seems to be an issue, I would like to reopen this bug but change the summary to:
gcc 4.2/4.3: different --with-sysroot handling

Although I'm not sure if it actually is a bug, I think it should be attended to.
So if there are no objections until tomorrow evening, I'll reopen it (once more).