diff --git a/src/codegen.cpp b/src/codegen.cpp index dbb7d5aa498dc..d6b84f6ced0ad 100644 --- a/src/codegen.cpp +++ b/src/codegen.cpp @@ -9310,17 +9310,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 7eed240529e20..616ec05d4c362 100644 --- a/src/jitlayers.cpp +++ b/src/jitlayers.cpp @@ -1629,6 +1629,12 @@ JuliaOJIT::JuliaOJIT() DLSymOpt(std::make_unique(false)), 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