Windows: always emit definitions of JITed "weak" variables

Fixes test failures (crashes) in
    projectroot.test.test_stressiterators_interpreted
    projectroot.roottest.cling.dict.roottest_cling_dict_assertTmpltDefArgCtor
    projectroot.test.test_stresshistogram_interpreted
    projectroot.roottest.root.meta.roottest_root_meta_runnamespace_auto
This commit is contained in:
Axel Naumann 2021-08-09 17:13:55 +02:00 committed by jenkins
parent 11d203f55d
commit 00bbb8e081

View File

@ -140,9 +140,14 @@ namespace {
// Find the symbol in JIT or shared libraries.
if (m_JIT.getSymbolAddress(GV.getName(), /*AlsoInProcess*/ true)) {
#if !defined(_WIN32)
// Heuristically, Windows cannot handle cross-library variables; they
// must be library-local.
if (auto *Var = dyn_cast<GlobalVariable>(&GV)) {
Var->setInitializer(nullptr); // make this a declaration
} else if (auto *Func = dyn_cast<Function>(&GV)) {
} else
#endif
if (auto *Func = dyn_cast<Function>(&GV)) {
Func->deleteBody(); // make this a declaration
} else {
llvm_unreachable("What is this?");