▲ | geraldcombs 5 days ago | |||||||||||||||||||||||||||||||
For plain C/C++ you can just pass `-arch x86_64 -arch arm64` to clang. CMake takes care of this for you if you specify `CMAKE_OSX_ARCHITECTURES=x86_64;arm64` and IIRC Meson has similar functionality. | ||||||||||||||||||||||||||||||||
▲ | kccqzy 5 days ago | parent | next [-] | |||||||||||||||||||||||||||||||
TIL. I didn't know clang supports this natively. | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | zdw 5 days ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||
I assume this is faster than doing two separate builds, because it can skip certain steps of the complier pipeline, and only the items that are arch specific (codegen, probably others) are done twice? | ||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||
▲ | bee_rider 4 days ago | parent | prev [-] | |||||||||||||||||||||||||||||||
How much work does clang have to do for this sort of thing (as opposed to llvm). Hypothetically could we start distributing programs in llvm ir, and compile that locally to ARM, x86, risc-v, or whatever else? I mean, no, that’s silly, right? But it would be kind of neat… | ||||||||||||||||||||||||||||||||
|