terralang / terra

Terra is a low-level system programming language that is embedded in and meta-programmed by the Lua programming language.
terralang.org
Other
2.71k stars 197 forks source link

Select native target triple and architecture #633

Open elliottslaughter opened 12 months ago

elliottslaughter commented 12 months ago

By default, Terra uses LLVM to auto-detect the CPU it's running on, and chooses a target triple and target CPU architecture native to that CPU. The latter is the moral equivalent of -march=native in Clang.

This creates problems for certain users who want to build on a different platform than they intend to run on. This isn't usually full-on cross-compilation. Typically it's variations on the same overall architecture (i.e., one generation of x86 to another, not x86 to ARM).

It would be nice to provide a flag or other option to specify Terra's native target triple and architecture so that the user can configure this more easily, without having to manually define a new target to pass to saveobj.