about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2005-06-17 09:23:15 +0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2005-06-17 09:23:15 +0000
commit9cc0ac909033ffe9594e3d4f1610b6aa5121b857 (patch)
treee6e2e0f5fe19b29396cf6cb200a2b4720c67e985 /pkgs
parent1e5e23ce5dbd1d7fc54a64f8f0944f09e8c07dd9 (diff)
downloadnixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar.gz
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar.bz2
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar.lz
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar.xz
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.tar.zst
nixlib-9cc0ac909033ffe9594e3d4f1610b6aa5121b857.zip
* Merge r3019.
svn path=/nixpkgs/trunk/; revision=3186
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/build-support/gcc-wrapper/builder.sh6
-rw-r--r--pkgs/build-support/gcc-wrapper/gcc-wrapper.sh11
2 files changed, 12 insertions, 5 deletions
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index ade66fcef1cf..cf3953e2820b 100644
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -3,17 +3,17 @@
 
 
 # Force gcc to use ld-wrapper.sh when calling ld.
-cflagsCompile="-B$out/bin"
+cflagsCompile="-B$out/bin/"
 
 if test -z "$nativeGlibc"; then
-    # The "-B$glibc/lib" flag is a quick hack to force gcc to link
+    # The "-B$glibc/lib/" flag is a quick hack to force gcc to link
     # against the crt1.o from our own glibc, rather than the one in
     # /usr/lib.  The real solution is of course to prevent those paths
     # from being used by gcc in the first place.
     # The dynamic linker is passed in `ldflagsBefore' to allow
     # explicit overrides of the dynamic linker by callers to gcc/ld
     # (the *last* value counts, so ours should come first).
-    cflagsCompile="$cflagsCompile -B$glibc/lib -isystem $glibc/include"
+    cflagsCompile="$cflagsCompile -B$glibc/lib/ -isystem $glibc/include"
     ldflags="$ldflags -L$glibc/lib"
     ldflagsBefore="-dynamic-linker $glibc/lib/ld-linux.so.2"
 fi
diff --git a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh
index e9b912ba6629..ac61cc1e176f 100644
--- a/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh
+++ b/pkgs/build-support/gcc-wrapper/gcc-wrapper.sh
@@ -78,7 +78,11 @@ if test "$dontLink" != "1"; then
         extraBefore=(${extraBefore[@]} "-Wl,$i")
     done
     for i in $NIX_LDFLAGS; do
-        extraAfter=(${extraAfter[@]} "-Wl,$i")
+	if test "${i:0:3}" = "-L/"; then
+	    extraAfter=(${extraAfter[@]} "$i")
+	else
+	    extraAfter=(${extraAfter[@]} "-Wl,$i")
+	fi
     done
     export NIX_LDFLAGS_SET=1
 
@@ -108,4 +112,7 @@ if test -n "$NIX_GCC_WRAPPER_EXEC_HOOK"; then
     . "$NIX_GCC_WRAPPER_EXEC_HOOK"
 fi
 
-exec @gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]}
+res=0
+@gccProg@ ${extraBefore[@]} "${params[@]}" ${extraAfter[@]} 2> $NIX_BUILD_TOP/.gcc.errors || res=$?
+grep -v 'file path prefix' < $NIX_BUILD_TOP/.gcc.errors >&2 || true
+exit $res