From f3db3a087ef5b51880498b5a363c3741743e8020 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Sat, 10 Jan 2026 12:32:02 +0100 Subject: [PATCH] std: ignore -fmacro-prefix-map flag when parsing NIX_CFLAGS_COMPILE Since we ignore this flag in `clang_options_data.zig`, it makes sense to ignore it for Nix as well. One thing I've been thinking about is if it would make sense to somehow use `clang_options_data.zig` as source of truth for handling Nix cflags too rather than slap more hard-coded escape hatches. --- lib/std/zig/system/NativePaths.zig | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/std/zig/system/NativePaths.zig b/lib/std/zig/system/NativePaths.zig index f8003cd62061b4cfeb936533448e9a4b9f20dbb4..e289fa75155f375bbd347ba061a440d822b4d3b1 100644 --- a/lib/std/zig/system/NativePaths.zig +++ b/lib/std/zig/system/NativePaths.zig @@ -40,10 +40,11 @@ pub fn detect( break; }; try self.addFrameworkDir(framework_path); + } else if (mem.startsWith(u8, word, "-frandom-seed=") or + mem.startsWith(u8, word, "-fmacro-prefix-map=")) + { + // Ignore this argument. } else { - if (mem.startsWith(u8, word, "-frandom-seed=")) { - continue; - } try self.addWarningFmt("Unrecognized C flag from NIX_CFLAGS_COMPILE: {s}", .{word}); } } -- 2.54.0