From cbf00af868e527f61ab59746ea23507a7e1e124a Mon Sep 17 00:00:00 2001 From: Techatrix Date: Thu, 6 Aug 2026 19:54:20 +0200 Subject: [PATCH] std.Build: remove unused libc flag from compile step Whether libc and libcpp need to be linked is resolved on the maker side in `Maker/Step/Compile.zig`. --- lib/compiler/Maker/Step/Compile.zig | 4 ++-- lib/std/Build/Configuration.zig | 3 +-- lib/std/Build/Serialize.zig | 2 -- lib/std/Build/Step/Compile.zig | 5 ----- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/lib/compiler/Maker/Step/Compile.zig b/lib/compiler/Maker/Step/Compile.zig index adf88b9f1baef3712b1d6ca707d4bed7db25e700..c487966999ca178d88b83332b0f953baa410a52e 100644 --- a/lib/compiler/Maker/Step/Compile.zig +++ b/lib/compiler/Maker/Step/Compile.zig @@ -215,8 +215,8 @@ fn lowerZigArgs( try addBool(gpa, zig_args, "-ffuzz", fuzz); { - var is_linking_libc = conf_comp.flags3.is_linking_libc; - var is_linking_libcpp = conf_comp.flags3.is_linking_libcpp; + var is_linking_libc = false; + var is_linking_libcpp = false; // Stores system libraries that have already been seen for at least one // module, along with any C compiler arguments that need to be passed diff --git a/lib/std/Build/Configuration.zig b/lib/std/Build/Configuration.zig index 5743d9800ced11e00ff61ce5a122c6c5bca83b3f..8337da6d2f9d44f6f3b0a96241b4478f55afe3b0 100644 --- a/lib/std/Build/Configuration.zig +++ b/lib/std/Build/Configuration.zig @@ -984,8 +984,6 @@ pub const Step = extern struct { }; pub const Flags3 = packed struct(u32) { - is_linking_libc: bool, - is_linking_libcpp: bool, version: bool, initial_memory: bool, max_memory: bool, @@ -1003,6 +1001,7 @@ pub const Step = extern struct { entry: Entry, lto: Lto, subsystem: Subsystem, + _: u2 = 0, }; pub const Flags4 = packed struct(u32) { diff --git a/lib/std/Build/Serialize.zig b/lib/std/Build/Serialize.zig index 72355264d978c15b712d92242df14f0c92eb4b6f..c3e9443181565196d6d922ea97f6e94f386b0f8a 100644 --- a/lib/std/Build/Serialize.zig +++ b/lib/std/Build/Serialize.zig @@ -168,8 +168,6 @@ pub fn write(b: *std.Build, wc: *Configuration.Wip, writer: *std.Io.Writer) !voi .linkage = .init(c.linkage), }, .flags3 = .{ - .is_linking_libc = c.is_linking_libc, - .is_linking_libcpp = c.is_linking_libcpp, .version = c.version != null, .compress_debug_sections = c.compress_debug_sections, .initial_memory = c.initial_memory != null, diff --git a/lib/std/Build/Step/Compile.zig b/lib/std/Build/Step/Compile.zig index 0f7cdbc405d74778a28e370c477dcb5b58ca1e8c..df4da47b01df0ae1bdb0ad19e090437f96063bb7 100644 --- a/lib/std/Build/Step/Compile.zig +++ b/lib/std/Build/Step/Compile.zig @@ -220,11 +220,6 @@ expect_errors: ?ExpectedCompileErrors = null, /// `std.math.maxInt(u16)`. Overrides the argument passed to `zig build`. error_limit: ?u32 = null, -/// Computed during make(). -is_linking_libc: bool = false, -/// Computed during make(). -is_linking_libcpp: bool = false, - /// Enables coverage instrumentation that is only useful if you are using third /// party fuzzers that depend on it. Otherwise, slows down the instrumented /// binary with unnecessary function calls. -- 2.54.0