Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions src/aotcompile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ static void jl_ci_cache_lookup(const jl_cgparams_t &cgparams, jl_method_instance
// takes the running content that has collected in the shadow module and dump it to disk
// this builds the object file portion of the sysimage files for fast startup, and can
// also be used be extern consumers like GPUCompiler.jl to obtain a module containing
// all reachable & inferrrable functions. The `policy` flag switches between the defaul
// all reachable & inferrrable functions. The `policy` flag switches between the default
// mode `0` and the extern mode `1`.
extern "C" JL_DLLEXPORT
void *jl_create_native(jl_array_t *methods, const jl_cgparams_t cgparams, int _policy)
Expand Down Expand Up @@ -404,16 +404,18 @@ void *jl_create_native(jl_array_t *methods, const jl_cgparams_t cgparams, int _p

// move everything inside, now that we've merged everything
// (before adding the exported headers)
for (GlobalObject &G : clone->global_objects()) {
if (!G.isDeclaration()) {
G.setLinkage(Function::InternalLinkage);
makeSafeName(G);
addComdat(&G);
if (policy == CompilationPolicy::Default) {
for (GlobalObject &G : clone->global_objects()) {
if (!G.isDeclaration()) {
G.setLinkage(Function::InternalLinkage);
makeSafeName(G);
addComdat(&G);
#if defined(_OS_WINDOWS_) && defined(_CPU_X86_64_)
// Add unwind exception personalities to functions to handle async exceptions
if (Function *F = dyn_cast<Function>(&G))
F->setPersonalityFn(juliapersonality_func);
// Add unwind exception personalities to functions to handle async exceptions
if (Function *F = dyn_cast<Function>(&G))
F->setPersonalityFn(juliapersonality_func);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Means backends will have to initialize the personality functions themselves, but I suspect that's okay.

#endif
}
}
}

Expand Down