[PATCH] D89994: [libomptarget][nvptx] Undef, internal shared variables

Jon Chesterfield via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 22 17:06:39 PDT 2020


JonChesterfield added a comment.

In D89994#2348656 <https://reviews.llvm.org/D89994#2348656>, @ABataev wrote:

> In D89994#2348655 <https://reviews.llvm.org/D89994#2348655>, @JonChesterfield wrote:
>
>> The nvptx back end accepts common + zero + shared, but not common + undef + shared. I think weak_odr is conceptually right here, but given the warning that nvlink doesn't support weak symbols, internal also seems fine. Can someone see an advantage to weak over internal? It could be arch specific at the risk of a lot of test duplication.
>
> IIRC, it supports weak symbols, but does not support weak symbols of different sizes.

That seems a reasonable restriction. Linkers sometimes pick the first weak symbol they see. Comdat might mean pick the biggest one, but that's probably not a good thing to rely on.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89994/new/

https://reviews.llvm.org/D89994



More information about the cfe-commits mailing list