From b46a40ff1db6c4d467925a9a0d72436cdb3a6a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Wed, 22 Jan 2025 21:43:51 +0100 Subject: [PATCH] compiler: Handle --no-eh-frame-hdr as a regular zig build-* flag too. For some reason we accepted --eh-frame-hdr, but not --no-eh-frame-hdr, despite accepting the latter as a -Wl linker flag. --- src/main.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.zig b/src/main.zig index 7d035ab135..cbc1c33319 100644 --- a/src/main.zig +++ b/src/main.zig @@ -575,6 +575,7 @@ const usage_build_generic = \\ 0x[hexstring] Maximum 32 bytes \\ none (default) Disable build-id \\ --eh-frame-hdr Enable C++ exception handling by passing --eh-frame-hdr to linker + \\ --no-eh-frame-hdr Disable C++ exception handling by passing --no-eh-frame-hdr to linker \\ --emit-relocs Enable output of relocation sections for post build tools \\ -z [arg] Set linker extension flags \\ nodelete Indicate that the object cannot be deleted from a process @@ -1582,6 +1583,8 @@ fn buildOutputType( fatal("unable to parse '{s}': {s}", .{ arg, @errorName(err) }); } else if (mem.eql(u8, arg, "--eh-frame-hdr")) { link_eh_frame_hdr = true; + } else if (mem.eql(u8, arg, "--no-eh-frame-hdr")) { + link_eh_frame_hdr = false; } else if (mem.eql(u8, arg, "--dynamicbase")) { linker_dynamicbase = true; } else if (mem.eql(u8, arg, "--no-dynamicbase")) {