mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-17 18:34:38 +00:00
nixos/cc-wrapper: Fix bug if dynamicLinker not found
If a dynamic linker for target is not found the generated script fails due to unbound variable error (due to "set -u"). Correct by specifying default value with dynamicLinker:- and not generating ldflagsBefore if no linker is found. This problem was found when cross compiling to mingw32 targets
This commit is contained in:
parent
21806cfb83
commit
3e9daece1d
@ -286,7 +286,7 @@ stdenv.mkDerivation {
|
||||
*) echo "Multiple dynamic linkers found for platform '${targetPlatform.config}'." >&2;;
|
||||
esac
|
||||
|
||||
if [ -n "$dynamicLinker" ]; then
|
||||
if [ -n "''${dynamicLinker:-}" ]; then
|
||||
echo $dynamicLinker > $out/nix-support/dynamic-linker
|
||||
|
||||
'' + (if targetPlatform.isDarwin then ''
|
||||
@ -296,7 +296,9 @@ stdenv.mkDerivation {
|
||||
echo ${libc_lib}/lib/32/ld-linux.so.2 > $out/nix-support/dynamic-linker-m32
|
||||
fi
|
||||
|
||||
local ldflagsBefore=(-dynamic-linker "$dynamicLinker")
|
||||
if [ -n "''${dynamicLinker:-}" ]; then
|
||||
local ldflagsBefore=(-dynamic-linker "$dynamicLinker")
|
||||
fi
|
||||
'') + ''
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user