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