compiler: let LLVM set the x32 feature from the target triple on x86 targets

This commit is contained in:
Alex Rønne Petersen
2026-01-18 11:55:14 +01:00
parent 4c50c4b6e5
commit bb7a43490f
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -6808,6 +6808,7 @@ pub fn addCCArgs(
// We communicate these to Clang through the dedicated options.
if (std.mem.startsWith(u8, llvm_name, "soft-float") or
std.mem.startsWith(u8, llvm_name, "hard-float") or
(target.cpu.arch.isX86() and std.mem.startsWith(u8, llvm_name, "x32")) or
(target.cpu.arch == .s390x and std.mem.eql(u8, llvm_name, "backchain")))
continue;
+2
View File
@@ -347,6 +347,8 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
// See https://github.com/ziglang/zig/issues/23539
if (target_util.isDynamicAMDGCNFeature(target, feature)) continue;
if (target.cpu.arch.isX86() and @as(std.Target.x86.Feature, @enumFromInt(feature.index)) == .x32) continue;
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;