Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

TIL. I didn't know clang supports this natively.


Clang is natively a cross-compiler. Pass in --sysroot and a corresponding valid sysroot tree for any micro architecture/platform (arm-eabi, macOS, Windows MSVC, PowerPC, Alpine Linux with musl, you name it) and Clang will happily retarget the binary to the correct target platform.


Apple has supported that ‘-arch’ option in their GCC/Clang since at least the PPC->Intel transition, maybe even earlier (PPC64? NeXT/OPENSTEP?)


Yes, since NEXTSTEP.


That would be NeXT, and their GCC fork.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: