Commit f973d3e93e

Alex Rønne Petersen <alex@alexrp.com>
2024-11-05 12:18:35
glibc, musl, wasi-libc: Don't explicitly pass -fno-stack-protector.
This is already handled by build_crt_file().
1 parent 2a65b84
Changed files (3)
src/glibc.zig
@@ -373,7 +373,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre
                     "-fmerge-all-constants",
                     "-frounding-math",
                     "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math.
-                    "-fno-stack-protector",
                     "-fno-common",
                     "-fmath-errno",
                     "-ftls-model=initial-exec",
src/musl.zig
@@ -59,10 +59,7 @@ pub fn buildCrtFile(comp: *Compilation, in_crt_file: CrtFile, prog_node: std.Pro
         .crt1_o => {
             var args = std.ArrayList([]const u8).init(arena);
             try addCcArgs(comp, arena, &args, false);
-            try args.appendSlice(&[_][]const u8{
-                "-fno-stack-protector",
-                "-DCRT",
-            });
+            try args.append("-DCRT");
             var files = [_]Compilation.CSourceFile{
                 .{
                     .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
         .rcrt1_o => {
             var args = std.ArrayList([]const u8).init(arena);
             try addCcArgs(comp, arena, &args, false);
-            try args.appendSlice(&[_][]const u8{
-                "-fno-stack-protector",
-                "-DCRT",
-            });
+            try args.append("-DCRT");
             var files = [_]Compilation.CSourceFile{
                 .{
                     .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
         .scrt1_o => {
             var args = std.ArrayList([]const u8).init(arena);
             try addCcArgs(comp, arena, &args, false);
-            try args.appendSlice(&[_][]const u8{
-                "-fno-stack-protector",
-                "-DCRT",
-            });
+            try args.append("-DCRT");
             var files = [_]Compilation.CSourceFile{
                 .{
                     .src_path = try comp.zig_lib_directory.join(arena, &[_][]const u8{
src/wasi_libc.zig
@@ -279,7 +279,6 @@ fn addCCArgs(
     try args.appendSlice(&[_][]const u8{
         "-std=gnu17",
         "-fno-trapping-math",
-        "-fno-stack-protector",
         "-w", // ignore all warnings
 
         o_arg,