From 6490e571365ee9f9a6afc1236adae414cb93ae1e Mon Sep 17 00:00:00 2001 From: Sage Hane Date: Sun, 2 May 2021 02:22:14 +0900 Subject: [PATCH 1/2] std.zig: handle -frandom-seed in NIX_CFLAGS_COMPILE --- lib/std/zig/system.zig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 42099c6efe..9dbe3762d0 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -46,6 +46,9 @@ pub const NativePaths = struct { var it = mem.tokenize(nix_cflags_compile, " "); while (true) { const word = it.next() orelse break; + if (mem.startsWith(u8, word, "-frandom-seed=")) { + continue; + } if (mem.eql(u8, word, "-isystem")) { const include_path = it.next() orelse { try self.addWarning("Expected argument after -isystem in NIX_CFLAGS_COMPILE"); From 975cb9e9a9d4386b73c141459331a3f08904a46e Mon Sep 17 00:00:00 2001 From: Sage Hane Date: Wed, 5 May 2021 04:18:34 +0900 Subject: [PATCH 2/2] std.zig: make the unrecognized C flag case non-fatal --- lib/std/zig/system.zig | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 9dbe3762d0..94d11b0fa1 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -46,9 +46,6 @@ pub const NativePaths = struct { var it = mem.tokenize(nix_cflags_compile, " "); while (true) { const word = it.next() orelse break; - if (mem.startsWith(u8, word, "-frandom-seed=")) { - continue; - } if (mem.eql(u8, word, "-isystem")) { const include_path = it.next() orelse { try self.addWarning("Expected argument after -isystem in NIX_CFLAGS_COMPILE"); @@ -56,8 +53,10 @@ pub const NativePaths = struct { }; try self.addIncludeDir(include_path); } else { + if (mem.startsWith(u8, word, "-frandom-seed=")) { + continue; + } try self.addWarningFmt("Unrecognized C flag from NIX_CFLAGS_COMPILE: {s}", .{word}); - break; } } } else |err| switch (err) {