Judging by this issue posted by one of our users, there seems to be a problem with ldc currently picking best available flags on the host CPU. Arch uses -march=x86_64 for x86_64 so nothing fancy. It surely shouldn't enable AVX but apparently it does. The system I build this package on has AVX support. This might explain it. It is as though ldc uses -march=native.
This doesn't seem to be a downstream packaging problem on my side. Can you guys investigate please? The bug report I linked includes some helpful information.
Yep, we should definitely do the equivalent of -mtune=generic by default.
On it, just need a few quiet minutes to sit down and commit this.
I chose to just take the code from Clang.
Maybe this should be abstracted to into LLVM.
Do not optimize for host CPU by default.
GitHub: Fixes #323.