authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-24 16:05:43-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2026-08-26 20:54:49-07:00
log5a8c5e322b67c16be6cdcec7621c4a59ae86dd85
tree4166fc444e57c0132d94bb117e938540048e13f1
parent22e6b1d609c6d2dd87b5206bf21d2bf94b30f2d4

frontend: default strip=true on hex and raw object formats


2 files changed, 23 insertions(+), 21 deletions(-)

src/Compilation/Config.zig-1
......@@ -487,7 +487,6 @@ pub fn resolve(options: Options) ResolveError!Config {
487487 const root_strip = b: {
488488 if (options.root_strip) |x| break :b x;
489489 if (root_optimize_mode == .small) break :b true;
490 if (target.cpu.arch == .spork8) break :b true;
491490 if (!target_util.hasDebugInfo(target)) break :b true;
492491 break :b false;
493492 };
src/target.zig+23-20
......@@ -396,26 +396,29 @@ pub fn classifyCompilerRtLibName(name: []const u8) CompilerRtClassification {
396396}
397397
398398pub fn hasDebugInfo(target: *const std.Target) bool {
399 return switch (target.cpu.arch) {
400 // TODO: We should make newer PTX versions depend on older ones so we'd just check `ptx75`.
401 .nvptx, .nvptx64 => target.cpu.hasAny(.nvptx, &.{
402 .ptx75,
403 .ptx76,
404 .ptx77,
405 .ptx78,
406 .ptx80,
407 .ptx81,
408 .ptx82,
409 .ptx83,
410 .ptx84,
411 .ptx85,
412 .ptx86,
413 .ptx87,
414 .ptx88,
415 .ptx90,
416 }),
417 .bpfel, .bpfeb => false,
418 else => true,
399 return switch (target.ofmt) {
400 .raw, .hex => false,
401 else => switch (target.cpu.arch) {
402 // TODO: We should make newer PTX versions depend on older ones so we'd just check `ptx75`.
403 .nvptx, .nvptx64 => target.cpu.hasAny(.nvptx, &.{
404 .ptx75,
405 .ptx76,
406 .ptx77,
407 .ptx78,
408 .ptx80,
409 .ptx81,
410 .ptx82,
411 .ptx83,
412 .ptx84,
413 .ptx85,
414 .ptx86,
415 .ptx87,
416 .ptx88,
417 .ptx90,
418 }),
419 .bpfel, .bpfeb => false,
420 else => true,
421 },
419422 };
420423}
421424