Provide anchor for compiler extensions

This patch is cherry-picked from 04b0a4e22e3b4549f9d241f8a9f37eebecb62a31, and
amended to prevent an undefined reference to `llvm::EnableABIBreakingChecks'
This commit is contained in:
Serge Guelton 2020-06-25 05:57:01 -04:00 committed by serge-sans-paille
parent 2168dbf4cc
commit 38778e1087
2 changed files with 16 additions and 1 deletions

View File

@ -0,0 +1,15 @@
#include "llvm/Passes/PassPlugin.h"
#define HANDLE_EXTENSION(Ext) \
llvm::PassPluginLibraryInfo get##Ext##PluginInfo();
#include "llvm/Support/Extension.def"
namespace llvm {
namespace details {
void extensions_anchor() {
#define HANDLE_EXTENSION(Ext) \
static auto Ext = get##Ext##PluginInfo();
#include "llvm/Support/Extension.def"
}
}
}

View File

@ -18,4 +18,4 @@
type = Library
name = Extensions
parent = Libraries
required_libraries =
required_libraries = Support