[LLVMbugs] [Bug 3051] New: cmake fails to build llvm and clang in shared library mode (-DBUILD_SHARED_LIBS=ON)

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Wed Nov 12 06:17:08 PST 2008


http://llvm.org/bugs/show_bug.cgi?id=3051

           Summary: cmake fails to build llvm and clang in shared library
                    mode (-DBUILD_SHARED_LIBS=ON)
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: ljanyst at cern.ch
                CC: llvmbugs at cs.uiuc.edu


Hi,

   I'm trying to build LLVM and CLANG (the trunk of today in both cases) using
CMake on Linux in the shared library mode (with -DBUILD_SHARED_LIBS=ON
specified in a commandline). The build fails with undefined references to
dlopen and friends:

../../lib/libLLVMSystem.so: undefined reference to `dlerror'
../../lib/libLLVMSystem.so: undefined reference to `dlclose'
../../lib/libLLVMSystem.so: undefined reference to `dlopen'
../../lib/libLLVMSystem.so: undefined reference to `dlsym'

When the problem is brutally resolved by adding the following to the
add_llvm_library macro:

target_link_libraries( ${name} -ldl )

Then a new issue appears:

-- Target triple:
llvm-config: unknown component name: bitreader
CMake Error at cmake/modules/LLVMConfig.cmake:88 (message):
  llvm-config failed for executable opt
Call Stack (most recent call first):
  cmake/modules/LLVMConfig.cmake:5 (nix_llvm_config)
  cmake/modules/AddLLVM.cmake:25 (llvm_config)
  cmake/modules/AddLLVM.cmake:42 (add_llvm_executable)
  tools/opt/CMakeLists.txt:4 (add_llvm_tool)

The build process seems to complete just fine in the static library mode.

Can somebody please take a look?

Cheers,
   Lukasz


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list