From a4543ae1bc44094a962462a2d0fb6c3b482182fa Mon Sep 17 00:00:00 2001 From: Peter Waller Date: Tue, 10 Dec 2024 09:01:31 +0000 Subject: [PATCH] pkgsLLVM: Fix unwanted target offset pkgsLLVM introduced an unwanted target offset, as can be seen with the following commands. Before this commit: ``` $ nix eval --system x86_64-linux -f . pkgsCross.aarch64-multiplatform.buildPackages.stdenv.hostPlatform.config "x86_64-unknown-linux-gnu" $ nix eval --system x86_64-linux -f . pkgsCross.aarch64-multiplatform.buildPackages.pkgsLLVM.stdenv.hostPlatform.config "aarch64-unknown-linux-gnu" Explaination: These two should be the same, since the only difference between them is the addition of "pkgsLLVM". The buildPackages of the pkgsCross set should have a hostPlatform which is the native platform. ``` After this commit: ``` $ nix eval --system x86_64-linux -f . pkgsCross.aarch64-multiplatform.buildPackages.stdenv.hostPlatform.config "x86_64-unknown-linux-gnu" $ nix eval --system x86_64-linux -f . pkgsCross.aarch64-multiplatform.buildPackages.pkgsLLVM.stdenv.hostPlatform.config "x86_64-unknown-linux-gnu" ``` --- pkgs/top-level/stage.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index 78c22d4f70e2..1cedd8dd1845 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -201,7 +201,7 @@ let # Bootstrap a cross stdenv using the LLVM toolchain. # This is currently not possible when compiling natively, # so we don't need to check hostPlatform != buildPlatform. - crossSystem = stdenv.targetPlatform // { + crossSystem = stdenv.hostPlatform // { useLLVM = true; linker = "lld"; };