summaryrefslogtreecommitdiff
path: root/rts/Linker.c
Commit message (Collapse)AuthorAgeFilesLines
...
* Exports a few rts things we need for cmm code in external packagesDuncan Coutts2009-06-131-0/+4
| | | | | In particular we need alloc_blocks and alloc_blocks_lim for MAYBE_GC. The gmp cmm primops also use stg_ARR_WORDS_info.
* Add and export rts_unsafeGetMyCapability from rtsDuncan Coutts2009-06-121-0/+1
| | | | | | | | | | | | | | | We need this, or something equivalent, to be able to implement stgAllocForGMP outside of the rts. That's because we want to use allocateLocal which allocates from the given capability without having to take any locks. In the gmp primops we're basically in an unsafe foreign call, that is a context where we hold a current capability. So it's safe for us to use allocateLocal. We just need a way to get the current capability. The method to get the current capability varies depends on whether we're using the threaded rts or not. When stgAllocForGMP is built inside the rts that's ok because we can do it conditionally on THREADED_RTS. Outside the rts we need a single api we can call without knowing if we're talking to a threaded rts or not, hence this addition.
* Remove __encodeDouble and __encodeFloat from the rtsDuncan Coutts2009-06-111-2/+0
| | | | They now live in the integer-gmp package.
* Remove the unused remains of __decodeFloatIan Lynagh2009-06-021-1/+0
|
* Remove old GUM/GranSim codeSimon Marlow2009-06-021-5/+0
|
* Fix handling of R_SPARC_UA32 relocations in linkerBen.Lippmeier@anu.edu.au2009-05-281-3/+12
| | | | | | These refer to unaligned locations that need to be written byte-at-a-time. This fixes the SPARC ghci failures in the current head.
* export sysErrorBelchSimon Marlow2009-03-281-0/+1
|
* Windows: load msvcrt and kernel32 manuallySimon Marlow2009-05-201-0/+10
|
* OS X / amd64 fixesIan Lynagh2009-05-201-2/+4
|
* add getOrSetSignalHandlerStore, much like getOrSetTypeableStoreSimon Marlow2009-04-231-1/+2
| | | | Part of the fix for #3171
* FIX #1779 and qq005: export hs_hpc_moduleSimon Marlow2009-03-301-0/+1
|
* tidy up "missing symbol" error messageSimon Marlow2009-03-131-2/+1
|
* Partial fix for #2917Simon Marlow2009-03-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | - add newAlignedPinnedByteArray# for allocating pinned BAs with arbitrary alignment - the old newPinnedByteArray# now aligns to 16 bytes Foreign.alloca will use newAlignedPinnedByteArray#, and so might end up wasting less space than before (we used to align to 8 by default). Foreign.allocaBytes and Foreign.mallocForeignPtrBytes will get 16-byte aligned memory, which is enough to avoid problems with SSE instructions on x86, for example. There was a bug in the old newPinnedByteArray#: it aligned to 8 bytes, but would have failed if the header was not a multiple of 8 (fortunately it always was, even with profiling). Also we occasionally wasted some space unnecessarily due to alignment in allocatePinned(). I haven't done anything about Foreign.malloc/mallocBytes, which will give you the same alignment guarantees as malloc() (8 bytes on Linux/x86 here).
* Export blockUserSignals and unblockUserSignals (needed for #2870)Simon Marlow2009-02-191-1/+3
|
* Implement #2191 (traceCcs# -- prints CCS of a value when available -- take 3)Samuel Bronson2009-01-271-0/+1
| | | | | | In this version, I untag R1 before using it, and even enter R2 at the end rather than simply returning it (which didn't work right when R2 was a thunk).
* when calling mmap() with MAP_ANON, the fd argument should be -1Simon Marlow2009-01-081-1/+1
| | | | might fix #2925
* FIX #1364: added support for C finalizers that run as soon as the value is ↵Simon Marlow2008-12-101-0/+1
| | | | | | | | | | | not longer reachable. Patch originally by Ivan Tomac <tomac@pacific.net.au>, amended by Simon Marlow: - mkWeakFinalizer# commoned up with mkWeakFinalizerEnv# - GC parameters to ALLOC_PRIM fixed
* On FreeBSD, try MAP_FIXED if ordinary mmap() fails to give us suitable memorySimon Marlow2008-12-101-4/+14
| | | | | | | This appears to be necessary on FreeBSD. It might be necessary on other OSs too, but I'm being cautious because using MAP_FIXED can lead to crashes by overwriting existing mappings, and we have no (easy) way to prevent that.
* Fix symbol macro names in Linker.cThorkil Naur2008-11-211-3/+3
|
* fix the build when !USE_MMAPSimon Marlow2008-11-211-5/+6
|
* round the size up to a page in mmapForLinker() instead of in the callerSimon Marlow2008-11-201-15/+18
|
* error message wibbleSimon Marlow2008-11-201-1/+1
|
* Fix 32-bit breakageSimon Marlow2008-11-191-1/+1
|
* Add optional eager black-holing, with new flag -feager-blackholingSimon Marlow2008-11-181-0/+1
| | | | | | | | | | | | | | | Eager blackholing can improve parallel performance by reducing the chances that two threads perform the same computation. However, it has a cost: one extra memory write per thunk entry. To get the best results, any code which may be executed in parallel should be compiled with eager blackholing turned on. But since there's a cost for sequential code, we make it optional and turn it on for the parallel package only. It might be a good idea to compile applications (or modules) with parallel code in with -feager-blackholing. ToDo: document -feager-blackholing.
* fix compile breakage on WindowsSimon Marlow2008-11-171-0/+2
|
* Attempt to fix #2512 and #2063; add +RTS -xm<address> -RTS optionSimon Marlow2008-11-171-34/+114
| | | | | | | | | | | | | | | | | On x86_64, the RTS needs to allocate memory in the low 2Gb of the address space. On Linux we can do this with MAP_32BIT, but sometimes this doesn't work (#2512) and other OSs don't support it at all (#2063). So to work around this: - Try MAP_32BIT first, if available. - Otherwise, try allocating memory from a fixed address (by default 1Gb) - We now provide an option to configure the address to allocate from. This allows a workaround on machines where the default breaks, and also provides a way for people to test workarounds that we can incorporate in future releases.
* lookupSymbol: revert to looking up both with and without the @N suffixSimon Marlow2008-11-131-23/+40
|
* Always zap the trailing @N from symbols when looking up in a DLLSimon Marlow2008-11-121-3/+4
| | | | | | | | Fixes win32002(ghci) Previously we only did this for references from object files, but we should do it for all symbols, including those that GHCi looks up due to FFI calls from bytecode.
* Run sparks in batches, instead of creating a new thread for each oneSimon Marlow2008-11-061-0/+1
| | | | | Signficantly reduces the overhead for par, which means that we can make use of paralellism at a much finer granularity.
* Rename symbol macros to a consistant naming schemeClemens Fruhwirth2008-10-131-604/+620
|
* add readTVarIO :: TVar a -> IO aSimon Marlow2008-10-101-0/+1
|
* Fix a warningSimon Marlow2008-09-161-1/+1
|
* Stop using mremap() to allocate space for trampolinesSimon Marlow2008-09-151-35/+25
| | | | | | | | | | | | | | | | | This was causing problems because sometimes mremap() moved the memory we had allocated from the low 2Gb to above the 2Gb boundary, causing some linkages to fail. There's no MAP_32BIT flag to mremap(). So now we just use mmap(MAP_ANON|MAP_32BIT) to allocated space for the trampolines. People without MAP_32BIT (eg. *BSD) will still have to do something else here, such as allocating memory from a fixed address; so I've made it slightly easier for those guys, but there's still work to do (#2063). One solution (that Simon PJ is advocating) is to turn on -fPIC by default on x86-64. This is a good solution as it removes the need for MAP_32BIT, but doesn't work with -fvia-C, so probably this is for later.
* FIX BUILD on non-WindowsSimon Marlow2008-09-081-4/+5
|
* Windows: print an error message in addDLLSimon Marlow2008-09-031-8/+20
| | | | | | | | Also, look for libXXX.dll in addition to XXX.dll (see #1883, this isn't really a proper fix, but it'll help in some cases). And I tidied up the error message for a DLL load failure, though it's still a bit of a mess because addDLL is supposed to return a (static) string with the error message, but this isn't possible on Windows.
* 2nd try: remove lochash, it isn't needed (now)Simon Marlow2008-08-041-35/+0
|
* FIX BUILD on WindowsSimon Marlow2008-08-041-4/+0
|
* UNDO: FIX #2375: remove oc->lochash completely, it apparently isn't usedSimon Marlow2008-08-041-0/+35
|
* workaround #2277: turn off the RTS timer when calling into editlineSimon Marlow2008-07-301-0/+2
|
* FIX #2375: remove oc->lochash completely, it apparently isn't usedSimon Marlow2008-07-301-35/+0
|
* use RTLD_LAZY instead of RTLD_NOWSimon Marlow2008-07-241-1/+3
| | | | | | | RTLD_NOW apparently causes some problems, according to previous mailing-list discussion http://www.haskell.org/pipermail/cvs-ghc/2007-September/038570.html
* debug output tweakSimon Marlow2008-07-241-1/+1
|
* add NetBSD to some of the #ifdefs (patch partly from 6.8 branch)Simon Marlow2008-07-141-2/+2
|
* add threadStatus# primop, for querying the status of a ThreadId#Simon Marlow2008-07-101-0/+1
|
* add new primop: asyncExceptionsBlocked# :: IO BoolSimon Marlow2008-07-091-0/+1
|
* FIX part of #2301, and #1619Simon Marlow2008-07-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 2301: Control-C now causes the new exception (AsyncException UserInterrupt) to be raised in the main thread. The signal handler is set up by GHC.TopHandler.runMainIO, and can be overriden in the usual way by installing a new signal handler. The advantage is that now all programs will get a chance to clean up on ^C. When UserInterrupt is caught by the topmost handler, we now exit the program via kill(getpid(),SIGINT), which tells the parent process that we exited as a result of ^C, so the parent can take appropriate action (it might want to exit too, for example). One subtlety is that we have to use a weak reference to the ThreadId for the main thread, so that the signal handler doesn't prevent the main thread from being subject to deadlock detection. 1619: we now ignore SIGPIPE by default. Although POSIX says that a SIGPIPE should terminate the process by default, I wonder if this decision was made because many C applications failed to check the exit code from write(). In Haskell a failed write due to a closed pipe will generate an exception anyway, so the main difference is that we now get a useful error message instead of silent program termination. See #1619 for more discussion.
* Fix conversions between Double/Float and simple-integerIan Lynagh2008-06-141-0/+2
|
* when linking, ignore unknown .reloc section that appeared in gcc 3.4.5(?)dias@eecs.harvard.edu2008-05-281-0/+2
|
* Add some more generic (en|de)code(Double|Float) codeIan Lynagh2008-04-171-0/+3
|
* FIX BUILD (bootstrap with -fvia-C): prototype fixesSimon Marlow2008-04-091-4/+4
|