mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Adjust JIT target triple on OS X to match the current architecture.
For OS X builds, we generate one version of config.h but then build for multiple architectures. This means that the LLVM_HOSTTRIPLE setting may have the wrong architecture. Adjust it dynamically to match the current architecture. <rdar://problem/12715470> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169405 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
73714eac00
commit
e1fd317a4c
@ -32,8 +32,18 @@ TargetMachine *EngineBuilder::selectTarget() {
|
||||
// must use the host architecture.
|
||||
if (UseMCJIT && WhichEngine != EngineKind::Interpreter && M)
|
||||
TT.setTriple(M->getTargetTriple());
|
||||
else
|
||||
else {
|
||||
TT.setTriple(LLVM_HOSTTRIPLE);
|
||||
#if defined(__APPLE__)
|
||||
#if defined(__LP64__)
|
||||
if (TT.isArch32Bit())
|
||||
TT = TT.get64BitArchVariant();
|
||||
#else
|
||||
if (TT.isArch64Bit())
|
||||
TT = TT.get32BitArchVariant();
|
||||
#endif
|
||||
#endif // APPLE
|
||||
}
|
||||
return selectTarget(TT, MArch, MCPU, MAttrs);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user