[PATCH] D95970: [HIP] Allow undefined symbols

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 3 14:31:30 PST 2021


yaxunl added a comment.

In D95970#2540303 <https://reviews.llvm.org/D95970#2540303>, @tra wrote:

> What's going to happen if you do have an undefined reference that's *not* to a `__managed__` variable?

By default HIP toolchain uses -fvisibility hidden -fapply-global-visibility-to-externs for device compilation. Undefined variable symbols have protected visibility. Undefined function symbols have hidden visibility. Since they are not allowed to be preempted, lld still emits error if they are undefined. `__managed__` variables have default visibility, therefore they are allowed to go through.

We can let HIP runtime emit an error if there are undefined symbols other than managed variables.


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

https://reviews.llvm.org/D95970



More information about the cfe-commits mailing list