glibc: disable all warnings

This commit is contained in:
Alex Rønne Petersen
2026-04-15 02:02:37 +02:00
parent ff21acc4ed
commit 9115aee6d7
+13 -7
View File
@@ -189,11 +189,11 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
var args = std.array_list.Managed([]const u8).init(arena);
try add_include_dirs(comp, arena, &args);
try args.appendSlice(&[_][]const u8{
"-w", // Disable all warnings.
"-D_LIBC_REENTRANT",
"-include",
try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
"-DMODULE_NAME=libc",
"-Wno-nonportable-include-path",
"-include",
try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
"-DPIC",
@@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
});
try add_include_dirs(comp, arena, &args);
try args.appendSlice(&[_][]const u8{
"-w", // Disable all warnings.
"-D_LIBC_REENTRANT",
"-DMODULE_NAME=libc",
"-DTOP_NAMESPACE=glibc",
@@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
.owner = undefined,
};
};
const init_o: Compilation.CSourceFile = .{
.src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"),
.owner = undefined,
const init_o: Compilation.CSourceFile = blk: {
var args = std.array_list.Managed([]const u8).init(arena);
try args.appendSlice(&[_][]const u8{
"-w", // Disable all warnings.
});
break :blk .{
.src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"),
.cache_exempt_flags = args.items,
.owner = undefined,
};
};
var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o };
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
var args = std.array_list.Managed([]const u8).init(arena);
try args.appendSlice(&[_][]const u8{
"-w", // Disable all warnings.
"-std=gnu11",
"-fgnu89-inline",
"-fmerge-all-constants",
"-frounding-math",
"-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.
"-fno-common",
"-fmath-errno",
"-ftls-model=initial-exec",
"-Wno-ignored-attributes",
"-Qunused-arguments",
});
try add_include_dirs(comp, arena, &args);
@@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
"-include",
try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"),
"-DMODULE_NAME=libc",
"-Wno-nonportable-include-path",
"-include",
try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"),
"-DPIC",