[all-commits] [llvm/llvm-project] 0f8b52: [LinkerWrapper] Do not link device code under a re...

Joseph Huber via All-commits all-commits at lists.llvm.org
Wed Jan 24 11:50:32 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0f8b52955c219e42e87162fd8c99c3cea6e35d21
      https://github.com/llvm/llvm-project/commit/0f8b52955c219e42e87162fd8c99c3cea6e35d21
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-01-24 (Wed, 24 Jan 2024)

  Changed paths:
    M clang/test/Driver/linker-wrapper.c
    M clang/tools/clang-linker-wrapper/ClangLinkerWrapper.cpp
    M clang/tools/clang-linker-wrapper/LinkerWrapperOpts.td

  Log Message:
  -----------
  [LinkerWrapper] Do not link device code under a relocatable link (#79314)

Summary:
A relocatable link through `clang -r` can go through the
clang-linker-wrapper if offloading is enabled. This will have the effect
of linking the device code and creating the wrapper module. It will then
be merged into the final file. This is useful behavior on its own, but
is likely not what is expected for a `-r` job.

This patch makes the linker wrapper ignore the device code when doing a
reloctable link. This has the effect of the linker merging the
`.llvm.offloading` sections in the output object. These will then be
parsed as normal when the executable is finally created.

Even though this doesn't actually perform a reloctable link on the
device code itself, it has a similar effect of combining multiple files
into a single one.




More information about the All-commits mailing list