Skip to content

Conversation

@jchlanda
Copy link
Contributor

By using installation detectors we can move away from creating full toolchains and querying them.

Jakub Chlanda added 2 commits August 11, 2025 08:28
…49294)

This patch provides a single point for handling the logic behind
choosing common bitcode libraries. The intention is that the users of
ROCm installation detector will not have to rewrite options handling
code each time the bitcode libraries are queried. This is not too
distant from detectors for other architecture that encapsulate the
similar decision making process, providing cleaner interface. The only
flag left in `getCommonBitcodeLibs` (main point of entry) is
`NeedsASanRT`, this is deliberate, as in order to calculate it we need
to consult `ToolChain`.
…51114)

This patch moves `LazyDetector` and target specific (Cuda, Hip, SYCL)
installation detectors to clang's include directory. It was problematic
for downstream to use headers from clang's lib dir. The use of lib
headers could lead to subtle errors, as some of the symbols there are
annotated with `LLVM_LIBRARY_VISIBILITY`. For instance
[`ROCMToolChain::getCommonDeviceLibNames`](https://github.com/jchlanda/llvm-project/blob/jakub/installation_detectors/clang/lib/Driver/ToolChains/AMDGPU.h#L147)
is c++ public, but because of the annotation it ends up as ELF hidden
symbol, which causes errors when accessed from another shared library.
@jchlanda jchlanda requested review from a team as code owners August 11, 2025 09:21
@jchlanda
Copy link
Contributor Author

Please note that the first two commits are cherry-picks from upstream llvm: llvm/llvm-project#149294 and llvm/llvm-project#151114.

By using installation detectors we can move away from creating full
toolchains and querying them.
Copy link
Contributor

@sommerlukas sommerlukas left a comment

Choose a reason for hiding this comment

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

LGTM.

I focused my review on 912b04d, as the other two commits were already reviewed in upstream LLVM.

Copy link
Contributor

@mdtoguchi mdtoguchi left a comment

Choose a reason for hiding this comment

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

LGTM

@jchlanda
Copy link
Contributor Author

@intel/llvm-gatekeepers this is ready to go. Thank you.

@kbenzie kbenzie merged commit b37d0d4 into intel:sycl Aug 12, 2025
30 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants