authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-05 12:18:35+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2024-11-05 22:41:09+01:00
logf973d3e93e9bb419212a187e787de94929de928d
tree75e5b300531e5efe5a67beb443337d59586b8174
parent2a65b84572f19369e831d71c513da88a295193c8
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

glibc, musl, wasi-libc: Don't explicitly pass -fno-stack-protector.

This is already handled by build_crt_file().

3 files changed, 3 insertions(+), 14 deletions(-)

src/glibc.zig-1
...@@ -373,7 +373,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre...@@ -373,7 +373,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
373 "-fmerge-all-constants",373 "-fmerge-all-constants",
374 "-frounding-math",374 "-frounding-math",
375 "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.375 "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.
376 "-fno-stack-protector",
377 "-fno-common",376 "-fno-common",
378 "-fmath-errno",377 "-fmath-errno",
379 "-ftls-model=initial-exec",378 "-ftls-model=initial-exec",
src/musl.zig+3-12
...@@ -59,10 +59,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro...@@ -59,10 +59,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
59 .crt1_o => {59 .crt1_o => {
60 var args = std.ArrayList([]const u8).init(arena);60 var args = std.ArrayList([]const u8).init(arena);
61 try addCcArgs(comp, arena, &args, false);61 try addCcArgs(comp, arena, &args, false);
62 try args.appendSlice(&[_][]const u8{62 try args.append("-DCRT");
63 "-fno-stack-protector",
64 "-DCRT",
65 });
66 var files = [_]Compilation.CSourceFile{63 var files = [_]Compilation.CSourceFile{
67 .{64 .{
68 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{65 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
...@@ -79,10 +76,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro...@@ -79,10 +76,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
79 .rcrt1_o => {76 .rcrt1_o => {
80 var args = std.ArrayList([]const u8).init(arena);77 var args = std.ArrayList([]const u8).init(arena);
81 try addCcArgs(comp, arena, &args, false);78 try addCcArgs(comp, arena, &args, false);
82 try args.appendSlice(&[_][]const u8{79 try args.append("-DCRT");
83 "-fno-stack-protector",
84 "-DCRT",
85 });
86 var files = [_]Compilation.CSourceFile{80 var files = [_]Compilation.CSourceFile{
87 .{81 .{
88 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{82 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
...@@ -100,10 +94,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro...@@ -100,10 +94,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
100 .scrt1_o => {94 .scrt1_o => {
101 var args = std.ArrayList([]const u8).init(arena);95 var args = std.ArrayList([]const u8).init(arena);
102 try addCcArgs(comp, arena, &args, false);96 try addCcArgs(comp, arena, &args, false);
103 try args.appendSlice(&[_][]const u8{97 try args.append("-DCRT");
104 "-fno-stack-protector",
105 "-DCRT",
106 });
107 var files = [_]Compilation.CSourceFile{98 var files = [_]Compilation.CSourceFile{
108 .{99 .{
109 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{100 .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
src/wasi_libc.zig-1
...@@ -279,7 +279,6 @@ fn addCCArgs(...@@ -279,7 +279,6 @@ fn addCCArgs(
279 try args.appendSlice(&[_][]const u8{279 try args.appendSlice(&[_][]const u8{
280 "-std=gnu17",280 "-std=gnu17",
281 "-fno-trapping-math",281 "-fno-trapping-math",
282 "-fno-stack-protector",
283 "-w", // ignore all warnings282 "-w", // ignore all warnings
284283
285 o_arg,284 o_arg,