This is an archive of the discontinued LLVM Phabricator instance.

[libc] Do not find system binaries for offloading tools
ClosedPublic

Authored by jhuber6 on Aug 17 2023, 11:38 AM.

Details

Summary
We use `find_program` to identify a few programs we use for offloading.
Namely, `clang-offload-packger`, `amdgpu-arch`, and `nvptx-arch`.
Currently the logic allows these to bind to any tool matching this name,
so it will find it on the system. This meant that if the installation
was deleted or it found a broken binary the compilation would fail. We
should only pull these from the current LLVM binary directory.

Diff Detail

Event Timeline

jhuber6 created this revision.Aug 17 2023, 11:38 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptAug 17 2023, 11:38 AM
jhuber6 requested review of this revision.Aug 17 2023, 11:38 AM
arsenm accepted this revision.Aug 17 2023, 11:40 AM

Can this try to use the imported target instead of searching

This revision is now accepted and ready to land.Aug 17 2023, 11:40 AM

Can this try to use the imported target instead of searching

So this is part of the runtimes which is a separate cmake job so it doesn't share the targets.

Can this try to use the imported target instead of searching

So this is part of the runtimes which is a separate cmake job so it doesn't share the targets.

I'd still hope the runtimes build would use exported targets for these sorts of tools

Can this try to use the imported target instead of searching

So this is part of the runtimes which is a separate cmake job so it doesn't share the targets.

I'd still hope the runtimes build would use exported targets for these sorts of tools

I'm not very familiar with that, do we export tools in this way? I thought it was all just binaries in a directory once you leave the main CMake invocation.

This revision was automatically updated to reflect the committed changes.