[cfe-dev] Building Clang with shared libraries

David Blaikie via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 7 13:25:44 PDT 2015


So I decided to try to improve my iterative dev time (instigated by playing
around with LLD) & while LLVM passes all its test with cmake
BUILD_SHARED_LIBS=ON, clang does not. I hit the following error.

Has anyone seen this/worked around it/know what it's about?

/usr/local/google/home/blaikie/install/bin/clang++
-fcolor-diagnostics -Wdeprecated -fPIC -fvisibility-inlines-hidden
-Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual
-Wmissing-field-initializers -pedantic -Wno-long-long
-Wcovered-switch-default -Wnon-virtual-dtor -Werror -std=c++11
-fcolor-diagnostics -fno-common -Woverloaded-virtual
-Wno-nested-anon-types -g  -Wl,-allow-shlib-undefined
tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o
tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/MultilibTest.cpp.o
 -o tools/clang/unittests/Driver/ClangDriverTests
lib/libgtest.so.3.8.0svn lib/libgtest_main.so.3.8.0svn
lib/libLLVMSupport.so.3.8.0svn lib/libclangDriver.so.3.8.0svn
-Wl,-rpath,"\$ORIGIN/../lib" && :
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:31:
error: undefined reference to 'clang::DiagnosticIDs::DiagnosticIDs()'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:33:
error: undefined reference to
'clang::DiagnosticsEngine::DiagnosticsEngine(llvm::IntrusiveRefCntPtr<clang::DiagnosticIDs>
const&, clang::DiagnosticOptions*, clang::DiagnosticConsumer*, bool)'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:35:
error: undefined reference to
'clang::vfs::InMemoryFileSystem::InMemoryFileSystem()'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:58:
error: undefined reference to
'clang::vfs::InMemoryFileSystem::addFile(llvm::Twine const&, long,
std::unique_ptr<llvm::MemoryBuffer,
std::default_delete<llvm::MemoryBuffer> >)'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:72:
error: undefined reference to
'clang::DiagnosticsEngine::~DiagnosticsEngine()'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:32:
error: undefined reference to
'clang::DiagnosticConsumer::~DiagnosticConsumer()'
/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/include/clang/Basic/Diagnostic.h:1313:
error: undefined reference to 'vtable for clang::DiagnosticConsumer'
/usr/local/google/home/blaikie/install/bin/ld: the vtable symbol may
be undefined because the class is missing its key function
/usr/local/google/home/blaikie/dev/llvm/src/include/llvm/ADT/IntrusiveRefCntPtr.h:54:
error: undefined reference to 'clang::DiagnosticIDs::~DiagnosticIDs()'
tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o:/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:vtable
for (anonymous namespace)::ToolChainTest_VFSGCCInstallation_Test::TestBody()::TestDiagnosticConsumer:
error: undefined reference to
'clang::DiagnosticConsumer::IncludeInDiagnosticCounts() const'
tools/clang/unittests/Driver/CMakeFiles/ClangDriverTests.dir/ToolChainTest.cpp.o:/usr/local/google/home/blaikie/dev/llvm/src/tools/clang/unittests/Driver/ToolChainTest.cpp:vtable
for (anonymous namespace)::ToolChainTest_VFSGCCInstallation_Test::TestBody()::TestDiagnosticConsumer:
error: undefined reference to
'clang::DiagnosticConsumer::HandleDiagnostic(clang::DiagnosticsEngine::Level,
clang::Diagnostic const&)'
clang-3.4: error: linker command failed with exit code 1 (use -v to
see invocation)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151007/13b44b2f/attachment.html>


More information about the cfe-dev mailing list