<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 - LLDB build with -DLLVM_ENABLE_MODULES=On fails with undefined reference to libstdc++'s std::__enable_shared_from_this_base"
   href="https://bugs.llvm.org/show_bug.cgi?id=43819">43819</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLDB build with -DLLVM_ENABLE_MODULES=On fails with undefined reference to libstdc++'s std::__enable_shared_from_this_base
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

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

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

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>Modules
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>l.lunak@centrum.cz
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22736" name="attach_22736" title="full error message">attachment 22736</a> <a href="attachment.cgi?id=22736&action=edit" title="full error message">[details]</a></span>
full error message

Steps to reproduce:
- current LLVM checkout (9231e443445f0b8adb1a1b22d7d246c8bc337227)
$ cmake -GNinja -DLLVM_TARGETS_TO_BUILD=X86 -DLLVM_OPTIMIZED_TABLEGEN=On
-DBUILD_SHARED_LIBS=On -DCMAKE_BUILD_TYPE=RelWithDebInfo
-DLLVM_ENABLE_ASSERTIONS=On -DLLVM_ENABLE_LLD=On -DLLVM_USE_SPLIT_DWARF=On
-DLLVM_LIBDIR_SUFFIX=64 -DCMAKE_SKIP_RPATH:BOOL=OFF -DLLVM_ENABLE_MODULES=On
-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt;lldb
$ ninja lldb
The build eventually fails with errors such as
ld.lld: error: undefined symbol:
std::__enable_shared_from_this_base(std::__shared_count<(__gnu_cxx::_Lock_policy)2>
const&, std::enable_shared_from_this<lldb_private::RecognizedStackFrame>
const*)
<span class="quote">>>> referenced by shared_ptr_base.h:1382 (/usr/bin/../lib64/gcc/x86_64-suse-linux/9/../../../../include/c++/9/bits/shared_ptr_base.h:1382)
>>>               StackFrameRecognizer.cpp.o:(std::__shared_ptr<lldb_private::RecognizedStackFrame, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<ScriptedRecognizedStackFrame, void>(ScriptedRecognizedStackFrame*)) in archive lib64/liblldbTarget.a</span >

Removing -DLLVM_ENABLE_MODULES=On avoids the problem. Building with
-DLLVM_ENABLE_LIBCXX=On also avoids the problem.

The build is self-hosted (i.e. the compiler is from the same checkout). OS is
openSUSE Leap 15.1, libstdc++ is
libstdc++6-devel-gcc9-9.2.1+r275327-lp151.55.1.x86_64 .</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>