<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 --- - libLLVM-3.7.so doesn't work when building with cmake on linux" href="https://urldefense.proofpoint.com/v2/url?u=https-3A__llvm.org_bugs_show-5Fbug.cgi-3Fid-3D23649&d=AwMBaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=pF93YEPyB-J_PERP4DUZOJDzFVX5ZQ57vQk33wu0vio&m=qo6dtmDpRR_Z5h0csfk3p06b01XPRmAW6A-la5_AtWM&s=YCMKeKYjXv5oZGYuSlbkhVsk1HAPBnSiP4Av5pjH9Gs&e=">23649</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libLLVM-3.7.so doesn't work when building with cmake on linux
</td>
</tr>
<tr>
<th>Product</th>
<td>Build scripts
</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>cmake
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>bero@linaro.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Trying to build LLVM+clang on Linux with cmake fails to generate a working
libLLVM-3.7.so (an autoconf build works).
The build generates libLLVM.so.3.7, but the file is much smaller than with the
autoconf build (8 kB vs. 2.8 MB), and llvm-c-test fails to link:
FAILED: : && /usr/bin/clang -Oz -Wa,--compress-debug-sections -gdwarf-4
-Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2
-fstack-protector --param=ssp-buffer-size=4 -fPIC -g0 -fPIC -Wall -W
-Wno-unused-parameter -Wwrite-strings -Wmissing-field-initializers -pedantic
-Wno-long-long -Wcovered-switch-default -Wno-comment -fcolor-diagnostics
-ffunction-sections -fdata-sections -std=gnu99 -Wstrict-prototypes -O3 -DNDEBUG
-Wl,-allow-shlib-undefined -Wl,-O3 -Wl,--gc-sections
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/calc.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/disassemble.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/helpers.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/include-all.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/main.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/module.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/metadata.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/object.c.o
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/targets.c.o -o bin/llvm-c-test
-rdynamic lib64/libLLVM.so.3.7.0svn && :
clang: warning: argument unused during compilation:
'-Wa,--compress-debug-sections'
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/calc.c.o:/home/bero/abf/llvm/BUILD/llvm-3.7.0.src/tools/llvm-c-test/calc.c:function
handle_line: error: undefined reference to 'LLVMModuleCreateWithName'
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/calc.c.o:/home/bero/abf/llvm/BUILD/llvm-3.7.0.src/tools/llvm-c-test/calc.c:function
handle_line: error: undefined reference to 'LLVMInt64Type'
tools/llvm-c-test/CMakeFiles/llvm-c-test.dir/calc.c.o:/home/bero/abf/llvm/BUILD/llvm-3.7.0.src/tools/llvm-c-test/calc.c:function
handle_line: error: undefined reference to 'LLVMPointerType'
[... way more undefined references ...]
The rest of the build is ok, without -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON, I get a
working clang compiler.</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>