From c4eea1401e8aa3e0d0dd055cdfd0689b1e05c9e1 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Fri, 19 Apr 2024 13:24:35 -0400 Subject: [PATCH 1/2] Don't install handle_error during precompilation --- src/core/context.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/context.jl b/src/core/context.jl index e4c63c31..0028f2f5 100644 --- a/src/core/context.jl +++ b/src/core/context.jl @@ -169,6 +169,7 @@ function handle_error(reason::Cstring) end function _install_handlers() + Base.generating_output() && return handler = @cfunction(handle_error, Cvoid, (Cstring,)) API.LLVMInstallFatalErrorHandler(handler) end From d6a40841216545af8dab19938fc5a4b1cfcf0cff Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Tue, 7 May 2024 12:34:00 +0200 Subject: [PATCH 2/2] Fix. --- src/core/context.jl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/core/context.jl b/src/core/context.jl index 0028f2f5..38d3eb67 100644 --- a/src/core/context.jl +++ b/src/core/context.jl @@ -169,7 +169,13 @@ function handle_error(reason::Cstring) end function _install_handlers() - Base.generating_output() && return + precompiling = @static if VERSION >= v"1.11" + Base.generating_output() + else + ccall(:jl_generating_output, Cint, ()) != 0 && Base.JLOptions().incremental == 0 + end + precompiling && return + handler = @cfunction(handle_error, Cvoid, (Cstring,)) API.LLVMInstallFatalErrorHandler(handler) end