[PATCH] D113167: [lld-macho] Allow exporting weak def private-extern symbols.

Vy Nguyen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 4 13:34:51 PDT 2021


oontvoo added a comment.

In D113167#3109188 <https://reviews.llvm.org/D113167#3109188>, @thakis wrote:

> That honestly sounds like a bug in your build config, independently of if ld64 allows it, no?

I still think that LLD  shouldn't conflate the following two cases:

  // hidden.cc
  extern __attribute__((weak)) __attribute__((visibility("hidden"))) void foo()  {return 5;}
  int bar() { return foo(); }

VS

  // can_be_hidden.cc (Must be C++, not C)
  __attribute__((noinline)) inline int foo() { return 5; }
  int bar() { return foo(); }

For the `hidden.cc`, clearly we shouldn't export `foo`. (current behaviour).
But for the latter, it should be fine


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D113167



More information about the llvm-commits mailing list