summaryrefslogtreecommitdiff
path: root/lib/System/DynamicLibrary.cpp
Commit message (Collapse)AuthorAge
* Fix failure of unittests/ExecutionEngine/JIT/MultiJITTest.cpp onChris Lattner2010-08-17
| | | | | | | cygwin when built with ENABLE_SHARED=1. Patch by NAKAMURA Takumi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111231 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bunch of namespace polution.Dan Gohman2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101376 91177308-0d34-0410-b5e6-96231b3b80d8
* add minix support, patch by Kees van Reeuwijk! PR6797Chris Lattner2010-04-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100895 91177308-0d34-0410-b5e6-96231b3b80d8
* Make clang bootstrap happier on OSX 10.5 by reducing the number of headersJeffrey Yasskin2010-03-11
| | | | | | | | | | included when using global symbols to ask the linker for the addresses of various functions. One of the symbols was actually getting declared by a header included in DynamicLibrary.cpp, which conflicted with the "extern void*" declaration in SearchForAddressOfSpecialSymbol(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98243 91177308-0d34-0410-b5e6-96231b3b80d8
* Alternative fix to make sure that the extern declarations used byDouglas Gregor2009-12-23
| | | | | | | | | DynamicLibrary::SearchForAddressOfSymbol refer to declarations in the global namespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92023 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 92020 until I figure out a more portable fixDouglas Gregor2009-12-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92021 91177308-0d34-0410-b5e6-96231b3b80d8
* Move the extern symbol declarations outside ofDouglas Gregor2009-12-23
| | | | | | | | | | | | | | DynamicLibrary::SearchForAddressOfSymbol and force them to have "C" linkage. Interestingly, GCC treats the block-scoped "extern" declarations we previously had as if they were extern "C" declarations (or, at least, were in the global namespace), so that GCC bug papered over this LLVM bug. Clang and EDG get the linkage correct; this new variant seems to work for both GCC and Clang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92020 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused includes.Chandler Carruth2009-10-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85074 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix ExplicitSymbols leak.Torok Edwin2009-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80589 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the static constructors and locks from DynamicLibrary.cpp.Chris Lattner2009-07-07
| | | | | | | | | | | | | | | | | | | | This fixes PR4512 and eliminating static ctors is always good. Losing thread safety is unfortunate, but the code is just incredibly poorly designed. If someone is interested, the "right" solution is to split DynamicLibrary.cpp into two separate pieces: a stateless piece in libsystem, and a simple support file in libsupport that has the "state" (e.g. AddSymbol) in managed static objects. Doing this would both fix memory leaks we already have, as well as make the code thread safe again. it would also make sense to move all the unix specific code in System/DynamicLibrary.cpp into System/Unix/DynamicLibrary.inc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74927 91177308-0d34-0410-b5e6-96231b3b80d8
* remove dead code, noone creates instances of "DynamicLibrary", so the ctor ↵Chris Lattner2009-07-07
| | | | | | and dtor are dead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74926 91177308-0d34-0410-b5e6-96231b3b80d8
* we don't use libtool anymore, update comments.Chris Lattner2009-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74924 91177308-0d34-0410-b5e6-96231b3b80d8
* Guard dynamic library loading.Owen Anderson2009-06-25
| | | | | | | | I did my best at implementing this for Win32, but I don't have a way to test it. Can someone with access to a Win32 machine test/fix this? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74188 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR3424, a static constructor ordering issue. Patch by Robert Schuster!Chris Lattner2009-01-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63269 91177308-0d34-0410-b5e6-96231b3b80d8
* Add <cstdio> include where needed by gcc-4.4.Duncan Sands2008-10-08
| | | | | | | Patch by Samuel Tardieu. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
* open plugins with RTLD_GLOBAL, pointed out by Bram Adams.Chris Lattner2008-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53385 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove uses of llvm/System/IncludeFile.h that are no longer needed.Dan Gohman2008-05-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50695 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused GetAddressOfSymbol()Devang Patel2008-03-13
| | | | | | | | Thanks Daniel Dunbar! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48340 91177308-0d34-0410-b5e6-96231b3b80d8
* This is a simple fix for getting error messages from dlerror inChris Lattner2008-03-12
| | | | | | | | | | LoadLibraryPermanently. The current code modifies the value of a pointer that is passed by value, so the caller never gets the message. Patch by Julien Lerouge! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48270 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide __main hooks for cygwin & mingw32Anton Korobeynikov2008-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47479 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove use of ltdlDevang Patel2008-02-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47065 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compile failures with g++-4.3.Duncan Sands2008-01-09
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45781 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide hook for _alloca to make JITing on Cygwin slightly happier :)Anton Korobeynikov2007-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44528 91177308-0d34-0410-b5e6-96231b3b80d8
* really fix PR1581, thanks to Daniel Dunbar for pointingChris Lattner2007-09-28
| | | | | | | this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42448 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix PR1581, patch by Timo SavolaChris Lattner2007-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40616 91177308-0d34-0410-b5e6-96231b3b80d8
* silence warningChris Lattner2007-02-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33746 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak Darwin.Reid Spencer2007-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33375 91177308-0d34-0410-b5e6-96231b3b80d8
* Help the lli interpreter find the stderr/stdin/stdout symbols. These areReid Spencer2007-01-19
| | | | | | | | needed for output to be generated. On Linux these are both global vars and macro definitions so we have to special case Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33374 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle each of stderr/stdin/stdout separately.Reid Spencer2007-01-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33373 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid taking the address of a macro by checking to see if stdin is definedReid Spencer2007-01-11
| | | | | | | or not. This allows DynamicLibrary.cpp to compile on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33064 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow LLI, in interpreter mode, to find stdin, stdout, and stderr. This isReid Spencer2007-01-10
| | | | | | | a bit of a hack but it lets some of the llvm-test programs run. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33058 91177308-0d34-0410-b5e6-96231b3b80d8
* Guess what happens when asserts are disabled. :(Chris Lattner2006-08-30
| | | | | | | Also, the assert could never fire due to || instead of &&. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29977 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR797:Reid Spencer2006-08-25
| | | | | | | | | | | | | | | | Final commit for this bug. This removes the last EH holdouts in LLVM and turns off exception support by using the -fno-exceptions option. This leads to the following reduction in library and executable sizes: DEBUG BUILD RELEASE BUILD before after delta before after delta lib 162,328K 157,616K 4,712 17,864K 16,416K 1,448K bin 571,444K 557,156K 14,288 63,296K 56,996K 6,300K Debug Improvement: 19,000K (2.59%) Release Improvement: 7,748K (9.55%) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29882 91177308-0d34-0410-b5e6-96231b3b80d8
* For PR780:Reid Spencer2006-07-26
| | | | | | | | | | Put the rest of lib/System into LinkAllVMCore.h. This makes all of lib/System available to programs that #include LinkALlVMCore.h so that loadable modules linked into those programs can depend on all of lib/System being available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29288 91177308-0d34-0410-b5e6-96231b3b80d8
* Change LoadLibraryPermanently to not throw an exception.Chris Lattner2006-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29048 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug noticed, by inspection. Filename can be null.Chris Lattner2006-05-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28292 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix iterator invalidation bug, identified by Coverity.Chris Lattner2006-05-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28257 91177308-0d34-0410-b5e6-96231b3b80d8
* Add AddSymbol() method to DynamicLibrary to work around Windows limitationJeff Cohen2006-01-30
| | | | | | | | of being unable to search for symbols in an EXE. It will also allow other existing hacks to be improved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25805 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove trailing whitespaceMisha Brukman2005-04-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21422 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename Unix/*.cpp and Win32/*.cpp to have a *.inc suffix so that the sillyReid Spencer2005-01-09
| | | | | | | | gdb debugger doesn't get confused on which file it is reading (the one in lib/System or the one in lib/System/{Win32,Unix}) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19426 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct the case of a #include directory name, just in case.Reid Spencer2005-01-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19254 91177308-0d34-0410-b5e6-96231b3b80d8
* Get VC++ building againJeff Cohen2004-12-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19140 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate use of ltdl.c when doing a VC++ build. Because libtool isn't used,Jeff Cohen2004-12-24
| | | | | | | ltdl's LGPL license would infect all of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19137 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compilation error on Darwin.Chris Lattner2004-12-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18485 91177308-0d34-0410-b5e6-96231b3b80d8
* Move darwin-specific majik here.Chris Lattner2004-12-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18466 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement two new functions: LoadLibraryPermanently andReid Spencer2004-11-29
| | | | | | | SearchForAddressOfSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18355 91177308-0d34-0410-b5e6-96231b3b80d8
* We just use ltdl's implementation for this abstraction now. Its portable toReid Spencer2004-11-29
| | | | | | | more platforms than LLVM supports. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18352 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the default constructor which causes the current program to beReid Spencer2004-11-29
| | | | | | | opened as if it was a dynamic library so its symbols can be searched too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18341 91177308-0d34-0410-b5e6-96231b3b80d8
* Dynamic Library abstraction. This makes the abstraction of a single dynamicReid Spencer2004-11-18
library (shared library/shared object) whose symbols can be looked up dynamically. Used for plug-ins. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17940 91177308-0d34-0410-b5e6-96231b3b80d8