From 72822ebbc01c86d148889c3c34c2babd10bd36bb Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 19 Jan 2009 16:22:27 +0000 Subject: [PATCH] * 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. has to appear before 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. , which appears in both). svn path=/nixpkgs/branches/stdenv-updates/; revision=13806 --- pkgs/build-support/gcc-wrapper/builder.sh | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index 1a23294dd74..0691b427325 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -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