diff --git a/pkgs/build-support/gcc-cross-wrapper/builder.sh b/pkgs/build-support/gcc-cross-wrapper/builder.sh index 9396ace84f11..1bdda9696536 100644 --- a/pkgs/build-support/gcc-cross-wrapper/builder.sh +++ b/pkgs/build-support/gcc-cross-wrapper/builder.sh @@ -7,7 +7,7 @@ mkdir $out/nix-support # Force gcc to use ld-wrapper.sh when calling ld. cflagsCompile="-B$out/bin/" -if test -z "$nativeLibc"; then +if test -z "$nativeLibc" -a -n "$libc"; then cflagsCompile="$cflagsCompile -B$gccLibs/lib -B$libc/lib/ -isystem $libc/include" ldflags="$ldflags -L$libc/lib" # Get the proper dynamic linker for glibc and uclibc.