* Put Glibc at the very end of the GCC header search path. This

should fix previous problems with GCC 4.3 in compiling C++ code
  where e.g. <cassert> has to appear before <assert.h> in the search
  path due to the former's use of #include_next.  The previous "fix"
  broke compilation of C code by placing the C++ include directory
  before the Glibc include directory (which would barf on
  e.g. <complex.h>, which appears in both).

svn path=/nixpkgs/branches/stdenv-updates/; revision=13806
This commit is contained in:
Eelco Dolstra 2009-01-19 16:22:27 +00:00
parent f7ad184041
commit 72822ebbc0

View File

@ -17,7 +17,7 @@ if test -z "$nativeLibc"; then
# against the crt1.o from our own glibc, rather than the one in
# /usr/lib. (This is only an issue when using an `impure'
# compiler/linker, i.e., one that searches /usr/lib and so on.)
echo "-B$libc/lib/ -isystem $libc/include" > $out/nix-support/libc-cflags
echo "-B$libc/lib/ -idirafter $libc/include" > $out/nix-support/libc-cflags
echo "-L$libc/lib" > $out/nix-support/libc-ldflags
@ -37,17 +37,6 @@ else
gccLDFlags="$gccLDFlags -L$gcc/lib"
echo "$gccLDFlags" > $out/nix-support/gcc-ldflags
# Explicitly add the libstdc++ header files to the search path.
# G++ already finds them automatically, but it adds them to the
# very end of the header search path. This means that
# #include_next constructs in the libstdc++ headers won't find the
# Glibc headers, since they appear *before* the libstdc++ headers.
# So we add them here using -isystem. Note that `add-flags' adds
# the libc flags before the gcc flags.
if test -e $gcc/include/c++/*.*; then
gccCFlags="$gccCFlags -isystem $(echo $gcc/include/c++/*.*)"
fi
# GCC shows $gcc/lib in `gcc -print-search-dirs', but not
# $gcc/lib64 (even though it does actually search there...)..
# This confuses libtool. So add it to the compiler tool search