summaryrefslogtreecommitdiff
path: root/rts/package.conf.in
Commit message (Collapse)AuthorAgeFilesLines
* configure: Clarify meaning of CabalHaveLibffiBen Gamari2021-09-231-1/+1
| | | | | Previously the meaning of this flag was unclear and as a result I suspect that CabalHaveLibffi could be incorrectly False.
* Introduce stack snapshotting / cloning (#18741)Sven Tennie2021-09-231-0/+2
| | | | | | | | | | | | | | Add `StackSnapshot#` primitive type that represents a cloned stack (StgStack). The cloning interface consists of two functions, that clone either the treads own stack (cloneMyStack) or another threads stack (cloneThreadStack). The stack snapshot is offline/cold, i.e. it isn't evaluated any further. This is useful for analyses as it prevents concurrent modifications. For technical details, please see Note [Stack Cloning]. Co-authored-by: Ben Gamari <bgamari.foss@gmail.com> Co-authored-by: Matthew Pickering <matthewtpickering@gmail.com>
* Add -Wl,-U,___darwin_check_fd_set_overflow to rts/package.conf.inMatthew Pickering2021-08-191-0/+4
| | | | | | | | | The make build system apparently uses this special package.conf rather than generating it from the cabal file. Ticket: #19950 (cherry picked from commit e316a0f3e7a733fac0c30633767487db086c4cd0)
* Move `/includes` to `/rts/include`, sort per package betterJohn Ericson2021-08-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to make the packages in this repo "reinstallable", we need to associate source code with a specific packages. Having a top level `/includes` dir that mixes concerns (which packages' includes?) gets in the way of this. To start, I have moved everything to `rts/`, which is mostly correct. There are a few things however that really don't belong in the rts (like the generated constants haskell type, `CodeGen.Platform.h`). Those needed to be manually adjusted. Things of note: - No symlinking for sake of windows, so we hard-link at configure time. - `CodeGen.Platform.h` no longer as `.hs` extension (in addition to being moved to `compiler/`) so as not to confuse anyone, since it is next to Haskell files. - Blanket `-Iincludes` is gone in both build systems, include paths now more strictly respect per-package dependencies. - `deriveConstants` has been taught to not require a `--target-os` flag when generating the platform-agnostic Haskell type. Make takes advantage of this, but Hadrian has yet to.
* PrimOps: Add CAS op for all int sizesPeter Trommler2021-08-021-4/+0
| | | | | | | | | | | PPC NCG: Implement CAS inline for 32 and 64 bit testsuite: Add tests for smaller atomic CAS X86 NCG: Catch calls to CAS C fallback Primops: Add atomicCasWord[8|16|32|64]Addr# Add tests for atomicCasWord[8|16|32|64]Addr# Add changelog entry for new primops X86 NCG: Fix MO-Cmpxchg W64 on 32-bit arch ghc-prim: 64-bit CAS C fallback on all archs
* rts: Introduce and use ExecPage abstractionBen Gamari2021-07-271-1/+1
| | | | | Here we introduce a very thin abstraction for allocating, filling, and freezing executable pages to replace allocateExec.
* Allocate Adjustors and mark them readable in two stepsMoritz Angermann2021-03-291-1/+1
| | | | | | | | | This drops allocateExec for darwin, and replaces it with a alloc, write, mark executable strategy instead. This prevents us from trying to allocate an executable range and then write to it, which X^W will prohibit on darwin. This will *only* work if we can use mmap.
* AArch64/arm64 adjustmentsMoritz Angermann2020-11-151-1/+1
| | | | | | | | This addes the necessary logic to support aarch64 on elf, as well as aarch64 on mach-o, which Apple calls arm64. We change architecture name to AArch64, which is the official arm naming scheme.
* winio: update lockfile signature and remove mistaken symbol in rts.Tamar Christina2020-07-151-2/+0
|
* winio: Clean up code surrounding IOPort primitives.Andreas Klebinger2020-07-151-0/+4
| | | | | | | | | | | | | | According to phyx these should only be read and written once per object. Not neccesarily in that order. To strengthen that guarantee the primitives will now throw an exception if we violate this invariant. As a consequence we can eliminate some code from their primops. In particular code dealing with multiple queued readers/writers now simply checks the invariant and throws an exception if it was violated. That is in contrast to mvars which will do things like wake up all readers, queue multi writers etc.
* winio: Multiple refactorings and support changes.Tamar Christina2020-07-151-0/+8
|
* winio: Add Atomic Exchange PrimOp and implement Atomic Ptr exchanges.Tamar Christina2020-06-141-0/+8
| | | | | | | The initial version was rewritten by Tamar Christina. It was rewritten in large parts by Andreas Klebinger. Co-authored-by: Andreas Klebinger <klebinger.andreas@gmx.at>
* Fix unboxed-sums GC ptr-slot rubbish value (#17791)Sylvain Henry2020-05-091-2/+0
| | | | | | | This patch allows boot libraries to use unboxed sums without implicitly depending on `base` package because of `absentSumFieldError`. See updated Note [aBSENT_SUM_FIELD_ERROR_ID] in GHC.Core.Make
* Add arithmetic exception primops (#14664)Sylvain Henry2020-02-111-0/+6
|
* Properly account for libdw paths in make build systemBen Gamari2019-11-191-1/+6
| | | | Should finally fix #17255.
* configure: Add --with-libdw-{includes,libraries} flagsBen Gamari2019-11-061-2/+2
| | | | Fixing #17255.
* Per stage headers, ghc_boot_platform.h -> stage 0 ghcplatform.hJohn Ericson2019-10-041-1/+1
| | | | | | | | | | | | | | | | | | The generated headers are now generated per stage, which means we can skip hacks like `ghc_boot_platform.h` and just have that be the stage 0 header as proper. In general, stages are to be embraced: freely generate everything in each stage but then just build what you depend on, and everything is symmetrical and efficient. Trying to avoid stages because bootstrapping is a mind bender just creates tons of bespoke mini-mind-benders that add up to something far crazier. Hadrian was pretty close to this "stage-major" approach already, and so was fairly easy to fix. Make needed more work, however: it did know about stages so at least there was a scaffold, but few packages except for the compiler cared, and the compiler used its own counting system. That said, make and Hadrian now work more similarly, which is good for the transition to Hadrian. The merits of embracing stage aside, the change may be worthy for easing that transition alone.
* Expunge #ifdef and #ifndef from the codebaseJohn Ericson2019-07-141-1/+1
| | | | | | | | These are unexploded minds as far as the linter is concerned. I don't want to hit in my MRs by mistake! I did this with `sed`, and then rolled back some changes in the docs, config.guess, and the linter itself.
* Fix warning that 'hugs-options' isn't supported any moreGabor Greif2018-12-191-1/+0
|
* rts.cabal.in: force inclusion of findPtr/_findPtr symbol only with debug flagAlp Mestanogullari2018-11-221-0/+4
| | | | | | | | | | | | | | | | | The previous strategy caused problems on Windows, as pointed out at [1] [1]: https://phabricator.haskell.org/rGHC900c47f88784#133905 Reviewers: Phyx, bgamari, erikd, simonmar Reviewed By: Phyx Subscribers: rwbarton, carter GHC Trac Issues: #15671 Differential Revision: https://phabricator.haskell.org/D5356
* rts/Printer.c: always define the findPtr symbolAlp Mestanogullari2018-09-121-4/+0
| | | | | | | | | | | | | | | | | | It was previously only defined (and therefore shipped) when DEBUG is defined. This patch defines it regardless of DEBUG. This will help fix hadrian on OS X [1]. [1]: https://github.com/snowleopard/hadrian/issues/614 Test Plan: The error from hadrian#614 is gone Reviewers: bgamari, erikd, simonmar Reviewed By: simonmar Subscribers: rwbarton, carter Differential Revision: https://phabricator.haskell.org/D5138
* Force findPtr to be included in the binarySimon Marlow2018-05-161-0/+10
| | | | | | | | | | | | | | | | | Summary: A better alternative to D4657. Test Plan: ``` cd testsuite/tests/codeGen/should_run ../../../../inplace/bin/ghc-stage2 -debug cgrun001 nm cgrun001 | grep findPtr ``` Reviewers: bgamari, Phyx, erikd Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4683
* rts: export new absentSumFieldError from baseSergei Trofimovich2018-05-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | commit b2ff5dde399cd012218578945ada1d9ff68daa35 "Fix #15038" added new stable closure 'absentSumFieldError_closure' to base package. This closure is used in rts package. Unfortunately the symbol was not explicitly exported and build failed on windows as: ``` "inplace/bin/ghc-stage1" -o ...hsc2hs.exe ... rts/dist/build/libHSrts.a(RtsStartup.o): In function `hs_init_ghc': rts/RtsStartup.c:272:0: error: undefined reference to `base_ControlziExceptionziBase_absentSumFieldError_closure' | 272 | getStablePtr((StgPtr)absentSumFieldError_closure); | ^ ``` This change adds 'absentSumFieldError_closure' to explicit export into libHSbase.def. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Use SPDX syntax in rts/package.conf.inHerbert Valerio Riedel2018-02-071-1/+1
| | | | | | This was an oversight from 2671cccde749ed64129097358f81bff43480cdb9 as it wasn't obvious to assume one would go the trouble to manually construct the pkg-db entries... :-)
* rts: fix filename case for mingw32 targetSergei Trofimovich2017-12-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The failure is visible when we build a cross-compiler from linux to mingw32 as: ``` $ ./configure --host=x86_64-pc-linux-gnu \ --target=x86_64-w64-mingw32 $ make rts/linker/PEi386.c:159:10: error: fatal error: Psapi.h: No such file or directory #include <Psapi.h> ^~~~~~~~~ | 159 | #include <Psapi.h> | ^ ``` The problem here is case-sensitive linux filesystem. On windows it does not matter what case is used for includes and libraries. mingw32 provides all libraries and headers lowercase. This change fixes case for <dbghelp.h>, <psapi.h>, -ldbghelp, -lpsapi. Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Reviewers: bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie, carter Differential Revision: https://phabricator.haskell.org/D4247
* Add stack traces on crashes on WindowsTamar Christina2017-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds the ability to generate stack traces on crashes for Windows. When running in the interpreter this attempts to use symbol information from the interpreter and information we know about the loaded object files to resolve addresses to symbols. When running compiled it doesn't have this information and then defaults to using symbol information from PDB files. Which for now means only files compiled with ICC or MSVC will show traces compiled. But I have a future patch that may address this shortcoming. Also since I don't know how to walk a pure haskell stack, I can for now only show the last entry. I'm hoping to figure out how Apply.cmm works to be able to walk the stalk and give more entries for pure haskell code. In GHCi ``` $ echo main | inplace/bin/ghc-stage2.exe --interactive ./testsuite/tests/rts/derefnull.hs GHCi, version 8.3.20170830: http://www.haskell.org/ghc/ :? for help Ok, 1 module loaded. Prelude Main> Access violation in generated code when reading 0x0 Attempting to reconstruct a stack trace... Frame Code address * 0x77cde10 0xc370229 E:\..\base\dist-install\build\HSbase-4.10.0.0.o+0x190031 (base_ForeignziStorable_zdfStorableInt4_info+0x3f) ``` and compiled ``` Access violation in generated code when reading 0x0 Attempting to reconstruct a stack trace... Frame Code address * 0xf0dbd0 0x40bb01 E:\..\rts\derefnull.run\derefnull.exe+0xbb01 ``` Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3913
* Add ability to produce crash dumps on WindowsTamar Christina2017-10-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's often hard to debug things like segfaults on Windows, mostly because gdb isn't always of use and users don't know how to effectively use it. This patch provides a way to create a crash drump by passing `+RTS --generate-crash-dumps` as an option. If any unhandled exception is triggered a dump is made that contains enough information to be able to diagnose things successfully. Currently the created dumps are a bit big because I include all registers, code and threads information. This looks like ``` $ testsuite/tests/rts/derefnull.run/derefnull.exe +RTS --generate-crash-dumps Access violation in generated code when reading 0000000000000000 Crash dump created. Dump written to: E:\msys64\tmp\ghc-20170901-220250-11216-16628.dmp ``` Test Plan: ./validate Reviewers: austin, hvr, bgamari, erikd, simonmar Reviewed By: bgamari, simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D3912
* Prefer #if defined to #ifdefBen Gamari2017-04-281-10/+10
| | | | Our new CPP linter enforces this.
* Drop dead code in rts/{Prelude.h,package.conf.in}Moritz Angermann2017-03-261-50/+55
| | | | | | | | | | | | | | | The endevor to drop the `-Wl,-u,<sym>` requirement for linking the rts, base, ,... turned out to be less fruitful than I had hoped. However it did turn up a few dead symbols, that are referenced but for which the definition seems to have diminished. Reviewers: austin, rwbarton, geekosaur, erikd, simonmar, bgamari Reviewed By: geekosaur, simonmar Subscribers: thomie, snowleopard Differential Revision: https://phabricator.haskell.org/D3350
* configure: detect whether -lpthreads is necessary for pthreadsBen Gamari2017-02-281-0/+2
| | | | | | | | | | | | | | | Some platforms have pthreads support available without linking against libpthread (and indeed don't even offer a libpthread to link against). One example of this is Android's bionic library. Teach the RTS about this case. Test Plan: Validate while cross-compiling targetting Android on aarch64 Reviewers: simonmar, austin, hvr, erikd, rwbarton Subscribers: danharaj, thomie, erikd, snowleopard Differential Revision: https://phabricator.haskell.org/D3149
* Overhaul of Compact Regions (#12455)Simon Marlow2016-12-071-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit makes various improvements and addresses some issues with Compact Regions (aka Compact Normal Forms). This was the most important thing I wanted to fix. Compaction previously prevented GC from running until it was complete, which would be a problem in a multicore setting. Now, we compact using a hand-written Cmm routine that can be interrupted at any point. When a GC is triggered during a sharing-enabled compaction, the GC has to traverse and update the hash table, so this hash table is now stored in the StgCompactNFData object. Previously, compaction consisted of a deepseq using the NFData class, followed by a traversal in C code to copy the data. This is now done in a single pass with hand-written Cmm (see rts/Compact.cmm). We no longer use the NFData instances, instead the Cmm routine evaluates components directly as it compacts. The new compaction is about 50% faster than the old one with no sharing, and a little faster on average with sharing (the cost of the hash table dominates when we're doing sharing). Static objects that don't (transitively) refer to any CAFs don't need to be copied into the compact region. In particular this means we often avoid copying Char values and small Int values, because these are static closures in the runtime. Each Compact# object can support a single compactAdd# operation at any given time, so the Data.Compact library now enforces mutual exclusion using an MVar stored in the Compact object. We now get exceptions rather than killing everything with a barf() when we encounter an object that cannot be compacted (a function, or a mutable object). We now also detect pinned objects, which can't be compacted either. The Data.Compact API has been refactored and cleaned up. A new compactSize operation returns the size (in bytes) of the compact object. Most of the documentation is in the Haddock docs for the compact library, which I've expanded and improved here. Various comments in the code have been improved, especially the main Note [Compact Normal Forms] in rts/sm/CNF.c. I've added a few tests, and expanded a few of the tests that were there. We now also run the tests with GHCi, and in a new test way that enables sanity checking (+RTS -DS). There's a benchmark in libraries/compact/tests/compact_bench.hs for measuring compaction speed and comparing sharing vs. no sharing. The field totalDataW in StgCompactNFData was unnecessary. Test Plan: * new unit tests * validate * tested manually that we can compact Data.Aeson data Reviewers: gcampax, bgamari, ezyang, austin, niteria, hvr, erikd Subscribers: thomie, simonpj Differential Revision: https://phabricator.haskell.org/D2751 GHC Trac Issues: #12455
* Install toplevel handler inside fork.Alexander Vershilov2016-12-021-0/+2
| | | | | | | | | | | | | | | | | | | | When rts is forked it doesn't update toplevel handler, so UserInterrupt exception is sent to Thread1 that doesn't exist in forked process. We install toplevel handler when fork so signal will be delivered to the new main thread. Fixes #12903 Reviewers: simonmar, austin, erikd, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2770 GHC Trac Issues: #12903
* Hopefully fix build on OS XSimon Marlow2016-11-151-40/+28
| | | | | | | | | | | | | | | | Summary: It looks like I broke the OS X build with 55d535da10dd, hopefully this should fix it. Test Plan: Harbourmaster Reviewers: austin, bgamari, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2705 GHC Trac Issues: #12455
* rts: Fix build when linked with goldBen Gamari2016-11-111-11/+2
| | | | | | | | | | | | | | | | | | As reported in #12812, the runtime system fails to build when linked with gold due to a missing dependency on libpthread. Additionally, rts/package.conf.in uses the WORD_SIZE_IN_BITS macro defined by MachDeps.h, which it does not #include. Fix this. Test Plan: Validate with gold linker Reviewers: hsyl20, austin, erikd, simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2695 GHC Trac Issues: #12816
* rts/package.conf.in: Fix CPP usageErik de Castro Lopo2016-10-231-1/+1
| | | | | | | | | | | | | | | | | Summary: The configure script sets `HAVE_LIBNUMA` to either `0` or `1` but this file had `#ifdef HAVE_LIBNUMA`. This surfaced as a side-effect of 1050e46b5b. CPP is really hard to get right. Test Plan: Validate on harbourmaster Reviewers: simonmar, bgamari, austin, mpickering Reviewed By: mpickering Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2631
* Add hs_try_putmvar()Simon Marlow2016-09-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a fast, non-blocking, asynchronous, interface to tryPutMVar that can be called from C/C++. It's useful for callback-based C/C++ APIs: the idea is that the callback invokes hs_try_putmvar(), and the Haskell code waits for the callback to run by blocking in takeMVar. The callback doesn't block - this is often a requirement of callback-based APIs. The callback wakes up the Haskell thread with minimal overhead and no unnecessary context-switches. There are a couple of benchmarks in testsuite/tests/concurrent/should_run. Some example results comparing hs_try_putmvar() with using a standard foreign export: ./hs_try_putmvar003 1 64 16 100 +RTS -s -N4 0.49s ./hs_try_putmvar003 2 64 16 100 +RTS -s -N4 2.30s hs_try_putmvar() is 4x faster for this workload (see the source for hs_try_putmvar003.hs for details of the workload). An alternative solution is to use the IO Manager for this. We've tried it, but there are problems with that approach: * Need to create a new file descriptor for each callback * The IO Manger thread(s) become a bottleneck * More potential for things to go wrong, e.g. throwing an exception in an IO Manager callback kills the IO Manager thread. Test Plan: validate; new unit tests Reviewers: niteria, erikd, ezyang, bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2501
* Add atomic operations to package.conf.inalexbiehl2016-07-301-0/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch resulted from the discussion in D2431 and should be merged first. @erikd and @trommler reported errors like ``` /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o ): In function `c14_info': (.text+0x2b8): undefined reference to `hs_cmpxchg32' /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o ): In function `c5e_info': (.text+0xac4): undefined reference to `hs_cmpxchg32' /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o ): In function `c8b_info': (.text+0x1198): undefined reference to `hs_cmpxchg32' /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o ): In function `c8b_info': (.text+0x122c): undefined reference to `hs_cmpxchg32' /home/erikd/Git/ghc-upstream/rts/dist/build/libHSrts_thr.a(PrimOps.thr_o ): In function `c8b_info': (.text+0x12ec): undefined reference to `hs_cmpxchg32' ``` on PowerPC. @simonmar suggests to add the specific exports to `rts/package.conf.in`. This patch does exactly that, including all other atomic ops as they probably (maybe someone can verify?) suffer from the same problem on PPC. Test Plan: Please make sure to build on PPC. Reviewers: erikd, austin, bgamari, simonmar, trommler Reviewed By: erikd, trommler Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2435
* NUMA supportSimon Marlow2016-06-101-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The aim here is to reduce the number of remote memory accesses on systems with a NUMA memory architecture, typically multi-socket servers. Linux provides a NUMA API for doing two things: * Allocating memory local to a particular node * Binding a thread to a particular node When given the +RTS --numa flag, the runtime will * Determine the number of NUMA nodes (N) by querying the OS * Assign capabilities to nodes, so cap C is on node C%N * Bind worker threads on a capability to the correct node * Keep a separate free lists in the block layer for each node * Allocate the nursery for a capability from node-local memory * Allocate blocks in the GC from node-local memory For example, using nofib/parallel/queens on a 24-core 2-socket machine: ``` $ ./Main 15 +RTS -N24 -s -A64m Total time 173.960s ( 7.467s elapsed) $ ./Main 15 +RTS -N24 -s -A64m --numa Total time 150.836s ( 6.423s elapsed) ``` The biggest win here is expected to be allocating from node-local memory, so that means programs using a large -A value (as here). According to perf, on this program the number of remote memory accesses were reduced by more than 50% by using `--numa`. Test Plan: * validate * There's a new flag --debug-numa=<n> that pretends to do NUMA without actually making the OS calls, which is useful for testing the code on non-NUMA systems. * TODO: I need to add some unit tests Reviewers: erikd, austin, rwbarton, ezyang, bgamari, hvr, niteria Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2199
* Fix detection and use of `USE_LIBDW`Erik de Castro Lopo2016-06-011-1/+1
| | | | | | | | | | | | Test Plan: Configure/build with and without --enable-libdw Reviewers: trofi, hvr, austin, simonmar, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2276
* rts: Kill PAPI supportBen Gamari2015-11-181-6/+3
| | | | | | | | | | | | | | | This hasn't been used for a very long time and will soon be superceded by perf_events support. Test Plan: validate Reviewers: austin, simonmar Reviewed By: austin, simonmar Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1493
* Enforce linkage with pthread library on OpenBSDKarel Gardas2015-11-011-0/+8
| | | | | | | | | | | | | | | | This patch enforces linkage with pthread library on OpenBSD. This is done in order to avoid linker errors when linking with libffi which requires POSIX threading but itself is not linked with libpthread directly. So client binaries (of libffi) needs to link against libpthread explicitly Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1410
* Libdw: Add libdw-based stack unwindingBen Gamari2015-10-171-0/+4
| | | | | | | | | | | | | | | | | | | | | This adds basic support to the RTS for DWARF-assisted unwinding of the Haskell and C stack via libdw. This only adds the infrastructure; consumers of this functionality will be introduced in future diffs. Currently we are carrying the initial register collection code in Libdw.c but this will eventually make its way upstream to libdw. Test Plan: See future patches Reviewers: Tarrasch, scpmw, austin, simonmar Reviewed By: austin, simonmar Subscribers: simonmar, thomie, erikd Differential Revision: https://phabricator.haskell.org/D1196 GHC Trac Issues: #10656
* Update Cabal to HEAD, IPID renamed to Component ID.Edward Z. Yang2015-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains a Cabal submodule update which unifies installed package IDs and package keys under a single notion, a Component ID. We update GHC to keep follow this unification. However, this commit does NOT rename installed package ID to component ID and package key to unit ID; the plan is to do that in a companion commit. - Compiler info now has "Requires unified installed package IDs" - 'exposed' is now expected to contain unit keys, not IPIDs. - Shadowing is no more. We now just have a very simple strategy to deal with duplicate unit keys in combined package databases: if their ABIs are the same, use the latest one; otherwise error. Package databases maintain the invariant that there can only be one entry of a unit ID. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, austin, bgamari, hvr, goldfire Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1184 GHC Trac Issues: #10714
* compiler: fix trac issue #9817Marios Titas2014-12-101-2/+2
| | | | | | | | | | | | | | | | | | | Summary: When we call runHandlers, we must pass it a ForeignPtr. To ensure that this happens, we introduce a wrapper that receives a plain Ptr and converts it into a ForeignPtr. Then we adjust startSignalHandlers in rts/posix/Signals.c to call the wrapper instead of calling runHandlers directly. Reviewers: hvr, austin, rwbarton, simonmar Reviewed By: austin, simonmar Subscribers: simonmar, thomie, carter Differential Revision: https://phabricator.haskell.org/D515 GHC Trac Issues: #9817
* Per-thread allocation counters and limitsSimon Marlow2014-11-121-0/+2
| | | | | | | | This reverts commit f0fcc41d755876a1b02d1c7c79f57515059f6417. New changes: now works on 32-bit platforms too. I added some basic support for 64-bit subtraction and comparison operations to the x86 NCG.
* Revert "Rename _closure to _static_closure, apply naming consistently."Edward Z. Yang2014-10-201-36/+36
| | | | | | | This reverts commit 35672072b4091d6f0031417bc160c568f22d0469. Conflicts: compiler/main/DriverPipeline.hs
* Rename _closure to _static_closure, apply naming consistently.Edward Z. Yang2014-10-011-36/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In preparation for indirecting all references to closures, we rename _closure to _static_closure to ensure any old code will get an undefined symbol error. In order to reference a closure foobar_closure (which is now undefined), you should instead use STATIC_CLOSURE(foobar). For convenience, a number of these old identifiers are macro'd. Across C-- and C (Windows and otherwise), there were differing conventions on whether or not foobar_closure or &foobar_closure was the address of the closure. Now, all foobar_closure references are addresses, and no & is necessary. CHARLIKE/INTLIKE were not changed, simply alpha-renamed. Part of remove HEAP_ALLOCED patch set (#8199) Depends on D265 Signed-off-by: Edward Z. Yang <ezyang@mit.edu> Test Plan: validate Reviewers: simonmar, austin Subscribers: simonmar, ezyang, carter, thomie Differential Revision: https://phabricator.haskell.org/D267 GHC Trac Issues: #8199
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Raise exceptions when blocked in bad FDs (fixes Trac #4934)Sergei Trofimovich2014-06-081-0/+2
| | | | | | | | | | | | | | | Before the patch any call to 'select()' with 'bad_fd' led to: - unblocking of all threads - hiding exception for 'threadWaitRead bad_fd' The patch fixes both cases in this way: after 'select()' failure we iterate over each blocked descriptor and poll individually to see it's actual status, which is: - READY (move to run queue) - BLOCKED (leave in blocked queue) - INVALID (send an IOErrror exception) Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
* Revert "Per-thread allocation counters and limits"Simon Marlow2014-05-041-2/+0
| | | | | | | | Problems were found on 32-bit platforms, I'll commit again when I have a fix. This reverts the following commits: 54b31f744848da872c7c6366dea840748e01b5cf b0534f78a73f972e279eed4447a5687bd6a8308e