[lldb-dev] cmake question and [PATCH] for Undefined symbol "_liblldb_coreVersionString"

via lldb-dev lldb-dev at lists.llvm.org
Fri Sep 25 10:29:32 PDT 2015


Due to recent changes, rebuilding with cmake and ninja in an existing build on
OSX gets the following linker errors (note: it builds fine from scratch):

    $ ninja
    . . .
    Undefined symbols for architecture x86_64:
    "_liblldb_coreVersionString", referenced from:
        lldb_private::GetVersion() in lldb.cpp.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    . . .
    ninja: build stopped: subcommand failed.


I've tried to fix this wirth the attached patch, but it gets a warning about
multiple rules for LLDB_vers.c:

    $ ninja
    [1/1] Re-running CMake...
    . . .
    ninja: warning: multiple rules generate tools/lldb/source/LLDB_vers.c. builds involving this target will not be correct; continuing anyway
    . . .
    [13/13] Creating executable symlink bin/lldb

Does anyone know how to fix this the right way to avoid these warnings?


BTW, anyone know why I also get the following warnings?  (They are unrelated to
the linker error or the patch, but just curious):

    . . .
    [6/13] Linking CXX shared library lib/liblldb.3.8.0.dylib
    ld: warning: cannot export hidden symbol lldb::SBListener::GetSP() from tools/lldb/source/API/CMakeFiles/liblldb.dir/SBAttachInfo.cpp.o
    ld: warning: cannot export hidden symbol lldb::SBListener::GetSP() from tools/lldb/source/API/CMakeFiles/liblldb.dir/SBLaunchInfo.cpp.o
    . . .
    ld: warning: cannot export hidden symbol lldb::endian::InlHostByteOrder() from lib/liblldbExpression.a(IRForTarget.cpp.o)
    [13/13] Creating executable symlink bin/lldb

Thanks in advance,
-Dawn
-------------- next part --------------
Index: tools/lldb-server/CMakeLists.txt
===================================================================
--- tools/lldb-server/CMakeLists.txt	(revision 248581)
+++ tools/lldb-server/CMakeLists.txt	(working copy)
@@ -35,8 +35,13 @@
     lldb-server.cpp
     LLDBServerUtilities.cpp
     ../../source/lldb.cpp
+    ${LLDB_VERS_GENERATED_FILE}
     )
 
+  if (LLDB_VERS_GENERATED_FILE)
+    add_dependencies(lldb-server swig_wrapper)
+  endif()
+
   # The Darwin linker doesn't understand --start-group/--end-group.
   if (LLDB_LINKER_SUPPORTS_GROUPS)
     target_link_libraries(lldb-server


More information about the lldb-dev mailing list