diff --git a/pkgs/build-support/gcc-wrapper/builder.sh b/pkgs/build-support/gcc-wrapper/builder.sh index e8dd5fa277f..b9a811dd747 100644 --- a/pkgs/build-support/gcc-wrapper/builder.sh +++ b/pkgs/build-support/gcc-wrapper/builder.sh @@ -22,6 +22,9 @@ if test -n "$nativeTools"; then gccPath="$nativePrefix/bin" ldPath="$nativePrefix/bin" else + if test -e "$gcc/lib64"; then + ldflags="$ldflags -L$gcc/lib64" + fi ldflags="$ldflags -L$gcc/lib" gccPath="$gcc/bin" ldPath="$binutils/bin" diff --git a/pkgs/build-support/gcc-wrapper/setup-hook.sh b/pkgs/build-support/gcc-wrapper/setup-hook.sh index 7a7ea822691..1739d8dcae5 100644 --- a/pkgs/build-support/gcc-wrapper/setup-hook.sh +++ b/pkgs/build-support/gcc-wrapper/setup-hook.sh @@ -3,6 +3,10 @@ addCVars () { export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$1/include" fi + if test -d $1/lib64; then + export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib64" + fi + if test -d $1/lib; then export NIX_LDFLAGS="$NIX_LDFLAGS -L$1/lib" fi