mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Fix LLVM target initialization to deal with sociopathic outside projects
that like to randomly define things like "X86", regenerate autoconf bits and update cmake. Fixes PR7852. Patch by Xerxes Rånby! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112499 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -64,15 +64,10 @@ static inline void LLVMInitializeAllTargets(void) {
|
||||
for JIT applications to ensure that the target gets linked in correctly. */
|
||||
static inline LLVMBool LLVMInitializeNativeTarget(void) {
|
||||
/* If we have a native target, initialize it to ensure it is linked in. */
|
||||
#ifdef LLVM_NATIVE_ARCH
|
||||
#define DoInit2(TARG) \
|
||||
LLVMInitialize ## TARG ## Info (); \
|
||||
LLVMInitialize ## TARG ()
|
||||
#define DoInit(T) DoInit2(T)
|
||||
DoInit(LLVM_NATIVE_ARCH);
|
||||
#ifdef LLVM_NATIVE_TARGET
|
||||
LLVM_NATIVE_TARGETINFO();
|
||||
LLVM_NATIVE_TARGET();
|
||||
return 0;
|
||||
#undef DoInit
|
||||
#undef DoInit2
|
||||
#else
|
||||
return 1;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user