Skip to content

Commit

Permalink
musl: Disable warnings in all compilations.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alexrp authored and andrewrk committed Aug 6, 2024
1 parent c8a226a commit e9b5377
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/musl.zig
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
.crti_o => {
var args = std.ArrayList([]const u8).init(arena);
try addCcArgs(comp, arena, &args, false);
try args.appendSlice(&[_][]const u8{
"-Qunused-arguments",
});
var files = [_]Compilation.CSourceFile{
.{
.src_path = try start_asm_path(comp, arena, "crti.s"),
Expand All @@ -47,9 +44,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre
.crtn_o => {
var args = std.ArrayList([]const u8).init(arena);
try addCcArgs(comp, arena, &args, false);
try args.appendSlice(&[_][]const u8{
"-Qunused-arguments",
});
var files = [_]Compilation.CSourceFile{
.{
.src_path = try start_asm_path(comp, arena, "crtn.s"),
Expand Down Expand Up @@ -189,10 +183,6 @@ pub fn buildCRTFile(comp: *Compilation, crt_file: CRTFile, prog_node: std.Progre

var args = std.ArrayList([]const u8).init(arena);
try addCcArgs(comp, arena, &args, ext == .o3);
try args.appendSlice(&[_][]const u8{
"-Qunused-arguments",
"-w", // disable all warnings
});
const c_source_file = try c_source_files.addOne();
c_source_file.* = .{
.src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{ "libc", src_file }),
Expand Down Expand Up @@ -427,6 +417,9 @@ fn addCcArgs(
"-fno-asynchronous-unwind-tables",
"-ffunction-sections",
"-fdata-sections",

"-Qunused-arguments",
"-w", // disable all warnings
});
}

Expand Down

0 comments on commit e9b5377

Please sign in to comment.