<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - s390x: TLS reference in /usr/lib64/libLLVM.so mismatches non-TLS reference in /usr/lib64/libLLVM.so"
   href="https://bugs.llvm.org/show_bug.cgi?id=52321">52321</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>s390x: TLS reference in /usr/lib64/libLLVM.so mismatches non-TLS reference in /usr/lib64/libLLVM.so
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: SystemZ
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>sarah.kriesch@opensuse.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>We are building applications with LLVM at openSUSE and receiving these problems
with multiple packages, as PostgreSQL and Rust:


/usr/lib64/gcc/s390x-suse-linux/11/../../../../s390x-suse-linux/bin/ld:
@GLIBCXX_3.4.11: TLS reference in /usr/lib64/libLLVM.so mismatches non-TLS
reference in /usr/lib64/libLLVM.so
 /usr/lib64/gcc/s390x-suse-linux/11/../../../../s390x-suse-linux/bin/ld:
/usr/lib64/libLLVM.so: error adding symbols: bad value
 collect2: error: ld returned 1 exit status
make[2]: *** [../../../../src/Makefile.shlib:309: llvmjit.so] Error 1


Here, the symbol for which there are TLS and non-TLS references is mentioned,
it's '@GLIBCXX_3.4.11'.  That is of course not any sensible symbol, it's an
empty symbol name with a symbol version, or the symbol version itself
interpreted as symbol name.

Our guess is that the linker plugin does something strange (aka undefined),
either caused by a problem in llvms use of it, or in ld.  It manipulates the
symbol tables and the above definitely is something strange with the symbol
table.

There are exactly two TLS references in libLLVM.so.12

    23: 0000000000000000     0 TLS     GLOBAL DEFAULT  UND
<a href="mailto:_ZSt11__once_call@GLIBCXX_3.4.11">_ZSt11__once_call@GLIBCXX_3.4.11</a> (16)
    29: 0000000000000000     0 TLS     GLOBAL DEFAULT  UND
<a href="mailto:_ZSt15__once_callable@GLIBCXX_3.4.11">_ZSt15__once_callable@GLIBCXX_3.4.11</a> (16)

so just speculating that the 'ld' error is bogus and the second reference to
'/usr/lib64/libLLVM.so' should really be to sth else, like an object from the
link command-line as built by

g++ -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-stat
ement -Wendif-labels -Wmissing-format-attribute -Wformat-security
-fno-strict-al
iasing -fwrapv -fexcess-precision=standard -Wno-format-truncation
-Wno-stringop-
truncation -O2 -g -m64 -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector 
-funwind-tables -fasynchronous-unwind-tables  -fPIC -shared -o llvmjit.so 
llvmj
it.o llvmjit_error.o llvmjit_inline.o llvmjit_wrap.o llvmjit_expr.o
llvmjit_defo
rm.o -L../../../../src/port -L../../../../src/common  -flto=auto
-ffat-lto-objec
ts -L/usr/lib64  -Wl,--as-needed  -lLLVM</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>