[Lldb-commits] [PATCH] Fix cmake build by linking LLVMSupport

Chilledheart chilledheart at fastmail.fm
Wed Feb 4 08:22:50 PST 2015


I think commit 226039 has fix this compilation error when BUILD_SHARED_LIBS=on.

We can close it now.


================
Comment at: tools/lldb-platform/CMakeLists.txt:9-14
@@ -8,3 +8,8 @@
 
+llvm_config(lldb-platform support)
+if (LLVM_COMMON_DEPENDS)
+  add_dependencies(lldb-platform ${LLVM_COMMON_DEPENDS})
+endif()
+
 target_link_libraries(lldb-platform liblldb)
 
----------------
zturner wrote:
> This looks better.  Should liblldb also be a dependency instead of just a link library?  In other words, I wonder if all this could be merged into the following:
> 
> add_dependencies(lldb-platform liblldb ${LLVM_COMMON_DEPENDS})
> 
> Otherwise it looks like no dependency is created between lldb-platform and liblldb.
target_link_libraries is sufficient to declare a dependency of liblldb (in a implicit way).

I failed when replacing
```
if (LLVM_COMMON_DEPENDS)
 add_dependencies(lldb-platform ${LLVM_COMMON_DEPENDS})
endif()

target_link_libraries(lldb-platform liblldb)
```
with the line
```
add_dependencies(lldb-platform liblldb ${LLVM_COMMON_DEPENDS})
```

errors are post below:
```
[1/1] Re-running CMake...
-- Target triple: x86_64-apple-darwin13.4.0
-- Native target architecture is X86
-- Threads enabled.
-- Doxygen disabled.
-- Sphinx enabled.
-- Go bindings enabled.
-- Building with -fPIC
-- Constructing LLVMBuild project information
-- Targeting AArch64
-- Targeting ARM
-- Targeting CppBackend
-- Targeting Hexagon
-- Targeting Mips
-- Targeting MSP430
-- Targeting NVPTX
-- Targeting PowerPC
-- Targeting R600
-- Targeting Sparc
-- Targeting SystemZ
-- Targeting X86
-- Targeting XCore
-- Clang version: 3.6.0
-- LLDB version: 3.6.0
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/chilledheart/llvm-trunk/build-lldb
[1/3] cd /Users/chilledheart/llvm-trunk/build-lldb/tools/lldb/scripts && echo -n
-n
[2/3] Linking CXX executable bin/lldb-platform-3.6.0
FAILED: : && /usr/bin/clang++  -stdlib=libc++ -march=native -fdiagnostics-format=vi -fdiagnostics-show-category=name -fcolor-diagnostics -pedantic -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Woverloaded-virtual  -stdlib=libc++ -march=native -fdiagnostics-format=vi -fdiagnostics-show-category=name -fcolor-diagnostics -pedantic -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Woverloaded-virtual -fno-omit-frame-pointer -g -O0 -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register  -fno-exceptions -fno-rtti -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++     -Wl,-dead_strip tools/lldb/tools/lldb-platform/CMakeFiles/lldb-platform.dir/lldb-platform.cpp.o  -o bin/lldb-platform-3.6.0  lib/libLLVMSupport.dylib -Wl,-rpath, at executable_path/../lib && :
Undefined symbols for architecture x86_64:
  "lldb_private::Mutex::Locker::Locker(lldb_private::Mutex&)", referenced from:
      lldb_private::StreamTee::GetStreamAtIndex(unsigned int) in lldb-platform.cpp.o
  "lldb_private::Error::Error()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Debugger::Initialize(llvm::sys::DynamicLibrary (*)(std::__1::shared_ptr<lldb_private::Debugger> const&, lldb_private::FileSpec const&, lldb_private::Error&))", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Debugger::SetOutputFileHandle(__sFILE*, bool)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Debugger::CreateInstance(void (*)(char const*, void*), void*)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Debugger::SetInputFileHandle(__sFILE*, bool)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::CommandReturnObject::CommandReturnObject()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::OptionParser::GetShortOptionString(option*)", referenced from:
      _main in lldb-platform.cpp.o
  "GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(bool)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::ConnectionFileDescriptor::ConnectionFileDescriptor()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Communication::SetConnection(lldb_private::Connection*)", referenced from:
      _main in lldb-platform.cpp.o
  "GDBRemoteCommunicationServer::HandshakeWithClient(lldb_private::Error*)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Error::~Error()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Communication::IsConnected() const", referenced from:
      _main in lldb-platform.cpp.o
  "GDBRemoteCommunicationServer::GetPacketAndSendResponse(unsigned int, lldb_private::Error&, bool&, bool&)", referenced from:
      _main in lldb-platform.cpp.o
  "GDBRemoteCommunicationServer::~GDBRemoteCommunicationServer()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Debugger::SetErrorFileHandle(__sFILE*, bool)", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::CommandReturnObject::~CommandReturnObject()", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Host::SystemLog(lldb_private::Host::SystemLogType, char const*, ...)", referenced from:
      signal_handler(int) in lldb-platform.cpp.o
  "lldb_private::Error::AsCString(char const*) const", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Error::Fail() const", referenced from:
      _main in lldb-platform.cpp.o
  "lldb_private::Mutex::Locker::~Locker()", referenced from:
      lldb_private::StreamTee::GetStreamAtIndex(unsigned int) in lldb-platform.cpp.o
  "lldb_private::StreamString::GetData() const", referenced from:
      lldb_private::CommandReturnObject::GetOutputData() in lldb-platform.cpp.o
  "lldb_private::Debugger::Terminate()", referenced from:
      _main in lldb-platform.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.
```



