aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-shlib
AgeCommit message (Collapse)AuthorFilesLines
2019-03-19Use response file when generating LLVM-C.dllSerge Guelton2-3/+36
As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me. Commited on behalf of Jakob Bornecrantz. Differential Revision: https://reviews.llvm.org/D56781 llvm-svn: 356443
2019-01-29Revert r351833 and r352250.Hans Wennborg2-21/+3
They were breaking the Windows build when using MSBuild, see the discussion on D56781. r351833: "Use response file when generating LLVM-C.dll" > Use response file when generating LLVM-C.dll > > As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me. > > Commited on behalf of Jakob Bornecrantz > > Differential Revision: https://reviews.llvm.org/D56781 r352250: "Build LLVM-C.dll by default on windows and enable in release package" > Build LLVM-C.dll by default on windows and enable in release package > > With the fixes to the building of LLVM-C.dll in D56781 this should now > be safe to land. This will greatly simplify dealing with LLVM for people > that just want to use the C API on windows. This is a follow up from > D35077. > > Patch by Jakob Bornecrantz! > > Differential revision: https://reviews.llvm.org/D56774 llvm-svn: 352492
2019-01-22Use response file when generating LLVM-C.dllSerge Guelton2-3/+21
As discovered in D56774 the command line gets to long, so use a response file to give the script the libs. This change has been tested and is confirmed working for me. Commited on behalf of Jakob Bornecrantz Differential Revision: https://reviews.llvm.org/D56781 llvm-svn: 351833
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2-8/+6
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2018-10-18Support of hurd in llvm-shlib Sylvestre Ledru1-0/+1
Svante Signell llvm-svn: 344756
2018-08-07[RFC] Build LLVM-C.dll on MSVC that exports only the C APIDavid Bolvansky2-54/+207
Summary: Hello! This commit adds a LLVM-C target that is always built on MSVC. A big fat warning, this is my first cmake code ever so there is a fair bit of I-have-no-idea-what-I'm-doing going on here. Which is also why I placed it outside of llvm-shlib as I was afraid of breaking things of other people. Secondly llvm-shlib builds a LLVM.so which exports all symbols and then does a thin library that points to it, but on Windows we do not build a LLVM.dll so that would have complicated the code more. The patch includes a python script that calls dumpbin.exe to get all of the symbols from the built libraries. It then grabs all the symbols starting with LLVM and generates the export file from those. The export file is then used to create the library just like the LLVM-C that is built on darwin. Improvements that I need help with, to follow up this review. - Get cmake to make sure that dumpbin.exe is on the path and wire the full path to the script. - Use LLVM-C.dll when building llvm-c-test so we can verify that the symbols are exported. - Bundle the LLVM-C.dll with the windows installer. Why do this? I'm building a language frontend which is self-hosting, and on windows because of various tooling issues we have a problem of consuming the LLVM*.lib directly on windows. Me and the users of my projects using LLVM would be greatly helped by having LLVM-C.dll built and shipped by the Windows installer. Not only does LLVM takes forever to build, you have to run a extra python script in order to get the final DLL. Any comments, thoughts or help is greatly appreciated. Cheers, Jakob. Patch by: Wallbraker (Jakob Bornecrantz) Reviewers: compnerd, beanz, hans, smeenai Reviewed By: beanz Subscribers: xbolva00, bhelyer, Memnarch, rnk, fedor.sergeev, chapuni, smeenai, john.brawn, deadalnix, llvm-commits, mgorny Differential Revision: https://reviews.llvm.org/D35077 llvm-svn: 339151
2018-08-02CMake: Remove LLVM_DYLIB_SYMBOL_VERSIONINGTom Stellard1-4/+0
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: 338751
2018-06-23[CMake] Support building shared library for OpenBSDBrad Smith1-0/+1
llvm-svn: 335424
2018-05-17[CMake] Support building shared library for FuchsiaPetr Hosek1-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
2018-03-29Rename llvm library from libLLVM-X.Y to libLLVM-XSylvestre Ledru1-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
2017-07-19[Solaris] enable --whole-archive for shared-library build, disable ↵Sylvestre Ledru1-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
2017-07-11[cmake] Check for Haiku when setting LIB_NAMES for GNU ldAndrew Wilkins1-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
2017-05-03CMake: Add LLVM_DYLIB_SYMBOL_VERSIONING optionTom Stellard1-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
2017-04-17Add a linker script to version LLVM symbolsSylvestre Ledru2-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
2017-03-26Add check for BSD when setting LIB_NAMES for GNU ldAndrew Wilkins1-1/+1
Patch by Koop Mast and Alex Arslan! Differential Revision: https://reviews.llvm.org/D28215 llvm-svn: 298798
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