@@ -279,7 +279,7 @@ static void jl_ci_cache_lookup(const jl_cgparams_t &cgparams, jl_method_instance
279
279
// takes the running content that has collected in the shadow module and dump it to disk
280
280
// this builds the object file portion of the sysimage files for fast startup, and can
281
281
// also be used be extern consumers like GPUCompiler.jl to obtain a module containing
282
- // all reachable & inferrrable functions. The `policy` flag switches between the defaul
282
+ // all reachable & inferrrable functions. The `policy` flag switches between the default
283
283
// mode `0` and the extern mode `1`.
284
284
extern " C" JL_DLLEXPORT
285
285
void *jl_create_native (jl_array_t *methods, const jl_cgparams_t cgparams, int _policy)
@@ -404,16 +404,18 @@ void *jl_create_native(jl_array_t *methods, const jl_cgparams_t cgparams, int _p
404
404
405
405
// move everything inside, now that we've merged everything
406
406
// (before adding the exported headers)
407
- for (GlobalObject &G : clone->global_objects ()) {
408
- if (!G.isDeclaration ()) {
409
- G.setLinkage (Function::InternalLinkage);
410
- makeSafeName (G);
411
- addComdat (&G);
407
+ if (policy != CompilationPolicy::Extern) {
408
+ for (GlobalObject &G : clone->global_objects ()) {
409
+ if (!G.isDeclaration ()) {
410
+ G.setLinkage (Function::InternalLinkage);
411
+ makeSafeName (G);
412
+ addComdat (&G);
412
413
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
413
- // Add unwind exception personalities to functions to handle async exceptions
414
- if (Function *F = dyn_cast<Function>(&G))
415
- F->setPersonalityFn (juliapersonality_func);
414
+ // Add unwind exception personalities to functions to handle async exceptions
415
+ if (Function *F = dyn_cast<Function>(&G))
416
+ F->setPersonalityFn (juliapersonality_func);
416
417
#endif
418
+ }
417
419
}
418
420
}
419
421
0 commit comments