================
Comment at: tools/lldb-platform/CMakeLists.txt:9-14
@@ -8,3 +8,8 @@
 
+llvm_config(lldb-platform support)
+if (LLVM_COMMON_DEPENDS)
+  add_dependencies(lldb-platform ${LLVM_COMMON_DEPENDS})
+endif()
+
 target_link_libraries(lldb-platform liblldb)
 
----------------
chilledheart wrote:
> zturner wrote:
> > This looks better.  Should liblldb also be a dependency instead of just a link library?  In other words, I wonder if all this could be merged into the following:
> > 
> > add_dependencies(lldb-platform liblldb ${LLVM_COMMON_DEPENDS})
> > 
> > Otherwise it looks like no dependency is created between lldb-platform and liblldb.
> target_link_libraries is sufficient to declare a dependency of liblldb (in a implicit way).
> 
> I failed when replacing
> ```
> if (LLVM_COMMON_DEPENDS)
>  add_dependencies(lldb-platform ${LLVM_COMMON_DEPENDS})
> endif()
> 
> target_link_libraries(lldb-platform liblldb)
> ```
> with the line
> ```
> add_dependencies(lldb-platform liblldb ${LLVM_COMMON_DEPENDS})
> ```
> 
> errors are post below:
> ```
> [1/1] Re-running CMake...
> -- Target triple: x86_64-apple-darwin13.4.0
> -- Native target architecture is X86
> -- Threads enabled.
> -- Doxygen disabled.
> -- Sphinx enabled.
> -- Go bindings enabled.
> -- Building with -fPIC
> -- Constructing LLVMBuild project information
> -- Targeting AArch64
> -- Targeting ARM
> -- Targeting CppBackend
> -- Targeting Hexagon
> -- Targeting Mips
> -- Targeting MSP430
> -- Targeting NVPTX
> -- Targeting PowerPC
> -- Targeting R600
> -- Targeting Sparc
> -- Targeting SystemZ
> -- Targeting X86
> -- Targeting XCore
> -- Clang version: 3.6.0
> -- LLDB version: 3.6.0
> -- Configuring done
> -- Generating done
> -- Build files have been written to: /Users/chilledheart/llvm-trunk/build-lldb
> [1/3] cd /Users/chilledheart/llvm-trunk/build-lldb/tools/lldb/scripts && echo -n
> -n
> [2/3] Linking CXX executable bin/lldb-platform-3.6.0
> FAILED: : && /usr/bin/clang++  -stdlib=libc++ -march=native -fdiagnostics-format=vi -fdiagnostics-show-category=name -fcolor-diagnostics -pedantic -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Woverloaded-virtual  -stdlib=libc++ -march=native -fdiagnostics-format=vi -fdiagnostics-show-category=name -fcolor-diagnostics -pedantic -Wall -Wextra -Wno-long-long -Wno-unused-parameter -Woverloaded-virtual -fno-omit-frame-pointer -g -O0 -std=c++11 -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -std=c++11 -fcolor-diagnostics -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-deprecated-register  -fno-exceptions -fno-rtti -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.9 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -stdlib=libc++     -Wl,-dead_strip tools/lldb/tools/lldb-platform/CMakeFiles/lldb-platform.dir/lldb-platform.cpp.o  -o bin/lldb-platform-3.6.0  lib/libLLVMSupport.dylib -Wl,-rpath, at executable_path/../lib && :
> Undefined symbols for architecture x86_64:
>   "lldb_private::Mutex::Locker::Locker(lldb_private::Mutex&)", referenced from:
>       lldb_private::StreamTee::GetStreamAtIndex(unsigned int) in lldb-platform.cpp.o
>   "lldb_private::Error::Error()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Debugger::Initialize(llvm::sys::DynamicLibrary (*)(std::__1::shared_ptr<lldb_private::Debugger> const&, lldb_private::FileSpec const&, lldb_private::Error&))", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Debugger::SetOutputFileHandle(__sFILE*, bool)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Debugger::CreateInstance(void (*)(char const*, void*), void*)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Debugger::SetInputFileHandle(__sFILE*, bool)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::CommandReturnObject::CommandReturnObject()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::CommandInterpreter::HandleCommand(char const*, lldb_private::LazyBool, lldb_private::CommandReturnObject&, lldb_private::ExecutionContext*, bool, bool)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::OptionParser::GetShortOptionString(option*)", referenced from:
>       _main in lldb-platform.cpp.o
>   "GDBRemoteCommunicationServer::GDBRemoteCommunicationServer(bool)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::ConnectionFileDescriptor::ConnectionFileDescriptor()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Communication::SetConnection(lldb_private::Connection*)", referenced from:
>       _main in lldb-platform.cpp.o
>   "GDBRemoteCommunicationServer::HandshakeWithClient(lldb_private::Error*)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Error::~Error()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Communication::IsConnected() const", referenced from:
>       _main in lldb-platform.cpp.o
>   "GDBRemoteCommunicationServer::GetPacketAndSendResponse(unsigned int, lldb_private::Error&, bool&, bool&)", referenced from:
>       _main in lldb-platform.cpp.o
>   "GDBRemoteCommunicationServer::~GDBRemoteCommunicationServer()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Debugger::SetErrorFileHandle(__sFILE*, bool)", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::CommandReturnObject::~CommandReturnObject()", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Host::SystemLog(lldb_private::Host::SystemLogType, char const*, ...)", referenced from:
>       signal_handler(int) in lldb-platform.cpp.o
>   "lldb_private::Error::AsCString(char const*) const", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Error::Fail() const", referenced from:
>       _main in lldb-platform.cpp.o
>   "lldb_private::Mutex::Locker::~Locker()", referenced from:
>       lldb_private::StreamTee::GetStreamAtIndex(unsigned int) in lldb-platform.cpp.o
>   "lldb_private::StreamString::GetData() const", referenced from:
>       lldb_private::CommandReturnObject::GetOutputData() in lldb-platform.cpp.o
>   "lldb_private::Debugger::Terminate()", referenced from:
>       _main in lldb-platform.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.
> ```
> 
> 
ping?

http://reviews.llvm.org/D6270

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list