[all-commits] [llvm/llvm-project] 52204a: [Offload] Initial support for registering offloadi...

Joseph Huber via All-commits all-commits at lists.llvm.org
Tue Nov 21 04:48:49 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 52204a29aba2ca8a10f0bd1b5d5c3b8e0b8fa082
      https://github.com/llvm/llvm-project/commit/52204a29aba2ca8a10f0bd1b5d5c3b8e0b8fa082
  Author: Joseph Huber <huberjn at outlook.com>
  Date:   2023-11-21 (Tue, 21 Nov 2023)

  Changed paths:
    M clang/test/CodeGenCUDA/offloading-entries.cu
    M clang/test/Driver/linker-wrapper-image.c
    M clang/test/OpenMP/declare_target_link_codegen.cpp
    M llvm/lib/Frontend/Offloading/CMakeLists.txt
    M llvm/lib/Frontend/Offloading/Utility.cpp

  Log Message:
  -----------
  [Offload] Initial support for registering offloading entries on COFF targets (#72697)

Summary:
This patch provides the initial support to allow handling the new
driver's offloading entries. Normally, the ELF target can emit varibles
at C-identifier named sections and the linker will provide a pointer to
the section. For COFF target, instead the linker merges sections
containing a `$` in alphabetical order. We thus can emit these variables
at sections and then emit two variables that are guaranteed to be sorted
before and after the others to traverse it. Previous patches
consolidated the handling of offloading entries so that this patch more
easily can handle mapping them to the appropriate section.

Ideally, the only remaining step to allow the new driver to run on
Windows targets is to accurately map the following `ld.lld` arguments to
their `llvm-link` equivalents. These are used inside the linker-wrapper,
so we should simply need to remap the arguments to the same
functionality if possible.
```
-o, -output
-l, --library
-L, --library-path
-v, --version
-rpath
-whole-archive, -no-whole-archive
```

I have not tested this at runtime as I do not have access to a windows
machine.

This patch was adapted from some initial efforts in
https://reviews.llvm.org/D137470.




More information about the All-commits mailing list