From c44f631c72f2bf86df658476eb6449c98d490813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 3 Aug 2025 16:22:52 +0200 Subject: [PATCH] zig cc: pass -mthumb to the assembler as necessary --- src/Compilation.zig | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Compilation.zig b/src/Compilation.zig index ae823fcae2..5ecc9b2aec 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -6835,8 +6835,11 @@ pub fn addCCArgs( } } - if (target.cpu.arch.isArm()) { - try argv.append(if (target.cpu.arch.isThumb()) "-mthumb" else "-mno-thumb"); + if (target.cpu.arch.isThumb()) { + try argv.append(switch (ext) { + .assembly, .assembly_with_cpp => "-Wa,-mthumb", + else => "-mthumb", + }); } if (target_util.llvmMachineAbi(target)) |mabi| {