ld64: fix cross-compilation install check phase

ld64 needs to build itself in its install check using a target prefix. Otherwise, ninja will not be configured with the correct target, causing the check to fail when ld64 is built for a cross-target.
This commit is contained in:
Randy Eckenrode 2024-07-29 18:27:59 -04:00
parent 532781c985
commit 957be61c02
No known key found for this signature in database
GPG Key ID: 64C1CD4EC2A600D9

View File

@ -170,7 +170,9 @@ stdenv.mkDerivation (finalAttrs: {
cd "$NIX_BUILD_TOP/$sourceRoot"
export NIX_CFLAGS_COMPILE+=" --ld-path=$out/bin/${targetPrefix}ld"
meson setup build-install-check -Db_lto=true --buildtype=$mesonBuildType
meson setup build-install-check -Db_lto=true --buildtype=$mesonBuildType${
lib.optionalString (targetPrefix != "") " -Dtarget_prefix=${targetPrefix}"
}
cd build-install-check
ninja ${targetPrefix}ld "-j$NIX_BUILD_CORES"