about summary refs log tree commit diff
path: root/pkgs/build-support/gcc-wrapper/builder.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/build-support/gcc-wrapper/builder.sh')
-rwxr-xr-xpkgs/build-support/gcc-wrapper/builder.sh11
1 files changed, 3 insertions, 8 deletions
diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh
index e704c8b67942..352a5895135f 100755
--- a/pkgs/build-support/gcc-wrapper/builder.sh
+++ b/pkgs/build-support/gcc-wrapper/builder.sh
@@ -6,7 +6,7 @@
 # Force gcc to use ld-wrapper.sh when calling ld.
 cflagsCompile="-B$out/bin"
 
-if test -n "$glibc"; then
+if test -z "$nativeGlibc"; then
     # 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
@@ -15,14 +15,11 @@ if test -n "$glibc"; then
     ldflags="$ldflags -L$glibc/lib -rpath $glibc/lib -dynamic-linker $glibc/lib/ld-linux.so.2"
 fi
 
-if test -n "$gcc"; then
-    ldflags="$ldflags -L$gcc/lib -rpath $gcc/lib"
-fi
-
-if test -n "$isNative"; then
+if test -n "$nativeTools"; then
     gccPath="$nativePrefix/bin"
     ldPath="$nativePrefix/bin"
 else
+    ldflags="$ldflags -L$gcc/lib -rpath $gcc/lib"
     gccPath="$gcc/bin"
     ldPath="$binutils/bin"
 fi
@@ -76,8 +73,6 @@ NIX_LDFLAGS="$ldflags \$NIX_LDFLAGS"
 EOF
 
 sed \
-    -e "s^@isNative@^$isNative^g" \
-    -e "s^@enforcePurity@^$enforcePurity^g" \
     -e "s^@gcc@^$gcc^g" \
     -e "s^@binutils@^$binutils^g" \
     -e "s^@glibc@^$glibc^g" \