AMDGPU uses ELF shared libraries to implement their executable device
images. One downside to this method is that it disables regular warnings
on undefined symbols. This is because shared libraries expect these to
be resolves by later loads. However, the GPU images do not support
dynamic linking so any undefined symbol is going to cause a runtime
error. This patch adds --no-undefined to the ld.lld invocation to guarantee
that undefined symbols are always caught as linking errors rather than
runtime errors.
Details
Details
- Reviewers
jdoerfert JonChesterfield arsenm yaxunl MaskRay - Group Reviewers
Restricted Project - Commits
- rG55f38495e38e: [Clang] Always use --no-undefined when linking AMDGPU images
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Adding the amdgpu reviewer group. This change might be contentious - we currently treat various broken code as calls to trap on the grounds that those functions might not be executed. By analogy, functions that call undefined functions but are not themselves called might be considered not a problem.
Comment Actions
This can be turned off with -zundefs. So we could instruct people to use -Wl,-zundefs or -Xoffload-linker -zundefs if the old behavior is desired.
Comment Actions
While --no-undefined is an alias for -z defs, be consistent in the subject and the body.
Always use -zdefs
--no-undefined