diff --git a/src/codegen.cpp b/src/codegen.cpp index 09fc465e93fca..384ee5caf9708 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9196,17 +9196,12 @@ extern "C" void jl_init_llvm(void) if (clopt && clopt->getNumOccurrences() == 0) cl::ProvidePositionalOption(clopt, "4", 1); -#if JL_LLVM_VERSION >= 150000 + // we want the opaque-pointers to be opt-in, per LLVMContext, for this release + // so change the default value back to pre-14.x, without changing the NumOccurrences flag for it clopt = llvmopts.lookup("opaque-pointers"); if (clopt && clopt->getNumOccurrences() == 0) { -#ifdef JL_LLVM_OPAQUE_POINTERS - cl::ProvidePositionalOption(clopt, "true", 1); -#else - cl::ProvidePositionalOption(clopt, "false", 1); -#endif + clopt->addOccurrence(1, clopt->ArgStr, "false", true); } -#endif - jl_ExecutionEngine = new JuliaOJIT(); bool jl_using_gdb_jitevents = false; diff --git a/src/jitlayers.cpp b/src/jitlayers.cpp index b5604d77d8e51..1a385403e9672 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1329,6 +1329,12 @@ JuliaOJIT::JuliaOJIT() ExternalJD(ES.createBareJITDylib("JuliaExternal")), ContextPool([](){ auto ctx = std::make_unique(); + if (!ctx->hasSetOpaquePointersValue()) +#ifndef JL_LLVM_OPAQUE_POINTERS + ctx->setOpaquePointers(false); +#else + ctx->setOpaquePointers(true); +#endif return orc::ThreadSafeContext(std::move(ctx)); }), #ifdef JL_USE_JITLINK