authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-15 02:02:37+02:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-04-15 02:02:37+02:00
log9115aee6d75970310e512dc1789373533eb33ae4
treeeabe026e6c32a1054ee3d59a29383da361acc79a
parentff21acc4ed0991e4038864f80b695ee8a4d3e7e9
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

glibc: disable all warnings


1 files changed, 13 insertions(+), 7 deletions(-)

src/libs/glibc.zig+13-7
......@@ -189,11 +189,11 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
189189 var args = std.array_list.Managed([]const u8).init(arena);
190190 try add_include_dirs(comp, arena, &args);
191191 try args.appendSlice(&[_][]const u8{
192 "-w", // Disable all warnings.
192193 "-D_LIBC_REENTRANT",
193194 "-include",
194195 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
195196 "-DMODULE_NAME=libc",
196 "-Wno-nonportable-include-path",
197197 "-include",
198198 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
199199 "-DPIC",
......@@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
217217 });
218218 try add_include_dirs(comp, arena, &args);
219219 try args.appendSlice(&[_][]const u8{
220 "-w", // Disable all warnings.
220221 "-D_LIBC_REENTRANT",
221222 "-DMODULE_NAME=libc",
222223 "-DTOP_NAMESPACE=glibc",
......@@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
229230 .owner = undefined,
230231 };
231232 };
232 const init_o: Compilation.CSourceFile = .{
233 .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"),
234 .owner = undefined,
233 const init_o: Compilation.CSourceFile = blk: {
234 var args = std.array_list.Managed([]const u8).init(arena);
235 try args.appendSlice(&[_][]const u8{
236 "-w", // Disable all warnings.
237 });
238 break :blk .{
239 .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"),
240 .cache_exempt_flags = args.items,
241 .owner = undefined,
242 };
235243 };
236244 var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o };
237245 const basename = if (comp.config.output_mode == .Exe and !comp.config.pie) "crt1" else "Scrt1";
......@@ -308,15 +316,14 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
308316
309317 var args = std.array_list.Managed([]const u8).init(arena);
310318 try args.appendSlice(&[_][]const u8{
319 "-w", // Disable all warnings.
311320 "-std=gnu11",
312321 "-fgnu89-inline",
313322 "-fmerge-all-constants",
314323 "-frounding-math",
315 "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.
316324 "-fno-common",
317325 "-fmath-errno",
318326 "-ftls-model=initial-exec",
319 "-Wno-ignored-attributes",
320327 "-Qunused-arguments",
321328 });
322329 try add_include_dirs(comp, arena, &args);
......@@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
335342 "-include",
336343 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
337344 "-DMODULE_NAME=libc",
338 "-Wno-nonportable-include-path",
339345 "-include",
340346 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
341347 "-DPIC",