[clang] [llvm] [Offload] Fix the offloading wrapper when merged multiple times. (PR #79231)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 11:31:42 PST 2024


jhuber6 wrote:

> Do we need two different linkages or could the COFF setting be used in both? Can we have a test to show the merging works as expected?

Doing a merge intentionally will be difficult until I add another flag to do this on purpose as an extra feature. This patch just changes it to symbols that will have compatible linkage which I figured it pretty trivial.

For COFF, it's slightly different. COFF sorts things based off of the section name, so the `begin` and `end` symbols are actual symbols we define. For this reason they're `weak_odr` so they merge. ODR isn't strictly necessary but it implies intent that these are all the same. The ELF version is an external symbol defined by the linker.

https://github.com/llvm/llvm-project/pull/79231


More information about the llvm-commits mailing list