llvm/tools
Andrew Wilkins 10add60748 Enable linking tools, shared libraries against libLLVM
Summary:
Three closely related changes, to have a mode in which we link all
executables and shared libraries against libLLVM. 

1. Add a new LLVM_LINK_LLVM_DYLIB cmake option, which, when ON, will link
   executables and shared libraries against libLLVM. For this to work, it
   is necessary to also set LLVM_BUILD_LLVM_DYLIB and LLVM_DYLIB_EXPORT_ALL.

   It is not strictly necessary to set LLVM_DISABLE_LLVM_DYLIB_ATEXIT, but
   we also default to OFF in this mode, or tools tend to misbehave (e.g.
   stdout may not flush on exit when output is buffered.)

   llvm-config and Tablegen do not use libLLVM, as they are dependencies of
   libLLVM.

2. Modify llvm-go to take a new flag, "linkmode=component-libs|dylib".
   Depending on which one is passed (default is component-libs), we link
   with the individual libraries or libLLVM respectively. We pass in dylib
   when LLVM_LINK_LLVM_DYLIB is ON.

3. Fix LLVM_DYLIB_EXPORT_ALL on Linux, and expand the symbols exported to
   actually export all. Don't strip leading underscore from symbols on Linux,
   and make sure we get all exported symbols and weak-with-default symbols
   ("W" in nm output). Without these changes, passes won't load because
   the "Annotate..." symbols defined in lib/Support/Valigrind.cpp are not
   found.

Testing:
 - Ran default build ("ninja") with LLVM, clang, compiler-rt, llgo, lldb.
 - Ran "check", "check-clang", "check-tsan", "check-libgo" targets. I've
   never had much success with LLDB tests, and llgoi is currently broken
   so check-llgo fails for an unrelated reason.
 - Ran "lldb" to ensure it loads.

Reviewers: chandlerc, beanz, pcc, rnk

Subscribers: rnk, chapuni, sylvestre.ledru, llvm-commits

Differential Revision: http://reviews.llvm.org/D12488

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246527 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-01 03:14:31 +00:00
..
bugpoint Replace some calls to isa<LandingPadInst> with isEHPad() 2015-08-19 19:54:02 +00:00
bugpoint-passes
dsymutil [dsymutil] Do not mistakenly reuse the current object file when the next one isn't found. 2015-08-31 05:16:35 +00:00
gold Replace &vector[0] with vector.data() to avoid invalid dereference caught by debug STL. Also move a '*' for consistency and fix an 80-col violation. 2015-08-05 21:16:02 +00:00
llc Remove access to the DataLayout in the TargetMachine 2015-07-24 16:04:22 +00:00
lli Fix lli with OrcLazyJIT: the default DataLayout was used. 2015-07-30 17:29:33 +00:00
llvm-ar For new archive member we only need to store the full path. 2015-07-15 22:46:53 +00:00
llvm-as Fix input validation issues in llvm-as/llvm-dis 2015-05-11 21:20:20 +00:00
llvm-as-fuzzer Build a lib/Fuzzer version for llvm-as. 2015-08-31 17:55:32 +00:00
llvm-bcanalyzer New EH representation for MSVC compatibility 2015-07-31 17:58:14 +00:00
llvm-c-test
llvm-config [CMake] Fix PR14200, llvm-config output misses -fno-rtti 2015-08-14 16:20:31 +00:00
llvm-cov [Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch() 2015-06-22 21:33:24 +00:00
llvm-cxxdump [llvm-cxxdump] Correctly process relocations when given multiple files 2015-08-13 18:31:43 +00:00
llvm-diff -Wdeprecated clean by making LogBuilder move constructible so it can be returned by value (in DifferenceEngine::logf) 2015-08-05 21:06:50 +00:00
llvm-dis Use std::unique_ptr to manage the DataStreamer in bitcode parsing. 2015-06-16 23:29:49 +00:00
llvm-dwarfdump [dwarfdump] Add support for dumping mach-o universal objectfiles 2015-08-03 00:10:31 +00:00
llvm-extract
llvm-go Enable linking tools, shared libraries against libLLVM 2015-09-01 03:14:31 +00:00
llvm-jitlistener Fix the -DBUILD_SHARED_LIBS=ON build. 2015-07-07 17:48:00 +00:00
llvm-link
llvm-lto CodeGen: Introduce splitCodeGen and teach LTOCodeGenerator to use it. 2015-08-27 23:37:36 +00:00
llvm-mc Use named temporaries for directional labels. 2015-06-17 16:26:47 +00:00
llvm-mcmarkup
llvm-nm Convert getSymbolSection to return an ErrorOr. 2015-08-07 23:27:14 +00:00
llvm-objdump [llvm-objdump] Use the new MinVersion API introduced in r245938. NFC. 2015-08-26 12:26:11 +00:00
llvm-pdbdump Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial types 2015-05-29 19:43:39 +00:00
llvm-profdata modules: Move ProfileKinds to an anonymous namespace 2015-06-16 00:43:04 +00:00
llvm-readobj [llvm-readobj] Dump MachO Dysymtab command. 2015-08-31 19:32:31 +00:00
llvm-rtdyld Convert getSymbolSection to return an ErrorOr. 2015-08-07 23:27:14 +00:00
llvm-shlib Enable linking tools, shared libraries against libLLVM 2015-09-01 03:14:31 +00:00
llvm-size Fix "the the" in comments. 2015-06-19 01:53:21 +00:00
llvm-split TransformUtils: Introduce module splitter. 2015-08-21 02:48:20 +00:00
llvm-stress [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
llvm-symbolizer [llvm-symbolizer] Remove underscores and other C mangling on Windows 2015-08-10 21:47:11 +00:00
lto LTO: Simplify merged module ownership. 2015-08-24 22:22:53 +00:00
macho-dump [Object, MachO] Introduce MachOObjectFile::load_commands() range iterator. 2015-06-03 22:19:36 +00:00
msbuild
obj2yaml Don't iterate over all sections in the ELFFile constructor. 2015-08-10 21:29:35 +00:00
opt [PM/AA] Remove the last relics of the separate IPA library from LLVM, 2015-08-18 17:51:53 +00:00
verify-uselistorder Move the personality function from LandingPadInst to Function 2015-06-17 20:52:32 +00:00
yaml2obj [yaml2obj] Support numeric indexes to create invalid files. Will be used by lld test. 2015-08-27 23:11:20 +00:00
CMakeLists.txt [CMake] Projects supported via LLVM_EXTERNAL_*_SOURCE_DIR need to be explicitly specified. 2015-07-21 15:53:09 +00:00
LLVMBuild.txt TransformUtils: Introduce module splitter. 2015-08-21 02:48:20 +00:00
Makefile TransformUtils: Introduce module splitter. 2015-08-21 02:48:20 +00:00