[LLVMbugs] [Bug 23649] New: libLLVM-3.7.so doesn't work when building with cmake on linux

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 25 08:10:29 PDT 2015


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

            Bug ID: 23649
           Summary: libLLVM-3.7.so doesn't work when building with cmake
                    on linux
           Product: Build scripts
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: cmake
          Assignee: unassignedbugs at nondot.org
          Reporter: bero at linaro.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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.

-- 
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/20150525/6e36b07c/attachment.html>


More information about the llvm-bugs mailing list