The bug happens when you build e.g. an x64_64;arm64 JIT with LLVM_HOST_TRIPLE=x86_64-apple-macos, and then run it on an apple-m1 not under Rosetta. In that case, sys::getProcessTriple() will return an x86_64 triple, not an arm64 one.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
I'm not super familiar with the history behind LLVM_HOST_TRIPLE, but one thing that definitely worries me about this specific change is there are other consumers of that variable, but only this 1 gets this fixup. I feel like the core issue is the mismatch between having a single LLVM_HOST_TRIPLE, but having cmake build a fat binary.
Comment Actions
AFAICT, this is the only one where it really matters, aside from (plausibly) the one in ToolChain::isCrossCompiling().
Comment Actions
It feels to me like we're defeating the purpose of LLVM_HOST_TRIPLE, but I imagine any other solution to this would require a much bigger hammer, so seems worth a try.