[llvm-bugs] [Bug 50237] New: hidden visibility with shared objects lead to subtle bugs

via llvm-bugs llvm-bugs at lists.llvm.org
Wed May 5 22:18:41 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=50237

            Bug ID: 50237
           Summary: hidden visibility with shared objects lead to subtle
                    bugs
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: Target Description Classes
          Assignee: unassignedbugs at nondot.org
          Reporter: sguelton at redhat.com
                CC: llvm-bugs at lists.llvm.org

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210506/bac9ccdf/attachment.html>


More information about the llvm-bugs mailing list