Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hidden visibility with shared objects lead to subtle bugs #49581

Closed
serge-sans-paille opened this issue May 6, 2021 · 1 comment
Closed

hidden visibility with shared objects lead to subtle bugs #49581

serge-sans-paille opened this issue May 6, 2021 · 1 comment
Labels
bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate

Comments

@serge-sans-paille
Copy link
Collaborator

Bugzilla Link 50237
Resolution DUPLICATE
Resolved on May 11, 2021 21:18
Version trunk
OS Linux
Blocks #48661
CC @bd1976bris,@pogo59,@tstellar

Extended Description

We should not set CMAKE_CXX_VISIBILITY_PRESET to hidden for llvm Targets

Using this feature is error prone and interacts in subtle ways with the LLVM
codebase.

As an example, llvm::Any::TypeId::Id relies on the uniqueness of the address of a
static variable defined in a template function. hidden visibility implies vague
linkage for that variable, which does not guarantee the uniqueness of the address
across a binary and a shared library. This totally breaks the implementation of
llvm::Any.

See https://gcc.gnu.org/wiki/Visibility and https://gcc.gnu.org/onlinedocs/gcc/Vague-Linkage.html
for more information on that topic.

Proposed patch: https://reviews.llvm.org/D101972

@tstellar
Copy link
Collaborator

*** This bug has been marked as a duplicate of bug #48336 ***

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla duplicate Resolved as duplicate
Projects
None yet
Development

No branches or pull requests

2 participants