From ade570f0d5cda6c2c515283506ffab85263c0a97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Mon, 25 Aug 2025 02:44:57 +0200 Subject: [PATCH] zig cc: don't pass -mcmodel for assembly files It does nothing but generate a warning for these. --- src/Compilation.zig | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index 0243e74d00..beae1a80da 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -6838,10 +6838,6 @@ pub fn addCCArgs( try argv.append("-municode"); } - if (mod.code_model != .default) { - try argv.append(try std.fmt.allocPrint(arena, "-mcmodel={s}", .{@tagName(mod.code_model)})); - } - try argv.ensureUnusedCapacity(2); switch (comp.config.debug_format) { .strip => {}, @@ -7136,6 +7132,10 @@ pub fn addCCArgs( .ll, .bc, => { + if (mod.code_model != .default) { + try argv.append(try std.fmt.allocPrint(arena, "-mcmodel={s}", .{@tagName(mod.code_model)})); + } + if (target_util.clangSupportsTargetCpuArg(target)) { if (target.cpu.model.llvm_name) |llvm_name| { try argv.appendSlice(&[_][]const u8{