limine: Fix build

Resolves #377469 by compiling the freestanding part with an
unwrapped compiler. This compiler is required to be the default
directly in the `PATH`. However a *wrapped* compiler is *also*
required, but can be passed by a `CC` environment variable.

Includes change to clang path from lzcnt.
This commit is contained in:
Angelo Bulfone
2025-02-21 14:30:38 -08:00
committed by Angel Bulfone
parent 852ff1d9e1
commit 66e76afcd0
+8 -1
View File
@@ -47,7 +47,13 @@ let
++ lib.optionals pxeSupport [ "--enable-bios-pxe" ]
++ lib.concatMap uefiFlags (
if targets == [ ] then [ stdenv.hostPlatform.parsed.cpu.name ] else targets
);
)
++ [
"TOOLCHAIN_FOR_TARGET=llvm"
# `clang` on `PATH` has to be unwrapped, but *a* wrapped clang
# still needs to be available
"CC=${lib.getExe stdenv.cc}"
];
in
assert lib.assertMsg (!(biosSupport && !hasI686)) "BIOS builds are possible only for x86";
@@ -76,6 +82,7 @@ stdenv.mkDerivation {
nativeBuildInputs =
[
llvmPackages.clang-unwrapped
llvmPackages.libllvm
llvmPackages.lld
]