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...@@ -189,11 +189,11 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
189 var args = std.array_list.Managed([]const u8).init(arena);189 var args = std.array_list.Managed([]const u8).init(arena);
190 try add_include_dirs(comp, arena, &args);190 try add_include_dirs(comp, arena, &args);
191 try args.appendSlice(&[_][]const u8{191 try args.appendSlice(&[_][]const u8{
192 "-w", // Disable all warnings.
192 "-D_LIBC_REENTRANT",193 "-D_LIBC_REENTRANT",
193 "-include",194 "-include",
194 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),195 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
195 "-DMODULE_NAME=libc",196 "-DMODULE_NAME=libc",
196 "-Wno-nonportable-include-path",
197 "-include",197 "-include",
198 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),198 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
199 "-DPIC",199 "-DPIC",
...@@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
217 });217 });
218 try add_include_dirs(comp, arena, &args);218 try add_include_dirs(comp, arena, &args);
219 try args.appendSlice(&[_][]const u8{219 try args.appendSlice(&[_][]const u8{
220 "-w", // Disable all warnings.
220 "-D_LIBC_REENTRANT",221 "-D_LIBC_REENTRANT",
221 "-DMODULE_NAME=libc",222 "-DMODULE_NAME=libc",
222 "-DTOP_NAMESPACE=glibc",223 "-DTOP_NAMESPACE=glibc",
...@@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
229 .owner = undefined,230 .owner = undefined,
230 };231 };
231 };232 };
232 const init_o: Compilation.CSourceFile = .{233 const init_o: Compilation.CSourceFile = blk: {
233 .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"),234 var args = std.array_list.Managed([]const u8).init(arena);
234 .owner = undefined,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 };
235 };243 };
236 var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o };244 var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o };
237 const basename = if (comp.config.output_mode == .Exe and !comp.config.pie) "crt1" else "Scrt1";245 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...@@ -308,15 +316,14 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
308316
309 var args = std.array_list.Managed([]const u8).init(arena);317 var args = std.array_list.Managed([]const u8).init(arena);
310 try args.appendSlice(&[_][]const u8{318 try args.appendSlice(&[_][]const u8{
319 "-w", // Disable all warnings.
311 "-std=gnu11",320 "-std=gnu11",
312 "-fgnu89-inline",321 "-fgnu89-inline",
313 "-fmerge-all-constants",322 "-fmerge-all-constants",
314 "-frounding-math",323 "-frounding-math",
315 "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.
316 "-fno-common",324 "-fno-common",
317 "-fmath-errno",325 "-fmath-errno",
318 "-ftls-model=initial-exec",326 "-ftls-model=initial-exec",
319 "-Wno-ignored-attributes",
320 "-Qunused-arguments",327 "-Qunused-arguments",
321 });328 });
322 try add_include_dirs(comp, arena, &args);329 try add_include_dirs(comp, arena, &args);
...@@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
335 "-include",342 "-include",
336 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),343 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
337 "-DMODULE_NAME=libc",344 "-DMODULE_NAME=libc",
338 "-Wno-nonportable-include-path",
339 "-include",345 "-include",
340 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),346 try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
341 "-DPIC",347 "-DPIC",