| ... | ... | @@ -189,11 +189,11 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre |
| 189 | 189 | var args = std.array_list.Managed([]const u8).init(arena); |
| 190 | 190 | try add_include_dirs(comp, arena, &args); |
| 191 | 191 | try args.appendSlice(&[_][]const u8{ |
| 192 | "-w", // Disable all warnings. |
| 192 | 193 | "-D_LIBC_REENTRANT", |
| 193 | 194 | "-include", |
| 194 | 195 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), |
| 195 | 196 | "-DMODULE_NAME=libc", |
| 196 | | "-Wno-nonportable-include-path", |
| 197 | 197 | "-include", |
| 198 | 198 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), |
| 199 | 199 | "-DPIC", |
| ... | ... | @@ -217,6 +217,7 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre |
| 217 | 217 | }); |
| 218 | 218 | try add_include_dirs(comp, arena, &args); |
| 219 | 219 | try args.appendSlice(&[_][]const u8{ |
| 220 | "-w", // Disable all warnings. |
| 220 | 221 | "-D_LIBC_REENTRANT", |
| 221 | 222 | "-DMODULE_NAME=libc", |
| 222 | 223 | "-DTOP_NAMESPACE=glibc", |
| ... | ... | @@ -229,9 +230,16 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre |
| 229 | 230 | .owner = undefined, |
| 230 | 231 | }; |
| 231 | 232 | }; |
| 232 | | const init_o: Compilation.CSourceFile = .{ |
| 233 | | .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"), |
| 234 | | .owner = undefined, |
| 233 | const init_o: Compilation.CSourceFile = blk: { |
| 234 | var args = std.array_list.Managed([]const u8).init(arena); |
| 235 | try args.appendSlice(&[_][]const u8{ |
| 236 | "-w", // Disable all warnings. |
| 237 | }); |
| 238 | break :blk .{ |
| 239 | .src_path = try lib_path(comp, arena, lib_libc_glibc ++ "csu" ++ path.sep_str ++ "init.c"), |
| 240 | .cache_exempt_flags = args.items, |
| 241 | .owner = undefined, |
| 242 | }; |
| 235 | 243 | }; |
| 236 | 244 | var files = [_]Compilation.CSourceFile{ start_o, abi_note_o, init_o }; |
| 237 | 245 | 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 |
| 308 | 316 | |
| 309 | 317 | var args = std.array_list.Managed([]const u8).init(arena); |
| 310 | 318 | try args.appendSlice(&[_][]const u8{ |
| 319 | "-w", // Disable all warnings. |
| 311 | 320 | "-std=gnu11", |
| 312 | 321 | "-fgnu89-inline", |
| 313 | 322 | "-fmerge-all-constants", |
| 314 | 323 | "-frounding-math", |
| 315 | | "-Wno-unsupported-floating-point-opt", // For targets that don't support -frounding-math. |
| 316 | 324 | "-fno-common", |
| 317 | 325 | "-fmath-errno", |
| 318 | 326 | "-ftls-model=initial-exec", |
| 319 | | "-Wno-ignored-attributes", |
| 320 | 327 | "-Qunused-arguments", |
| 321 | 328 | }); |
| 322 | 329 | try add_include_dirs(comp, arena, &args); |
| ... | ... | @@ -335,7 +342,6 @@ pub fn buildCrtFile(comp: *Compilation, crt_file: CrtFile, prog_node: std.Progre |
| 335 | 342 | "-include", |
| 336 | 343 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-modules.h"), |
| 337 | 344 | "-DMODULE_NAME=libc", |
| 338 | | "-Wno-nonportable-include-path", |
| 339 | 345 | "-include", |
| 340 | 346 | try lib_path(comp, arena, lib_libc_glibc ++ "include" ++ path.sep_str ++ "libc-symbols.h"), |
| 341 | 347 | "-DPIC", |