summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-shlib
Commit message (Collapse)AuthorAgeFilesLines
* Merging r338751:Hans Wennborg2018-08-031-4/+0
| | | | | | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r338751 | tstellar | 2018-08-02 20:16:10 +0200 (Thu, 02 Aug 2018) | 13 lines CMake: Remove LLVM_DYLIB_SYMBOL_VERSIONING Summary: This option is no longer needed since r300496 added symbol versioning by default Reviewers: sylvestre.ledru, beanz, mgorny Reviewed By: mgorny Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49835 ------------------------------------------------------------------------ llvm-svn: 338842
* [CMake] Support building shared library for OpenBSDBrad Smith2018-06-231-0/+1
| | | | llvm-svn: 335424
* [CMake] Support building shared library for FuchsiaPetr Hosek2018-05-171-0/+1
| | | | | | | | | Fuchsia uses ELF as a file format and LLD as the linker so we can use the same implementation as other ELF based platforms. Differential Revision: https://reviews.llvm.org/D46991 llvm-svn: 332570
* Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru2018-03-291-1/+1
| | | | | | | | | | | | | | | | | | Summary: As we are only doing X.0.Z releases (not using the minor version), there is no need to keep -X.Y in the version. Like patch https://reviews.llvm.org/D41808, I propose that we rename libLLVM-7.0svn.so to libLLVM-7svn.so This patch will also rename downstream libraries like liblldb-7.0 to liblldb-7 Reviewers: axw, beanz, dim, hans Reviewed By: dim, hans Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D41869 llvm-svn: 328768
* [Solaris] enable --whole-archive for shared-library build, disable ↵Sylvestre Ledru2017-07-191-2/+9
| | | | | | | | | | | | | | --version-script for Solaris-ld Shared-library build on Solaris requires --whole-archive to be specified (option accepted by all available linkers). At the same time, --version-script can not be handled by Solaris-ld, so it should be skipped. -M is of no use here, since there is no syntax in Solaris-ld mapfiles that allows to version all global symbols, not just the named ones (at least this is my impression from digging deep into the docs). Patch by Fedor Sergeev <fedor.sergeev@oracle.com> llvm-svn: 308490
* [cmake] Check for Haiku when setting LIB_NAMES for GNU ldAndrew Wilkins2017-07-111-1/+1
| | | | | | | | | | | | | | Haiku uses GNU ld for linking, but is not captured in the conditional when setting LIB_NAMES. This causes a shared library with no symbols on Haiku. This patch simply adds a check for whether the CMake system name is Haiku in addition to the existing checks. Patch by Jérôme Duval. Differential Revision: https://reviews.llvm.org/D34998 llvm-svn: 307607
* CMake: Add LLVM_DYLIB_SYMBOL_VERSIONING optionTom Stellard2017-05-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When apps or other libraries link against a library with symbol versions, the version string is recorded in the import table, and used at runtime to resolve the symbol back to a library that provides that version (vaguely like how two-level namespaces work in Mach-O). ld's --default-symver flag tags every exported symbol with a symbol version string equal to the library's soname. Using --default-symver means multiple versions of libLLVM can coexist within the same process, at least to the extent that they don't try to pass data between each other's llvms. As an example, imagine a language like Rust using llvm for CPU codegen, binding to OpenGL, with Mesa as the OpenGL implementation using llvm for R600 codegen. With --default-symver Rust and Mesa will resolve their llvm usage to the version each was linked against, which need not match. (Other ELF platforms like BSD and Solaris might have similar semantics, I've not checked.) This is based on an autoconf version of this patch by Adam Jackson. This new option can be used to add --default-symver to the linker flags for libLLVM.so. Reviewers: beanz Reviewed By: beanz Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D30997 llvm-svn: 302026
* Add a linker script to version LLVM symbolsSylvestre Ledru2017-04-172-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds a very simple linker script to version the lib's symbols and thus trying to avoid crashes if an application loads two different LLVM versions (as long as they do not share data between them). Note that we deliberately *don't* make LLVM_5.0 depend on LLVM_4.0: they're incompatible and the whole point of this patch is to tell the linker that. Avoid unexpected crashes when two LLVM versions are used in the same process. Author: Rebecca N. Palmer <rebecca_palmer@zoho.com> Author: Lisandro Damían Nicanor Pérez Meyer <lisandro@debian.org> Author: Sylvestre Ledru <sylvestre@debian.org> Bug-Debian: https://bugs.debian.org/848368 Reviewers: beanz, rnk Reviewed By: rnk Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D31524 llvm-svn: 300496
* Add check for BSD when setting LIB_NAMES for GNU ldAndrew Wilkins2017-03-261-1/+1
| | | | | | | | Patch by Koop Mast and Alex Arslan! Differential Revision: https://reviews.llvm.org/D28215 llvm-svn: 298798
* Fix llvm-shlib cmake buildChris Bieneman2016-11-011-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
* Revert "[CMake] LINK_LIBS need to be public for Darwin dylib targets"Steven Wu2016-05-261-11/+0
| | | | | | This reverts r270723. This commit breaks greendragon. llvm-svn: 270820
* [CMake] LINK_LIBS need to be public for Darwin dylib targetsChris Bieneman2016-05-251-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
* [CMake] If set we should pass LLVM_VERSION_INFO into config.hChris Bieneman2016-04-251-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
* llvm-shlib: Remove the option to override __cxa_atexitJustin Bogner2016-03-141-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
* Remove autoconf supportChris Bieneman2016-01-261-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
* [CMake] Bug 25059 - CMake libllvm.so.$MAJOR.$MINOR shared object name not ↵Chris Bieneman2015-11-041-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
* [CMake] Get rid of LLVM_DYLIB_EXPORT_ALL, and make it the default, add ↵Chris Bieneman2015-10-271-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
* [CMake] Add LLVM_VERSION_PATCH to the -current_version flag for libLTO and ↵Chris Bieneman2015-10-141-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
* [CMake] libLLVM's compatibility version should be 1.Chris Bieneman2015-10-131-1/+1
| | | | | | This is in matching with the autoconf build system. llvm-svn: 250244
* [CMake] If LLVM_DYLIB_EXPORT_ALL is On don't generate an export list at all, ↵Chris Bieneman2015-10-091-18/+10
| | | | | | | | just export the world. This should resolve Bug 24157 - CMake built shared library does not export all public symbols llvm-svn: 249862
* [cmake] rework LLVM_LINK_LLVM_DYLIB option handlingAndrew Wilkins2015-09-051-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
* Enable linking tools, shared libraries against libLLVMAndrew Wilkins2015-09-011-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
* [PM/AA] Remove the last relics of the separate IPA library from LLVM,Chandler Carruth2015-08-181-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
* [CMake] Add missing DebugInfo libraries to llvm-shlibKeno Fischer2015-07-131-0/+2
| | | | | | | | | | Reviewers: beanz Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D11128 llvm-svn: 242054
* Updating symbol wildcards one more time.Chris Bieneman2015-04-161-1/+1
| | | | | | This should catch all C++ symbols containing llvm in the name. llvm-svn: 235136
* Properly escaping the quotes so that bash doesn't do stupid things with the ↵Chris Bieneman2015-04-161-1/+1
| | | | | | wildcards. llvm-svn: 235127
* Fixing llvm-shlib's LLVM_DYLIB_EXPORT_ALL to work with Darwin fat binaries.Chris Bieneman2015-04-161-25/+27
| | | | llvm-svn: 235114
* [CMake] Updates to llvm-shlib to support overriding exports list and added ↵Chris Bieneman2015-04-131-10/+21
| | | | | | an option to export all symbols. llvm-svn: 234798
* Raising minimum required CMake version to 2.8.12.2.Chris Bieneman2015-03-231-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
* Revert "Raising minimum required CMake version to 2.8.12.2."Tobias Grosser2015-02-241-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
* Revert "Revert "Raising minimum required CMake version to 2.8.12.2.""Chad Rosier2015-02-231-1/+1
| | | | | | This reverts commit r230240, which was an accidental commit. llvm-svn: 230246
* Revert "Raising minimum required CMake version to 2.8.12.2."Chad Rosier2015-02-231-1/+1
| | | | | | This reverts commit 247aed4710e8befde76da42b27313661dea7cf66. llvm-svn: 230240
* Raising minimum required CMake version to 2.8.12.2.Chris Bieneman2015-02-201-1/+1
| | | | llvm-svn: 230062
* Fixing a CMake developer warning.Chris Bieneman2015-02-181-1/+3
| | | | llvm-svn: 229721
* [cmake] Start making LLVM_LIBDIR_SUFFIX effective by adding it toChandler Carruth2014-12-291-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
* Adding a new option to CMake to disable C++ atexit on llvm-shlib.Chris Bieneman2014-12-091-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
* [CMake] llvm-shlib: Prune redundant components, AsmPrinter, MC, and ↵NAKAMURA Takumi2014-11-111-3/+0
| | | | | | SelectionDAG. llvm-svn: 221675
* [CMake] Let llvm-shlib work on Linux with --whole-archive.NAKAMURA Takumi2014-11-101-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
* [CMake] llvm-shlib: Add possibly missing BitReader and MCDisassembler for ↵NAKAMURA Takumi2014-11-081-0/+2
| | | | | | | | | | | | llvm-c. FYI, 3 modules below are redundant in trunk; AsmPrinter MC SelectionDAG llvm-svn: 221579
* Adding llvm-shlib to CMake build system with a few new bells and whistlesChris Bieneman2014-10-232-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
* Revert of 214418:Sylvestre Ledru2014-08-011-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
* Create a default symver on Linux like ELF OSes.Eric Christopher2014-07-311-0/+5
| | | | | | Patch by Adam Jackson. llvm-svn: 214418
* autoconf: Fix soname for libLLVM-Major.Minor.so (2nd try)Tom Stellard2014-05-131-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
* Revert "autoconf: Fix soname for libLLVM-Major.Minor.so"Tom Stellard2014-05-131-2/+2
| | | | | | | | | This reverts commit r208708. I forgot to run make clean before testing this and it broke tools linking. llvm-svn: 208709
* autoconf: Fix soname for libLLVM-Major.Minor.soTom Stellard2014-05-131-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
* Add patch level to llvm version in CMake and AutoconfTom Stellard2014-03-031-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
* Centralize the handling of install_name and rpath.Rafael Espindola2014-02-281-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
* Strip dead code when linking by default with BFD ld (linux, ...) and ld64 ↵Nico Weber2013-12-271-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
* Rules adjustments in order to build on DragonFly BSD.Rafael Espindola2013-10-311-2/+2
| | | | | | Patch by Robin Hahling. llvm-svn: 193750
* Use @rpath for libraries rather than @executable_path on OSX.Eric Christopher2013-08-021-1/+1
| | | | | | Patch by Benjamin Scarlet! llvm-svn: 187641
OpenPOWER on IntegriCloud