[all-commits] [llvm/llvm-project] 1a3cfe: [LinkerWrapper] Pass all files to the device linke...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Jul 23 08:29:46 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a3cfe5b9dc9c80a375506262b54b51d929df52d
      https://github.com/llvm/llvm-project/commit/1a3cfe5b9dc9c80a375506262b54b51d929df52d
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

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

  Log Message:
  -----------
  [LinkerWrapper] Pass all files to the device linker (#97573)

Summary:
The linker wrapper's job is to extract embedded device code from fat
binaries and create linked images that can then be embedded and
executed. In order to support LTO, we originally reinvented all of the
LTO handling that `ld.lld` normally does. Primarily, this was because
`nvlink` didn't support this at all, and we have special hacks required
for offloading languages interacting with archive libraries.

Now since I wrote https://github.com/llvm/llvm-project/pull/96561 we
should be able to pass all the inputs to the device linker
transparently. This has the advantage of allowing the `clang` Driver to
do its own handling. Primarily, this will be used to implicitly pass
libraries to the device link job to make it more consistent with other
toolchains.

The JIT support is a notable departure, however there is an option
called `--lto-emit-llvm` that performs the exact function where we want
the final link job to output LLVM-IR that we can then embed instead.

This patch does not fully delete the LTO handling, primarily because I
think the SPIR-V people might want it. To see only the relevant patches,
ignore the first commit of the nvlink-wrapper.

Depends on https://github.com/llvm/llvm-project/pull/96561.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list