authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-08-03 18:24:35+02:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-08-06 15:00:47-07:00
loge9b5377b8e411b73d1004f4e15d072ab56aca62e
tree819f5d8cd442d3d5c8bb1e4c0241454f5969a576
parentc8a226a42960297deb0b7bf270cc3ef3253f0c6d

musl: Disable warnings in all compilations.

This is what upstream's configure does. Previously, we only disabled warnings in some musl compilations, with `rcrt1.o` notably being one for which we didn't. This resulted in a warning in `dlstart.c` which is included in `rcrt1.c`. So let's just be consistent and disable warnings for all musl code. Closes #13385.

1 files changed, 3 insertions(+), 10 deletions(-)

src/musl.zig+3-10
...@@ -32,9 +32,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre...@@ -32,9 +32,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
32 .crti_o => {32 .crti_o => {
33 var args = std.ArrayList([]const u8).init(arena);33 var args = std.ArrayList([]const u8).init(arena);
34 try addCcArgs(comp, arena, &args, false);34 try addCcArgs(comp, arena, &args, false);
35 try args.appendSlice(&[_][]const u8{
36 "-Qunused-arguments",
37 });
38 var files = [_]Compilation.CSourceFile{35 var files = [_]Compilation.CSourceFile{
39 .{36 .{
40 .src_path = try start_asm_path(comp, arena, "crti.s"),37 .src_path = try start_asm_path(comp, arena, "crti.s"),
...@@ -47,9 +44,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre...@@ -47,9 +44,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
47 .crtn_o => {44 .crtn_o => {
48 var args = std.ArrayList([]const u8).init(arena);45 var args = std.ArrayList([]const u8).init(arena);
49 try addCcArgs(comp, arena, &args, false);46 try addCcArgs(comp, arena, &args, false);
50 try args.appendSlice(&[_][]const u8{
51 "-Qunused-arguments",
52 });
53 var files = [_]Compilation.CSourceFile{47 var files = [_]Compilation.CSourceFile{
54 .{48 .{
55 .src_path = try start_asm_path(comp, arena, "crtn.s"),49 .src_path = try start_asm_path(comp, arena, "crtn.s"),
...@@ -189,10 +183,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre...@@ -189,10 +183,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
189183
190 var args = std.ArrayList([]const u8).init(arena);184 var args = std.ArrayList([]const u8).init(arena);
191 try addCcArgs(comp, arena, &args, ext == .o3);185 try addCcArgs(comp, arena, &args, ext == .o3);
192 try args.appendSlice(&[_][]const u8{
193 "-Qunused-arguments",
194 "-w", // disable all warnings
195 });
196 const c_source_file = try c_source_files.addOne();186 const c_source_file = try c_source_files.addOne();
197 c_source_file.* = .{187 c_source_file.* = .{
198 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", src_file }),188 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", src_file }),
...@@ -427,6 +417,9 @@ fn addCcArgs(...@@ -427,6 +417,9 @@ fn addCcArgs(
427 "-fno-asynchronous-unwind-tables",417 "-fno-asynchronous-unwind-tables",
428 "-ffunction-sections",418 "-ffunction-sections",
429 "-fdata-sections",419 "-fdata-sections",
420
421 "-Qunused-arguments",
422 "-w", // disable all warnings
430 });423 });
431}424}
432425