gcc-cross-wrapper: fix for non-chroot build

When `libc` is not set, many lines expand to `/lib`, `/include`, which
makes gccCross use host libraries outside Nix (with a different
architecture).
This commit is contained in:
Alexey Shmalko 2016-08-03 03:28:14 +03:00
parent 47024938a2
commit 662721a461
No known key found for this signature in database
GPG key ID: DCEF7BCCEB3066C3

View file

@ -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.