Simplify handling of clang targets, fix clang build on aarch64 and riscv64#15039
Simplify handling of clang targets, fix clang build on aarch64 and riscv64#15039belegdol wants to merge 1 commit intomamedev:masterfrom
Conversation
|
AArch64 is ARM64. Why are we back to the situation where different distros call the same target different things, like x64 (Windows) vs x86_64 (most Linux, macOS) vs amd64 (some BSDs)? We’re already building with clang on AArch64 for macOS and Windows at least, so the logic works for those targets. The whole |
|
Linux didn’t have an |
|
Maybe we can at least reduce the amount of copy paste. Genie only supports three targets for GCC: native, x32 and x64. So if there are no differences between the different 32 and 64bit targets, maybe it would be possible to have different variants have fewer results: mame/3rdparty/genie/src/tools/gcc.lua Lines 67 to 77 in 019bbc7 |
104c4b6 to
ea691fa
Compare
Simplify clang handling by appending _clang suffix to the existing ARCHITECTURE value instead of attempting to recreate the logic already existing earlier in the makefile. While this eliminates the arm64_clang targets, these appear to be an exact copy of the existing x64 ones and genie only supports native, x86 and x64 configs anyway.
ea691fa to
a28bf9f
Compare
|
This is now less eyesore-inducing. I have tested on Fedora with x86_64, aarch64 and riscv64, each with gcc and clang. Compilation appears to proceed fine. Let's wait for CI to finish to see how other configs fare. |
This PR fixes building on
riscv64andaarch64using clang by ensuring-m64is getting passed instead of-m32.I am not quite happy with the amount of copy-paste needed. The issue is that gcc does not support
-m64parameter onaarch64orriscv64, meaning that theARCHITECTUREparameter needs to be set to an empty value in order to prevent genie from adding the parameter to the generated makefiles.Unfortunately, clang logic relies on
ARCHITECTUREbeing set tox64in order to pick the 64-bit config, and falls back to 32-bit target otherwise. While clang does support-m32and-m64onaarch64andriscv64, it does not help if we end up picking the wrong one.I can think of the following alternative approaches:
ARCHITECTUREto blank after the clang logic blockx86and only pick the 32-bit target if it is found, fall back to 64-bit otherwise. This might make sense given where 32-bit support is these days in general.Input is welcome.