summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/DynamicLibrary.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* s/LLVM_ON_WIN32/_WIN32/, llvmNico Weber2018-04-291-3/+3
| | | | | | | | | | | | | | LLVM_ON_WIN32 is set exactly with MSVC and MinGW (but not Cygwin) in HandleLLVMOptions.cmake, which is where _WIN32 defined too. Just use the default macro instead of a reinvented one. See thread "Replacing LLVM_ON_WIN32 with just _WIN32" on llvm-dev and cfe-dev. No intended behavior change. This moves over all uses of the macro, but doesn't remove the definition of it in (llvm-)config.h yet. llvm-svn: 331127
* Allow clients to specify search order of DynamicLibraries.Frederich Munch2017-07-121-11/+32
| | | | | | | | | | | | | | Summary: Different JITs and other clients of LLVM may have different needs in how symbol resolution should occur. Reviewers: v.g.vassilev, lhames, karies Reviewed By: v.g.vassilev Subscribers: pcanal, llvm-commits Differential Revision: https://reviews.llvm.org/D33529 llvm-svn: 307849
* Fix the ManagedStatic list ordering when using ↵Frederich Munch2017-05-261-3/+8
| | | | | | | | | | | | | | | | | | | | DynamicLibrary::addPermanentLibrary. Summary: r295737 included a fix for leaking libraries loaded via. DynamicLibrary::addPermanentLibrary. This created a problem where static constructors in a library could insert llvm::ManagedStatic objects before DynamicLibrary would register it's own ManagedStatic, meaning a crash could occur at shutdown. r301562 exasperated this problem by cleaning up the DynamicLibrary ManagedStatic during llvm_shutdown. Reviewers: v.g.vassilev, lhames, efriedma Reviewed By: efriedma Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D33581 llvm-svn: 304027
* Refactor DynamicLibrary so searching for a symbol will have a defined order andFrederich Munch2017-04-271-121/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | libraries are properly unloaded when llvm_shutdown is called. Summary: This was mostly affecting usage of the JIT, where storing the library handles in a set made iteration unordered/undefined. This lead to disagreement between the JIT and native code as to what the address and implementation of particularly on Windows with stdlib functions: JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv Native: getenv("TEST") -> NULL // called ucrt.dll, getenv Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows not giving priority to the process' symbols as it did on Unix. Reviewers: chapuni, v.g.vassilev, lhames Reviewed By: lhames Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D30107 llvm-svn: 301562
* Revert "Refactor DynamicLibrary so searching for a symbol will have a ↵Frederich Munch2017-04-241-116/+121
| | | | | | | | | | defined order" The i686-mingw32-RA-on-linux bot is still having errors. This reverts commit r301236. llvm-svn: 301240
* Refactor DynamicLibrary so searching for a symbol will have a defined order andFrederich Munch2017-04-241-121/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | libraries are properly unloaded when llvm_shutdown is called. Summary: This was mostly affecting usage of the JIT, where storing the library handles in a set made iteration unordered/undefined. This lead to disagreement between the JIT and native code as to what the address and implementation of particularly on Windows with stdlib functions: JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv Native: getenv("TEST") -> NULL // called ucrt.dll, getenv Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows not giving priority to the process' symbols as it did on Unix. Reviewers: chapuni, v.g.vassilev, lhames Reviewed By: lhames Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D30107 llvm-svn: 301236
* Revert "Refactor DynamicLibrary so searching for a symbol will have a ↵Frederich Munch2017-04-241-116/+121
| | | | | | | | | | defined order.” The changes are causing the i686-mingw32 build to fail. This reverts commit r301153, and the changes for a separate warning on i686-mingw32 in r301155 and r301156. llvm-svn: 301157
* Fix warning converting from boolean to pointer introduced in r301153.Frederich Munch2017-04-241-1/+1
| | | | | | This reverts commit r301155, which was incorrect. llvm-svn: 301156
* Fix warning converting from void* to boolean introduced in r301153.Frederich Munch2017-04-241-1/+1
| | | | llvm-svn: 301155
* Refactor DynamicLibrary so searching for a symbol will have a defined order andFrederich Munch2017-04-241-121/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | libraries are properly unloaded when llvm_shutdown is called. Summary: This was mostly affecting usage of the JIT, where storing the library handles in a set made iteration unordered/undefined. This lead to disagreement between the JIT and native code as to what the address and implementation of particularly on Windows with stdlib functions: JIT: putenv_s("TEST", "VALUE") // called msvcrt.dll, putenv_s JIT: getenv("TEST") -> "VALUE" // called msvcrt.dll, getenv Native: getenv("TEST") -> NULL // called ucrt.dll, getenv Also fixed is the issue of DynamicLibrary::getPermanentLibrary(0,0) on Windows not giving priority to the process' symbols as it did on Unix. Reviewers: chapuni, v.g.vassilev, lhames Reviewed By: lhames Subscribers: danalbert, srhines, mgorny, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D30107 llvm-svn: 301153
* [Test commit] Remove extra newline.Frederich Munch2017-04-211-1/+0
| | | | llvm-svn: 301046
* Reland r296442 with modifications reverted in r296463.Vassil Vassilev2017-03-021-0/+12
| | | | | | | | | | | | | | Original commit message: "Allow externally dlopen-ed libraries to be registered as permanent libraries. This is also useful in cases when llvm is in a shared library. First we dlopen the llvm shared library and then we register it as a permanent library in order to keep the JIT and other services working. Patch reviewed by Vedant Kumar (D29955)!" llvm-svn: 296774
* Revert r296442 (and r296443), "Allow externally dlopen-ed libraries to be ↵NAKAMURA Takumi2017-02-281-25/+1
| | | | | | | | registered as permanent libraries." It broke clang/test/Analysis/checker-plugins.c llvm-svn: 296463
* Allow externally dlopen-ed libraries to be registered as permanent libraries.Vassil Vassilev2017-02-281-1/+25
| | | | | | | | | | This is also useful in cases when llvm is in a shared library. First we dlopen the llvm shared library and then we register it as a permanent library in order to keep the JIT and other services working. Patch reviewed by Vedant Kumar (D29955)! llvm-svn: 296442
* Do not leak OpenedHandles.Vassil Vassilev2017-02-211-7/+2
| | | | | | Reviewed by Vedant Kumar (D30178) llvm-svn: 295737
* [Support] Use HAVE_DLOPEN to guard dlopen(3) usagePavel Labath2016-11-301-2/+2
| | | | | | | | | | | | | | | | Summary: The usage was previously guarded by HAVE_DLFCN. This breaks on Android with LLVM_BUILD_STATIC as the platform does not provide a static version of libdl. Using HAVE_DLOPEN fixes it as the code will only get used if we are actually able to link an executable using dlopen. Reviewers: rafael, beanz Subscribers: tberghammer, danalbert, llvm-commits Differential Revision: https://reviews.llvm.org/D26504 llvm-svn: 288246
* Add more wrappers for symbol APIs to the C API.Eli Bendersky2015-06-091-0/+9
| | | | | | | | | | | This represents some of the functionality we expose in the llvmlite Python binding. Patch by Antoine Pitrou Differential Revision: http://reviews.llvm.org/D10222 llvm-svn: 239411
* Revert "Limit the symbol search in DynamicLibrary to the module that was ↵Zachary Turner2014-08-271-9/+2
| | | | | | | | opened." This reverts commit r216563, which breaks lli's dynamic symbol resolution. llvm-svn: 216569
* Limit the symbol search in DynamicLibrary to the module that was opened.Zachary Turner2014-08-271-2/+9
| | | | | | | | Differential Revision: http://reviews.llvm.org/D5030 Reviewed By: Reid Kleckner, Rafael Espindola llvm-svn: 216563
* Fix .cpp files claiming to be header filesHans Wennborg2014-06-201-1/+1
| | | | llvm-svn: 211334
* [C++11] Replace some comparisons with 'nullptr' with simple boolean checks ↵Craig Topper2014-04-091-3/+3
| | | | | | to reduce verbosity. llvm-svn: 205829
* [C++11] Make use of 'nullptr' in the Support library.Craig Topper2014-04-071-5/+5
| | | | llvm-svn: 205697
* Re-sort all of the includes with ./utils/sort_includes.py so thatChandler Carruth2014-01-071-2/+2
| | | | | | | | | | subsequent changes are easier to review. About to fix some layering issues, and wanted to separate out the necessary churn. Also comment and sink the include of "Windows.h" in three .inc files to match the usage in Memory.inc. llvm-svn: 198685
* Make sure LLVMLoadLibraryPermanently gets an extern "C" symbol.Benjamin Kramer2013-11-131-1/+1
| | | | | | | Otherwise it's impossible to use it. Also don't include C++ headers in a C header. llvm-svn: 194581
* Add newline at EOF in DynamicLibrary.cppPeter Zotov2013-11-061-1/+1
| | | | llvm-svn: 194144
* [llvm-c] Specify explicit namespace in LLVMLoadLibraryPermanentlyPeter Zotov2013-11-061-1/+1
| | | | | | | Presence of using namespace llvm depended on several #ifdef's, and this broke the build on mswin32. llvm-svn: 194142
* [llvm-c] Expose LLVMLoadLibraryPermanentlyPeter Zotov2013-11-061-0/+9
| | | | | | Original patch by Chris Wailes llvm-svn: 194139
* Make DynamicLibrary use ManagedStatic. This is pretty simple and should just ↵Filip Pizlo2013-09-181-25/+7
| | | | | | | | | | work as advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will "reset" if you shutdown llvm and try to come back for seconds. This is a subtle behavior change, but I'm assuming that nobody is affected by it. llvm-svn: 190946
* Revert r190921. It broke Windows.Filip Pizlo2013-09-181-7/+25
| | | | | | I'll roll it back in when I have a chance to look at it in detail. llvm-svn: 190923
* Make DynamicLibrary use ManagedStatic. This is pretty simple and should just ↵Filip Pizlo2013-09-181-25/+7
| | | | | | | | | | work as advertised - but it does have the caveat that calls to DynamicLibrary::AddSymbol will "reset" if you shutdown llvm and try to come back for seconds. This is a subtle behavior change, but I'm assuming that nobody is affected by it. llvm-svn: 190921
* Remove redundant 'llvm::' qualificationsDmitri Gribenko2013-01-131-1/+1
| | | | llvm-svn: 172358
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-3/+3
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Fix Android build of gtest and lib/Support.Evgeniy Stepanov2012-09-041-1/+1
| | | | llvm-svn: 163131
* Make DynamicLibrary thread-safe w/r/t call to dlerror() after dlopen(). PR10718Jordy Rose2011-08-221-1/+2
| | | | llvm-svn: 138260
* Static fields require an out-of-line definition. Fix DynamicLibrary for real.Jordy Rose2011-08-171-0/+2
| | | | llvm-svn: 137844
* Use DynamicLibrary instances as a way to get symbols from a specific ↵Jordy Rose2011-08-171-41/+57
| | | | | | library. Preparation for upcoming (preliminary) support for plugins for the static analyzer. llvm-svn: 137791
* Don't leak the mutex when loading dynamic libraries.Owen Anderson2010-12-071-12/+5
| | | | llvm-svn: 121119
* Merge System into Support.Michael J. Spencer2010-11-291-0/+177
llvm-svn: 120298
OpenPOWER on IntegriCloud