From c39b5340afc305794c906382e4a1a34a331de720 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 22 May 2023 09:30:06 -0400 Subject: [PATCH] Add llvm_gnu_pubnames to Interface and set llvm_debug_info for native target --- src/interface.jl | 2 ++ src/jlgen.jl | 3 ++- src/native.jl | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/interface.jl b/src/interface.jl index 718c7de3..6a36759e 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -258,6 +258,8 @@ function llvm_debug_info(@nospecialize(job::CompilerJob)) end end +# Whether to emit gnu_pubnames +llvm_gnu_pubnames(@nospecialize(job::CompilerJob)) = false ## extension points at important stages of compilation diff --git a/src/jlgen.jl b/src/jlgen.jl index dc45ed6e..9360d798 100644 --- a/src/jlgen.jl +++ b/src/jlgen.jl @@ -561,11 +561,12 @@ function compile_method_instance(@nospecialize(job::CompilerJob); ctx::JuliaCont # set-up the compiler interface debug_info_kind = llvm_debug_info(job) + gnu_pubnames = llvm_gnu_pubnames(job) cgparams = (; track_allocations = false, code_coverage = false, prefer_specsig = true, - gnu_pubnames = false, + gnu_pubnames = Bool(gnu_pubnames), debug_info_kind = Cint(debug_info_kind), lookup = Base.unsafe_convert(Ptr{Nothing}, lookup_cb)) @static if v"1.9.0-DEV.1660" <= VERSION < v"1.9.0-beta1" || VERSION >= v"1.10-" diff --git a/src/native.jl b/src/native.jl index c9f24fac..e629622b 100644 --- a/src/native.jl +++ b/src/native.jl @@ -37,3 +37,13 @@ end runtime_slug(job::CompilerJob{NativeCompilerTarget}) = "native_$(job.config.target.cpu)-$(hash(job.config.target.features))$(job.config.target.jlruntime ? "-jlrt" : "")" uses_julia_runtime(job::CompilerJob{NativeCompilerTarget}) = job.config.target.jlruntime + +function llvm_debug_info(@nospecialize(job::CompilerJob{NativeCompilerTarget})) + if uses_julia_runtime(job) + Base.default_debug_info_kind() + else + invoke(llvm_debug_info, Tuple{CompilerJob}, job) + end +end + +llvm_gnu_pubnames(@nospecialize(job::CompilerJob{NativeCompilerTarget})) = true