aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-shlib
AgeCommit message (Collapse)AuthorFilesLines
2016-11-01Fix llvm-shlib cmake buildChris Bieneman1-22/+20
Summary: This fixes a few things that used to work with a Makefile build, but were broken in cmake. 1. Treat MINGW like a Linux system. 2. The shlib should never contain other shared libraries. Patch By: Valentin Churavy Reviewers: axw, beanz Subscribers: modocache, beanz, mgorny Differential Revision: https://reviews.llvm.org/D25865 llvm-svn: 285737
2016-05-26Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets"Steven Wu1-11/+0
This reverts r270723. This commit breaks greendragon. llvm-svn: 270820
2016-05-25[CMake] LINK_LIBS need to be public for Darwin dylib targetsChris Bieneman1-0/+11
This should actually address PR27855. This results in adding references to the system libs inside generated dylibs so that they get correctly pulled in when linking against the dylib. llvm-svn: 270723
2016-04-25[CMake] If set we should pass LLVM_VERSION_INFO into config.hChris Bieneman1-2/+0
Autoconf used to support setting LLVM_VERSION_INFO and there is some code filtered around llvm in Support/CommandLine.cpp and LTO/LTOCodeGenerator.cpp that uses it if it is set. We also shouldn't be explicitly setting it as a define on llvm-shlib. It is pointless there because there is no code using it in llvm-shlib, and it is better to have it as part of the generated config.h so that it is available everywhere. llvm-svn: 267490
2016-03-14llvm-shlib: Remove the option to override __cxa_atexitJustin Bogner1-7/+0
If anybody is actually using this, it probably doesn't do what they think it does. This actually causes the dylib to *export* a __cxa_atexit symbol, so anything that links it probably loses their exit time destructors as well as disabling LLVM's. This just removes the option entirely. If somebody does need this behaviour we should figure out a more principled way to do it. This is effectively a revert of r223805. llvm-svn: 263498
2016-01-26Remove autoconf supportChris Bieneman1-116/+0
Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "I felt a great disturbance in the [build system], as if millions of [makefiles] suddenly cried out in terror and were suddenly silenced. I fear something [amazing] has happened." - Obi Wan Kenobi Reviewers: chandlerc, grosbach, bob.wilson, tstellarAMD, echristo, whitequark Subscribers: chfast, simoncook, emaste, jholewinski, tberghammer, jfb, danalbert, srhines, arsenm, dschuff, jyknight, dsanders, joker.eph, llvm-commits Differential Revision: http://reviews.llvm.org/D16471 llvm-svn: 258861
2015-11-04[CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not ↵Chris Bieneman1-1/+1
compatible with ldconfig Summary: This change makes the CMake build system generate libraries for Linux and Darwin matching the makefile build system. Linux libraries follow the pattern lib${name}.${MAJOR}.${MINOR}.so so that ldconfig won't pick it up incorrectly. Darwin libraries are not versioned. Note: On linux the non-versioned symlink is generated at install-time not build time. I plan to fix that eventually, but I expect that is good enough for the purposes of fixing this bug. Reviewers: loladiro, tstellarAMD Subscribers: axw, llvm-commits Differential Revision: http://reviews.llvm.org/D13841 llvm-svn: 252093
2015-10-27[CMake] Get rid of LLVM_DYLIB_EXPORT_ALL, and make it the default, add ↵Chris Bieneman1-40/+41
libLLVM-C on darwin to cover the C API needs. Summary: We've had a lot of discussion in the past about the meaningful and useful default behaviors for the llvm-shlib tool. The original implementation was heavily geared toward Apple's use, and I think that was wrong. This patch seeks to correct that. I've removed the LLVM_DYLIB_EXPORT_ALL variable and made libLLVM export everything by default. I've also added a new target that is only built on Darwin for libLLVM-C as a library that re-exports the LLVM-C API. This library is not built on Linux because ELF doesn't support re-export libraries in the same way MachO does. Reviewers: chapuni, resistor, bogner, axw Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D13842 llvm-svn: 251411
2015-10-14[CMake] Add LLVM_VERSION_PATCH to the -current_version flag for libLTO and ↵Chris Bieneman1-1/+1
libLLVM. This is to match autoconf where LLVM_SUBMIT_SUBVERSION is usually set to ${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}. llvm-svn: 250277
2015-10-13[CMake] libLLVM's compatibility version should be 1.Chris Bieneman1-1/+1
This is in matching with the autoconf build system. llvm-svn: 250244
2015-10-09[CMake] If LLVM_DYLIB_EXPORT_ALL is On don't generate an export list at all, ↵Chris Bieneman1-18/+10
just export the world. This should resolve Bug 24157 - CMake built shared library does not export all public symbols llvm-svn: 249862
2015-09-05[cmake] rework LLVM_LINK_LLVM_DYLIB option handlingAndrew Wilkins1-47/+4
Summary: This diff attempts to address the concerns raised in http://reviews.llvm.org/D12488. We introduce a new USE_SHARED option to llvm_config, which, if set, causes the target to be linked against libLLVM. add_llvm_utility now uniformly disables linking against libLLVM. These utilities are not intended for distribution, and this keeps the option handling more centralised. llvm-shlib is now processes before any other "tools" subdirectories, ensuring the libLLVM target is defined before its dependents. One main difference from what was requested: llvm_config does not prune LLVM_DYLIB_COMPONENTS from the components passed into explicit_llvm_config. This is because the "all" component does something special, adding additional libraries (namely libLTO). Adding the component libraries after libLLVM should not be a problem, as symbols will be resolved in libLLVM first. Finally, I'm not really happy with the DISABLE_LLVM_LINK_LLVM option, but I'm not sure of a better way to get the following: - link all tools and shared libraries to libLLVM if LLVM_LINK_LLVM_DYLIB is set - some way of explicitly *not* doing so for utilities and libLLVM itself Suggestions for improvement here are particularly welcome. Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D12590 llvm-svn: 246918
2015-09-01Enable linking tools, shared libraries against libLLVMAndrew Wilkins1-5/+36
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 llvm-svn: 246527
2015-08-18[PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth1-1/+0
folding the code into the main Analysis library. There already wasn't much of a distinction between Analysis and IPA. A number of the passes in Analysis are actually IPA passes, and there doesn't seem to be any advantage to separating them. Moreover, it makes it hard to have interactions between analyses that are both local and interprocedural. In trying to make the Alias Analysis infrastructure work with the new pass manager, it becomes particularly awkward to navigate this split. I've tried to find all the places where we referenced this, but I may have missed some. I have also adjusted the C API to continue to be equivalently functional after this change. Differential Revision: http://reviews.llvm.org/D12075 llvm-svn: 245318
2015-07-13[CMake] Add missing DebugInfo libraries to llvm-shlibKeno Fischer1-0/+2
Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11128 llvm-svn: 242054
2015-04-16Updating symbol wildcards one more time.Chris Bieneman1-1/+1
This should catch all C++ symbols containing llvm in the name. llvm-svn: 235136
2015-04-16Properly escaping the quotes so that bash doesn't do stupid things with the ↵Chris Bieneman1-1/+1
wildcards. llvm-svn: 235127
2015-04-16Fixing llvm-shlib's LLVM_DYLIB_EXPORT_ALL to work with Darwin fat binaries.Chris Bieneman1-25/+27
llvm-svn: 235114
2015-04-13[CMake] Updates to llvm-shlib to support overriding exports list and added ↵Chris Bieneman1-10/+21
an option to export all symbols. llvm-svn: 234798
2015-03-23Raising minimum required CMake version to 2.8.12.2.Chris Bieneman1-1/+1
This commit is in reference to the llvm-dev thread: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-March/083672.html llvm-svn: 233008
2015-02-24Revert "Raising minimum required CMake version to 2.8.12.2."Tobias Grosser1-1/+1
This reverts commit r230062. Debian stable (wheezy) ships still with cmake 2.8.9. The commit broke my LLVM/Polly buildbot, to my knowledge our only Linux+cmake buildbot. llvm-svn: 230343
2015-02-23Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""Chad Rosier1-1/+1
This reverts commit r230240, which was an accidental commit. llvm-svn: 230246
2015-02-23Revert "Raising minimum required CMake version to 2.8.12.2."Chad Rosier1-1/+1
This reverts commit 247aed4710e8befde76da42b27313661dea7cf66. llvm-svn: 230240
2015-02-20Raising minimum required CMake version to 2.8.12.2.Chris Bieneman1-1/+1
llvm-svn: 230062
2015-02-18Fixing a CMake developer warning.Chris Bieneman1-1/+3
llvm-svn: 229721
2014-12-29[cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it toChandler Carruth1-1/+1
*numerous* places where it was missing in the CMake build. The primary change here is that the suffix is now actually used for all of the lib directories in the LLVM project's CMake. The various subprojects still need similar treatment. This is the first of a series of commits to try to make LLVM's cmake effective in a multilib Linux installation. I don't think many people are seriously using this variable so I'm hoping the fallout will be minimal. A somewhat unfortunate consequence of the nature of these commits is that until I land all of them, they will in part make the brokenness of our multilib support more apparant. At the end, things should actually work. llvm-svn: 224919
2014-12-09Adding a new option to CMake to disable C++ atexit on llvm-shlib.Chris Bieneman1-0/+7
Summary: This is desirable for WebKit and other clients of the llvm-shlib because C++ exit time destructors have a tendency to crash when invoked from multi-threaded applications. Ideally this option will be temporary, because the ideal fix is to just not have exit time destructors. Reviewers: chapuni, ributzka Reviewed By: ributzka Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6572 llvm-svn: 223805
2014-11-11[CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and ↵NAKAMURA Takumi1-3/+0
SelectionDAG. llvm-svn: 221675
2014-11-10[CMake] Let llvm-shlib work on Linux with --whole-archive.NAKAMURA Takumi1-4/+10
FIXME: It should work on not only Linux but elf-targeting gnu ld. For example if LLVM_DYLIB_COMPONENTS is "BitWriter Support", CMake emits the command line like; -Wl,--whole-archive lib/libLLVMBitWriter.a lib/libLLVMSupport.a *1 -Wl,--no-whole-archive lib/libLLVMCore.a lib/libLLVMSupport.a *2 -lrt -ldl -ltinfo -lpthread -lm It works since symbols in LLVMCore is resolved with not *2 but *1. Unfortunately, --gc-sections is not powerful in this case to prune unused "visibility(default)" entries. I am still experimenting other way not to rely on --whole-archive. llvm-svn: 221591
2014-11-08[CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for ↵NAKAMURA Takumi1-0/+2
llvm-c. FYI, 3 modules below are redundant in trunk; AsmPrinter MC SelectionDAG llvm-svn: 221579
2014-10-23Adding llvm-shlib to CMake build system with a few new bells and whistlesChris Bieneman2-0/+108
Summary: This patch adds a new CMake build setting LLVM_BUILD_LLVM_DYLIB, which defaults to OFF. When set to ON, this will generate a shared library containing most of LLVM. The contents of the shared library can be overriden by specifying LLVM_DYLIB_COMPONENTS. LLVM_DYLIB_COMPONENTS can be set to a semi-colon delimited list of any LLVM components that you llvm-config can resolve. On Windows, unless you are using Cygwin, you must specify an explicit symbol export file using LLVM_EXPORTED_SYMBOL_FILE. On Cygwin and all unix-like platforms if you do not specify LLVM_EXPORTED_SYMBOL_FILE, an export file containing only the LLVM C API will be auto-generated from the list of LLVM components specified in LLVM_DYLIB_COMPONENTS. Reviewers: rnk Reviewed By: rnk Subscribers: rnk, llvm-commits Differential Revision: http://reviews.llvm.org/D5890 llvm-svn: 220490
2014-08-01Revert of 214418:Sylvestre Ledru1-5/+0
"Create a default symver on Linux like ELF OSes." Fails the build under Debian with ld.gold: /usr/bin/ld.gold: --default-symver: unknown option llvm-svn: 214482
2014-07-31Create a default symver on Linux like ELF OSes.Eric Christopher1-0/+5
Patch by Adam Jackson. llvm-svn: 214418
2014-05-13autoconf: Fix soname for libLLVM-Major.Minor.so (2nd try)Tom Stellard1-2/+2
We were using libLLVM-Major.Minor.Patch.so for the soname, but we need the soname to stay consistent for all Major.Minor.* releases otherwise operating system distributors will need to rebuild all packages that link with LLVM every time there is a new point release. This patch also reverses the compatibility symlink, so libLLVM-Major.Minor.Patch.so is now a symlink that points to libLLVM-Major-Minor.so. llvm-svn: 208721
2014-05-13Revert "autoconf: Fix soname for libLLVM-Major.Minor.so"Tom Stellard1-2/+2
This reverts commit r208708. I forgot to run make clean before testing this and it broke tools linking. llvm-svn: 208709
2014-05-13autoconf: Fix soname for libLLVM-Major.Minor.soTom Stellard1-2/+2
We were using libLLVM-Major.Minor.Patch.so for the soname, but we need the soname to stay consistent for all Major.Minor.* releases otherwise operating system distributors will need to rebuild all packages that link with LLVM every time there is a new point release. This patch also reverses the compatibility symlink, so libLLVM-Major.Minor.Patch.so is now a symlink that points to libLLVM-Major-Minor.so. llvm-svn: 208708
2014-03-03Add patch level to llvm version in CMake and AutoconfTom Stellard1-0/+2
The shared library generated by autoconf will now be called libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)$(VERSION_SUFFIX).so and a symlink named libLLVM-$(VERSION_MAJOR).$(VERSION_MINOR)$(VERSION_SUFFIX).so will also be created in the install directory. llvm-svn: 202720
2014-02-28Centralize the handling of install_name and rpath.Rafael Espindola1-8/+0
This centralizes the Makefile handling of -install_name and -rpath. It also moves the cmake build to using @rpath. The reason being that libclang needs it, and it works for everything else. A followup patch will move clang to using this and then there will be a single point to edit to support other systems. llvm-svn: 202499
2013-12-27Strip dead code when linking by default with BFD ld (linux, ...) and ld64 ↵Nico Weber1-3/+0
(os x). This reduces the size of clang-format from 22 MB to 1.8 MB, diagtool goes from 21 MB to 2.8 MB, libclang.so goes from 29 MB to 20 MB, etc. The size of the bin/ folder shrinks from 270 MB to 200 MB. Targets that support plugins and don't already use EXPORTED_SYMBOL_FILE (which libclang and libLTO already do) can set NO_DEAD_STRIP to opt out. llvm-svn: 198087
2013-10-31Rules adjustments in order to build on DragonFly BSD.Rafael Espindola1-2/+2
Patch by Robin Hahling. llvm-svn: 193750
2013-08-02Use @rpath for libraries rather than @executable_path on OSX.Eric Christopher1-1/+1
Patch by Benjamin Scarlet! llvm-svn: 187641
2013-07-01The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.Sylvestre Ledru1-3/+3
This kind of simplification is sometimes useful, but in general it's not correct. As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the build definitions used for FreeBSD, whereas for userland-related issues we want to match the definitions used for other systems with Glibc. The current modification adjusts the build system so that they can be distinguished, and explicitly adds GNU/kFreeBSD to the build checks in which it belongs. Fixes bug #16444. Patch by Robert Millan in the context of Debian. llvm-svn: 185311
2013-06-04Remove "-Wl,-seg1addr -Wl,0xE0000000" from link options.Bob Wilson1-2/+1
Specifying the load address for Darwin i386 dylibs was a performance optimization for dyld that is not relevant for x86_64 or arm. We can just remove this now. llvm-svn: 183230
2012-08-06Add support for the OpenBSD for Bitrig.Eric Christopher1-1/+1
Patch by David Hill. llvm-svn: 161344
2012-04-25openbsd doesn't support soname, patch by Brad Smith!Chris Lattner1-0/+3
llvm-svn: 155536
2012-04-11Fix the build under Debian GNU/Hurd.Sylvestre Ledru1-2/+2
Thanks to Pino Toscano for the patch llvm-svn: 154500
2012-04-03Set soname for FreeBSD as well.Anton Korobeynikov1-2/+2
Patch by Bernard Cafarelli! llvm-svn: 153965
2012-03-23Add soname to LLVM shared library on Linux. Probably the same stuff is ↵Anton Korobeynikov1-0/+2
necessary for *BSD. Patch from Mageia! llvm-svn: 153324
2011-10-18build: Tidy up a bunch of tool Makefiles, and simplify where possible using theDaniel Dunbar1-4/+4
new all-targets pseudo-component. llvm-svn: 142401
2011-10-04Exclude libLLVMTableGen.a from the shared libraryPeter Collingbourne1-2/+3
Unbreaks tools for --enable-shared build. llvm-svn: 141052