From 9cc0ac909033ffe9594e3d4f1610b6aa5121b857 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 17 Jun 2005 09:23:15 +0000 Subject: * Merge r3019. svn path=/nixpkgs/trunk/; revision=3186 --- pkgs/build-support/gcc-wrapper/builder.sh | 6 +++--- pkgs/build-support/gcc-wrapper/gcc-wrapper.sh | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'pkgs/build-support') diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index ade66fcef1cf0..cf3953e2820bb 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 e9b912ba66297..ac61cc1e176f8 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 -- cgit 1.4.1