From 957be61c02537a960bbfd7355eb3783e0f66dd06 Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 29 Jul 2024 18:27:59 -0400 Subject: [PATCH] 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. --- pkgs/by-name/ld/ld64/package.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ld/ld64/package.nix b/pkgs/by-name/ld/ld64/package.nix index ee773bacf3a5..2b00fdfb62db 100644 --- a/pkgs/by-name/ld/ld64/package.nix +++ b/pkgs/by-name/ld/ld64/package.nix @@ -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"