kexec-tools: fix compiling with llvm

Fixes #317526
This commit is contained in:
Tristan Ross 2024-06-07 00:02:22 -07:00
parent f720f2256e
commit b51cf6ec0e
No known key found for this signature in database
GPG Key ID: B09C422035669AF8
3 changed files with 13 additions and 12 deletions

View File

@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
url = "https://github.com/horms/kexec-tools/commit/328de8e00e298f00d7ba6b25dc3950147e9642e6.patch";
hash = "sha256-wVQI4oV+hBLq3kGIp2+F5J3f6s/TypDu3Xq583KYc3U=";
})
];
] ++ lib.optional (stdenv.hostPlatform.useLLVM or false) ./fix-purgatory-llvm-libunwind.patch;
hardeningDisable = [ "format" "pic" "relro" "pie" ];

View File

@ -0,0 +1,11 @@
--- a/purgatory/Makefile 2024-06-06 23:59:33.089005832 -0700
+++ b/purgatory/Makefile 2024-06-06 23:59:56.761169892 -0700
@@ -62,7 +62,7 @@
$(PURGATORY): LDFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS)\
-Wl,--no-undefined -nostartfiles -nostdlib \
-nodefaultlibs -e purgatory_start -r \
- -Wl,-Map=$(PURGATORY_MAP)
+ -Wl,-Map=$(PURGATORY_MAP) -static
$(PURGATORY): $(PURGATORY_OBJS)
$(MKDIR) -p $(@D)

View File

@ -9474,17 +9474,7 @@ with pkgs;
kestrel = callPackage ../tools/security/kestrel { };
kexec-tools = callPackage ../os-specific/linux/kexec-tools {
# clangStdenv fails with
# purgatory/arch/i386/entry32-16.S:23:2: error: unknown directive
# .arch i386
# ^
# purgatory/arch/i386/entry32-16.S:115:11: error: unknown token in expression
# ljmp %cs:*(realdest - entry16)
# ^
# make: *** [Makefile:128: purgatory/arch/i386/entry32-16.o] Error 1
stdenv = gccStdenv;
};
kexec-tools = callPackage ../os-specific/linux/kexec-tools { };
keepkey-agent = with python3Packages; toPythonApplication keepkey-agent;