mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
* Merge r3019.
svn path=/nixpkgs/trunk/; revision=3186
This commit is contained in:
parent
1e5e23ce5d
commit
9cc0ac9090
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue