Explicitly selected MIPS ABI using the -mabi option implies corresponding target triple. For 'O32' ABI it's a 32-bit target triple like mips-linux-gnu. For 'N32' and 'N64' ABIs it's a 64-bit target triple like mips64-linux-gnu. This patch adjusts target triple accordingly these rules like we do for pseudo-target flags '-m64', '-m32' etc already.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Should --target=mipsZZZ -mabi=n64 be meaningful? What does clang --target=i686-linux-gnu -m64 do? If this matches that, then let's do it.
I think each listed reviewer is currently at CppCon, hence the delay.
Comment Actions
Thanks. Initially I thought that providing different target triple and -mabi option explicitly is an error. But now I see that it's better and consistent with other targets to adjust a target triple accordingly to -mabi options in any (implicit/explicit) case. I will update the patch soon.
Comment Actions
Always adjust target triple (explicitly and implicitly provided) accordingly to ABI name.
lib/Driver/Driver.cpp | ||
---|---|---|
492 ↗ | (On Diff #167091) | We should emit a diagnostic for invalid -mabi=values. |
lib/Driver/Driver.cpp | ||
---|---|---|
492 ↗ | (On Diff #167091) | We already do that: $ clang -target mips-linux-gnu -c test.c -mabi=xxx error: unknown target ABI 'xxx' |
getLastArg claims the option for non-mips architecture and makes other architectures silently accept unknown -mabi=. This was fixed by D134671.