diff options
| author | Alex Rønne Petersen <alex@alexrp.com> | 2025-08-03 16:22:52 +0200 |
|---|---|---|
| committer | Alex Rønne Petersen <alex@alexrp.com> | 2025-08-30 06:36:41 +0200 |
| commit | c44f631c72f2bf86df658476eb6449c98d490813 (patch) | |
| tree | da6196565bf47e3b62d8182c7fb4f712cf1834b0 /src/Compilation.zig | |
| parent | 8c47dda7df2ff123699856eea513a266952b91bf (diff) | |
| download | zig-c44f631c72f2bf86df658476eb6449c98d490813.tar.gz zig-c44f631c72f2bf86df658476eb6449c98d490813.zip | |
zig cc: pass -mthumb to the assembler as necessary
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 7 |
1 files 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| { |
