Remix.run Logo
kccqzy 5 days ago

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

delta_p_delta_x 4 days ago | parent | next [-]

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.

mrpippy 4 days ago | parent | prev [-]

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

lukeh 4 days ago | parent [-]

Yes, since NEXTSTEP.

pjmlp 4 days ago | parent [-]

That would be NeXT, and their GCC fork.