aboutsummaryrefslogtreecommitdiff
path: root/src/Package/Module.zig
diff options
context:
space:
mode:
authorAlex Rønne Petersen <alex@alexrp.com>2025-10-03 03:22:02 +0200
committerAlex Rønne Petersen <alex@alexrp.com>2025-10-03 03:29:20 +0200
commit91fa2c61aacd002228c37cb651fa0a350bd7ac59 (patch)
tree75efed76fbc47b7383e2fb50137bab00f962707f /src/Package/Module.zig
parentbc4da9a90743c11c7c0b3e485f46d365d57d87b7 (diff)
downloadzig-91fa2c61aacd002228c37cb651fa0a350bd7ac59.tar.gz
zig-91fa2c61aacd002228c37cb651fa0a350bd7ac59.zip
compiler: control the s390x backchain feature through the frame pointer option
This is a little different from how C/C++ compilers do this, but I think it's justified because it's what users actually *mean* when the use frame pointer options. This is another one of those LLVM "CPU" features that have nothing to do with CPU at all and should really be a TargetMachine option or something. One day we'll figure out a better way of dealing with these...
Diffstat (limited to 'src/Package/Module.zig')
-rw-r--r--src/Package/Module.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Package/Module.zig b/src/Package/Module.zig
index 440f764b31..cd7f573046 100644
--- a/src/Package/Module.zig
+++ b/src/Package/Module.zig
@@ -343,7 +343,10 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
// See https://github.com/ziglang/zig/issues/23539
if (target_util.isDynamicAMDGCNFeature(target, feature)) continue;
- const is_enabled = target.cpu.features.isEnabled(feature.index);
+ var is_enabled = target.cpu.features.isEnabled(feature.index);
+ if (target.cpu.arch == .s390x and @as(std.Target.s390x.Feature, @enumFromInt(feature.index)) == .backchain) {
+ is_enabled = !omit_frame_pointer;
+ }
if (is_enabled) {
try buf.ensureUnusedCapacity(2 + llvm_name.len);