Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add llvm_gnu_pubnames to Interface and set llvm_debug_info for native target #456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 2 additions & 1 deletion src/jlgen.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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-"
Expand Down
10 changes: 10 additions & 0 deletions src/native.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}))
Copy link
Member Author

Choose a reason for hiding this comment

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

@gbaraldi I was debating to use simply FULL or Base.default_debug_info_kind() for all Native targets,
but maybe best not to change this for StaticCompiler.jl?

Copy link
Contributor

Choose a reason for hiding this comment

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

StaticCompiler actually defines it's own target so I don't see an issue.

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