<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - cmake fails to build LLD with shared libraries enabled"
href="https://llvm.org/bugs/show_bug.cgi?id=25064">25064</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>cmake fails to build LLD with shared libraries enabled
</td>
</tr>
<tr>
<th>Product</th>
<td>lld
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>Vasileios.Kalintiris@imgtec.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I used the following command from ToT of every repository:
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER="gcc"
-DCMAKE_CXX_COMPILER="g++" -DLLVM_USE_SPLIT_DWARF=On -DBUILD_SHARED_LIBS=On
-DCMAKE_EXPORT_COMPILE_COMMANDS=On /home/vk/repos/llvm
It fails with the following output:
FAILED: : && /usr/local/bin/g++ -fPIC -fPIC -fvisibility-inlines-hidden -Wall
-W -Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wno-missing-field-initializers -pedantic -Wno-long-long
-Wno-maybe-uninitialized -Wnon-virtual-dtor -Wno-comment -std=c++11 -g
-Wl,-z,defs -shared -Wl,-soname,liblldReaderWriter.so.3.8 -o
lib/liblldReaderWriter.so.3.8.0svn
tools/lld/lib/ReaderWriter/CMakeFiles/lldReaderWriter.dir/CoreLinkingContext.cpp.o
tools/lld/lib/ReaderWriter/CMakeFiles/lldReaderWriter.dir/FileArchive.cpp.o
tools/lld/lib/ReaderWriter/CMakeFiles/lldReaderWriter.dir/LinkerScript.cpp.o
lib/liblldCore.so.3.8.0svn lib/liblldYAML.so.3.8.0svn
lib/libLLVMObject.so.3.8.0svn lib/libLLVMSupport.so.3.8.0svn
-Wl,-rpath,"\$ORIGIN/../lib" && :
tools/lld/lib/ReaderWriter/CMakeFiles/lldReaderWriter.dir/FileArchive.cpp.o: In
function
`_ZNSt6threadC1IZZN3lld8internal18ThreadPoolExecutorC4EjENKUlvE_clEvEUlvE_JEEEOT_DpOT0_':
/usr/include/c++/5/thread:137: undefined reference to `pthread_create'
tools/lld/lib/ReaderWriter/CMakeFiles/lldReaderWriter.dir/FileArchive.cpp.o: In
function
`_ZNSt6threadC1IZN3lld8internal18ThreadPoolExecutorC4EjEUlvE_JEEEOT_DpOT0_':
/usr/include/c++/5/thread:137: undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
Without -DBUILD_SHARED_LIBS it builds fine. Also, it shouldn't affect anything
but in my tools directory there are symlinks to clang and lldb.</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>