qemu: work around ld64 hardening issue

This commit is contained in:
Emily
2026-07-03 16:28:51 +01:00
parent 3b114d3460
commit 7a83e820dd

View File

@@ -123,6 +123,9 @@
minimal ? toolsOnly || userOnly,
gitUpdater,
qemu-utils, # for tests attribute
# TODO: Clean up on `staging`.
llvmPackages,
}:
assert lib.assertMsg (
@@ -180,6 +183,9 @@ stdenv.mkDerivation (finalAttrs: {
++ lib.optionals hexagonSupport [ glib ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.sigtool
# TODO: Clean up on `staging`.
llvmPackages.lld
]
++ lib.optionals (!userOnly) [ dtc ];
@@ -425,6 +431,10 @@ stdenv.mkDerivation (finalAttrs: {
ln -s $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} $out/bin/qemu-kvm
'';
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
NIX_CFLAGS_LINK = "-fuse-ld=lld";
};
passthru = {
qemu-system-i386 = "bin/qemu-system-i386";
tests = lib.optionalAttrs (!toolsOnly) {