diff --git a/juliac/buildscript.jl b/juliac/buildscript.jl index bebd2076a5464..a4d41a04e60dc 100644 --- a/juliac/buildscript.jl +++ b/juliac/buildscript.jl @@ -34,6 +34,7 @@ end init_active_project() = ACTIVE_PROJECT[] = nothing set_active_project(projfile::Union{AbstractString,Nothing}) = ACTIVE_PROJECT[] = projfile disable_library_threading() = nothing + start_profile_listener() = nothing @inline function invokelatest(f::F, args...; kwargs...) where F return f(args...; kwargs...) end @@ -198,6 +199,10 @@ let mod = Base.include(Base.__toplevel__, inputfile) end #entrypoint(join, (Base.GenericIOBuffer{Memory{UInt8}}, Array{Base.SubString{String}, 1}, String)) #entrypoint(join, (Base.GenericIOBuffer{Memory{UInt8}}, Array{String, 1}, Char)) + entrypoint(Base.task_done_hook, (Task,)) + entrypoint(Base.wait, ()) + entrypoint(Base.trypoptask, (Base.StickyWorkqueue,)) + entrypoint(Base.checktaskempty, ()) if add_ccallables ccall(:jl_add_ccallable_entrypoints, Cvoid, ()) end diff --git a/src/staticdata.c b/src/staticdata.c index 989e2cca080cb..40db30b96b022 100644 --- a/src/staticdata.c +++ b/src/staticdata.c @@ -848,9 +848,15 @@ static void jl_queue_module_for_serialization(jl_serializer_state *s, jl_module_ } if (jl_options.static_call_graph) { jl_value_t *val = jl_get_binding_value(b); - if (jl_is_module(val) || !strcmp(jl_symbol_name(b->globalref->name), "__init__")) { - if (jl_options.verbose_compilation) - jl_(val); + // keep binding objects that are defined and ... + if (val && + // ... point to modules ... + (jl_is_module(val) || + // ... or point to __init__ methods ... + !strcmp(jl_symbol_name(b->globalref->name), "__init__") || + // ... or point to Base functions accessed by the runtime + (m == jl_base_module && (!strcmp(jl_symbol_name(b->globalref->name), "wait") || + !strcmp(jl_symbol_name(b->globalref->name), "task_done_hook"))))) { jl_queue_for_serialization(s, b, m); } }