summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Make GHCi & TH work when the compiler is built with -profSimon Marlow2015-11-0758-235/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Amazingly, there were zero changes to the byte code generator and very few changes to the interpreter - mainly because we've used good abstractions that hide the differences between profiling and non-profiling. So that bit was pleasantly straightforward, but there were a pile of other wibbles to get the whole test suite through. Note that a compiler built with -prof is now like one built with -dynamic, in that to use TH you have to build the code the same way. For dynamic, we automatically enable -dynamic-too when TH is required, but we don't have anything equivalent for profiling, so you have to explicitly use -prof when building code that uses TH with a profiled compiler. For this reason Cabal won't work with TH. We don't expect to ship a profiled compiler, so I think that's OK. Test Plan: validate with GhcProfiled=YES in validate.mk Reviewers: goldfire, bgamari, rwbarton, austin, hvr, erikd, ezyang Reviewed By: ezyang Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1407 GHC Trac Issues: #4837, #545
* Call Arity: In "e x", the result of "x" is not sharedJoachim Breitner2015-11-061-5/+15
| | | | | | | | | | | | | | | | | | | | in contrast to "e (f x)", where CorePrep will turn it into "let y = f x in e x". So in let f = ... in e (f x) we know that f is called at most once, but in let f = ... in e f we do not know that. Previously Call Arity would assume that in "e x", "x" is evaluated at most once. This rarely would make a difference (the argument "x" is analized with an incoming arity of 0, so no eta-expansion would be done anyways), but of course this should still be fixed. This fixes #11064. Note the corresponding code dmdTransformThunkDmd in DmdAnal.
* Linker: #ifdef cleanupErik de Castro Lopo2015-11-042-45/+14
| | | | | | | | | | | | | Test Plan: - Run tests on x86_64/linux and powerpc/linux - Cross compile rts/Linker.c with the i686-w64-mingw32-gcc and x86_64-w64-mingw32-gcc Linux to Windows cross-compilers. Reviewers: bgamari, austin, hvr, Phyx Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1429
* Use full name of LLVM program in error messageErik de Castro Lopo2015-11-042-2/+2
| | | | | | | | | | | | Previously something like `/usr/bin/opt-3.7` was being shortened to `opt-3` using the `takeBaseName` function. This shortened form is actually not correct. We should use `takeFileName` instead. Reviewers: bgamari, austin, hvr Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1420
* Tweak settings for LLVM testsErik de Castro Lopo2015-11-041-2/+2
| | | | | | | | | | | | | | * The LLVM backend does not currently work on PowerPC so disable it. * Only run LLVM tests if the needed LLVM tools have been detected at configure time. Test Plan: Run LLVM tests on x86_64 and powerpc Reviewers: austin, bgamari, hvr, thomie Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1421
* Cabal-level sanity check to enforce Cabal flag-invariantHerbert Valerio Riedel2015-11-031-0/+5
| | | | | | | | | | This helps catch cabal-flag misconfiguration early on during `cabal configure`, rather than much later in the build-process during compilation. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1423
* Build system: renable -Wall on validate (base)Thomas Miedema2015-11-035-6/+10
| | | | | | | | | | | | | | | | Problem: 'SRC_HC_OPTS += -Wall' in 'mk/warnings.mk' was getting overwritten by 'SRC_HC_OPTS = ...' in 'mk/flavours/*.mk'. It didn't affect the compiler or most other libraries, because most .cabal files define 'ghc-options: -Wall'. Bug introduced in commit 2c24fd707f8650205bb574ffac5f376239af3723, when moving validate settings from 'mk/validate-settings.mk' to 'mk/flavours/validate.mk'. Reviewed By: austin Differential Revision: https://phabricator.haskell.org/D1425
* rts/Hash: Constify HashTable* in lookupHashTableBen Gamari2015-11-033-8/+8
| | | | | | | | This seems like an obvious place to apply `const` Reviewed By: simonmar, austin Differential Revision: https://phabricator.haskell.org/D1416
* Add `MonadPlus IO` and `Alternative IO` instancesHerbert Valerio Riedel2015-11-035-4/+19
| | | | | | | | | | | | This requires adding a new primitive `mplusIO` to `GHC.IO` Update transformers submodule to accomodate extant orphan instances. Reviewed By: austin, bgamari Differential Revision: https://phabricator.haskell.org/D1148 GHC Trac Issues: #10755
* base: Add new Control.Monad.Fail module (re #10751)Herbert Valerio Riedel2015-11-034-0/+86
| | | | | | | | | | | | | | | | | This is based on David's initial patch augmented by more extensive Haddock comments. This has been broken out of D1248 to reduce its size by splitting the patch into smaller logical pieces. On its own, this new module does nothing interesting yet. Later patches will add support for a different desugaring of `do`-blocks, at which point the new `MonadFail` class will become more useful. Reviewed By: ekmett, austin Differential Revision: https://phabricator.haskell.org/D1424
* base: Add changelog entry for 4.8.2.0Ben Gamari2015-11-021-0/+10
|
* base: GHC.RTS.Flags symbols really were introduced in 4.8.2Ben Gamari2015-11-021-6/+6
|
* base: Update `@since 4.8.2` annotations (re #11026)Herbert Valerio Riedel2015-11-027-18/+18
| | | | This missed to perform in f8ba4b55cc3a061458f5cfabf17de96128defbbb
* Update filepath submodule for proper versionHerbert Valerio Riedel2015-11-021-0/+0
| | | | | This pulls in a minor version bump to v1.4.1, this way GHC HEAD nightly builds report a proper version number.
* get rid of Elf32/Elf64_Section as this is a non-portable Linux-ism.Karel Gardas2015-11-021-3/+1
| | | | | | | | | | | | | | | | Summary: D1357 introduces usage of Elf32_Section/Elf64_Section in RTS linker code. Unfortunately this is a non-portable Linux-ism and such types are not defined anywhere except the Linux-land probably. I've checked Solaris 11.2, Solaris 11.3, FreeBSD 10.1, NetBSD 6.1.5 and OpenBSD current. The fix is easy to use `unsigned short' as this is also an underlying type of those Elf*_Section defines in Linux. Reviewers: olsner, austin, bgamari, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1419
* Update process submodule to process-1.4 releaseHerbert Valerio Riedel2015-11-027-4/+4
| | | | | We already used a process-1.4 snapshot with non-bumped version, so this commit is mostly a `.cabal` file upper-bound relaxation change.
* rts: Produce stack trace on fatal errorBen Gamari2015-11-011-0/+12
| | | | | | | | | | | | Test Plan: Validate Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: simonmar, thomie, scpmw Differential Revision: https://phabricator.haskell.org/D1418
* EventLog: Loop fwrite if necessary during flushBen Gamari2015-11-011-10/+12
| | | | | | | | | | | | | | | | | | | | | Previously the eventlog flush code would fail if `fwrite` wrote less than the requested amount. Like all Unix stream I/O operations, however, `fwrite` isn't guaranteed to write the entire buffer. Here we loop as long as `fwrite` succeeds in writing anything. Fixes #11041. Test Plan: Validate with eventlog Reviewers: austin, simonmar Reviewed By: simonmar Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1415 GHC Trac Issues: #11041
* Change sphinx for documentation building on windows to the python3 versionTamar Christina2015-11-011-11/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Python 3 seems to have fixed the long standing codepage issue with python on Windows. To be able to reliably build the documentation we should use the Python 3 version of Sphinx. See `https://docs.python.org/dev/whatsnew/3.3.html#codecs` and `https://bugs.python.org/issue13216`. Sphinx also supports Python 3. Oddly enough `python3-sphinx` is registered as `sphinx-build.exe` instead of `sphinx-build3.exe`, so the changes in `configure.ac` can be reverted. install with `pacman -S mingw-w64-$(uname -m)-python3-sphinx` Test Plan: ./validate Reviewers: austin, thomie, bgamari Reviewed By: bgamari Subscribers: erikd Differential Revision: https://phabricator.haskell.org/D1417 GHC Trac Issues: #11021
* Minor simplification in unariser pass:Ömer Sinan Ağacan2015-11-011-13/+11
| | | | | | | | | | | | | | | | | We don't need to update StgCase's AltType, because it's already set correctly in `CoreToStg.mkStgAltType`, so we can just remove extra argument passing and return values. (I think this is a useful refactoring because it makes it clear that we don't need to update AltTypes) Reviewers: austin, bgamari, simonpj Reviewed By: bgamari, simonpj Subscribers: simonpj, thomie Differential Revision: https://phabricator.haskell.org/D1403
* Libdw: Fix symbol namingBen Gamari2015-11-014-48/+49
| | | | RTS convention is to use camel-case.
* Dwarf.Constants: Introduce Haddock sectionsBen Gamari2015-11-011-8/+8
|
* Libdw: Remove special treatment for stg_stop_threadBen Gamari2015-11-011-4/+1
| | | | | This is no longer necessary since this symbol can be unwound through with its DWARF information.
* StgStartup: Setup unwinding for stg_stop_threadBen Gamari2015-11-012-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a bit ugly as we need to assume the structure of the C stack as left by StgRun. Nevertheless, it allows us to unwind all the way back to `_start` on my machine. ``` Stack trace: set_initial_registers (rts/Libdw.c:272.0) dwfl_thread_getframes dwfl_getthreads dwfl_getthread_frames libdw_get_backtrace (rts/Libdw.c:243.0) base_GHCziExecutionStack_getStackTrace1_info (libraries/base/GHC/ExecutionStack.hs:43.1) base_GHCziExecutionStack_showStackTrace1_info (libraries/base/GHC/ExecutionStack.hs:47.1) base_GHCziBase_bindIO1_info (libraries/base/GHC/Base.hs:1085.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) base_GHCziBase_thenIO1_info (libraries/base/GHC/Base.hs:1088.1) stg_catch_frame_info (rts/Exception.cmm:370.1) stg_stop_thread_info (rts/StgStartup.cmm:42.1) scheduleWaitThread (rts/Schedule.c:465.0) hs_main (rts/RtsMain.c:65.0) __libc_start_main (/tmp/buildd/glibc-2.19/csu/libc-start.c:321.0) _start ```
* cmm: Expose machine's stack and return address registerBen Gamari2015-11-018-1/+31
| | | | | | | | | | We will need to use these to setup proper unwinding information for the stg_stop_thread closure. This pokes a hole in the STG abstraction, exposing the machine's stack pointer register so that we can accomplish this. We also expose a dummy return address register, which corresponds to the register used to hold the DWARF return address. Differential Revision: https://phabricator.haskell.org/D1225
* Dwarf.Types: Fix comment styleBen Gamari2015-11-011-5/+5
|
* Dwarf: Preserve stack pointer registerBen Gamari2015-11-011-1/+11
| | | | | | | | | | | | | | | | | Here we add a `same_value $sp` instruction to our default unwinding rules to ensure that the implicit `$sp = CFA` rule (which `libdw` appears to exhibit on x86_64) doesn't overwrite it (necessary since we don't use $sp to track our call stack). See Phab Diff D1189 for details on how we arrived at this resolution. Reviewers: scpmw, austin, simonmar Reviewed By: austin, simonmar Subscribers: thomie, simonmar Differential Revision: https://phabricator.haskell.org/D1224
* Update Cabal submoduleHerbert Valerio Riedel2015-11-012-5/+1
| | | | | This allows us to remove 4 newly added language pragmas from the T4437 test-case as they were recently added to Cabal 1.23
* DynFlags: -freverse-errors should be defFlagBen Gamari2015-11-011-2/+2
| | | | | This flag works under both GHC and GHCi, as pointed out on D1367. Thanks to @thomie for pointing this out.
* keepCAFsForGHCi was brokenSimon Marlow2015-11-011-2/+2
| | | | | | | | | | | | | | | Buggy Makefile code meant it was always included, instead of being included only for the dyn ways. Test Plan: validate Reviewers: hvr, austin, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1400
* ApiAnnotations: BooleanFormula is not properly LocatedAlan Zimmerman2015-11-017-62/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment BooleanFormula is defined as data BooleanFormula a = Var a | And [BooleanFormula a] | Or [BooleanFormula a] deriving (Eq, Data, Typeable, Functor, Foldable, Traversable) An API Annotation can only be attached to an item of the form Located a. Replace this with a properly Located version, and attach the appropriate API Annotations to it Updates haddock submodule. Test Plan: ./validate Reviewers: austin, bgamari Reviewed By: bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1384 GHC Trac Issues: #11017
* Bump ghc-prim version to 0.5.0.0 (closes #11043)Herbert Valerio Riedel2015-11-0158-64/+64
| | | | | | | | | | | This also needs to update the primitive/vector submodules in order to relax upper bounds on ghc-prim. Like in f8ba4b55cc3a061458f5cfabf17de96128defbbb, a mass-rewrite in testsuite/ via sed -i s,ghc-prim-0.4.0.0,ghc-prim-0.5.0.0,g $(git grep -Fl 'ghc-prim-0.4.0.0') was performed.
* ghc-prim: add API delta as changelog (re #11043)Herbert Valerio Riedel2015-11-012-0/+39
| | | | [skip ci]
* Bump `base` version to 4.9.0.0 (closes #11026)Herbert Valerio Riedel2015-11-0174-83/+83
| | | | | | | | | | | This also relaxes a few upper bounds on base in the ghc.git repo; This required a mass-rewrite in testsuite/ sed -i s,base-4.8.2.0,base-4.9.0.0,g $(git grep -Fl 'base-4.8.2.0') because it turns out the testsuite is still sensitive to package version changes.
* Update hoopl submoduleHerbert Valerio Riedel2015-11-011-0/+0
| | | | | This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0`
* Update unix submoduleHerbert Valerio Riedel2015-11-011-0/+0
| | | | | This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0`
* Update process submoduleHerbert Valerio Riedel2015-11-016-4/+4
| | | | | | | | | | This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0` This also needs to relax a few upper bounds on process in some cabal files (there will be another process submodule update soon, as a major version bump of process' version is still pending)
* Update filepath submoduleHerbert Valerio Riedel2015-11-011-0/+0
| | | | | This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0`
* Update directory submoduleHerbert Valerio Riedel2015-11-011-0/+0
| | | | | This is needed to prepare for #11026 as this update relaxes the upper bounds on `base` to allow for `base-4.9.0.0`
* Update array/stm/hpc/haddock submodulesHerbert Valerio Riedel2015-11-014-0/+0
| | | | | This is needed to prepare for #11026 as these updates relax the upper bounds on `base` to allow for `base-4.9.0.0`
* ghc-prim: Fix hs_ctz64 for powerpcErik de Castro Lopo2015-11-011-1/+1
| | | | | | | | | | | | Test Plan: Test on powerpc/linux Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1413
* Linker: More uint64_t to uintptr_t fixesErik de Castro Lopo2015-11-011-2/+2
| | | | | | | | | | | | | | | Need to use `uintptr_t` on PowerPC and possibly other 32 bit architectures. Test Plan: Validate on x86_64 and powerpc Linux Reviewers: austin, hvr, bgamari Reviewed By: bgamari Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1412
* Enforce linkage with pthread library on OpenBSDKarel Gardas2015-11-012-0/+17
| | | | | | | | | | | | | | | | 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
* rts/posix: Reduce heap allocation amount on mmap failureBen Gamari2015-11-014-12/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since the two-step allocator the RTS asks the kernel for a large upfront mmap'd region of memory (on the order of terabytes). While we have no expectation that this entire region will be backed by physical memory, this scheme nevertheless fails on some systems with resource limits. Here we use a back-off scheme to reduce our allocation request until we find a size agreeable to the kernel. Fixes #10877. This also fixes a latent bug wherein the heap reservation retry logic would fail to free the previously reserved address space, which would likely result in a heap allocation failure. Test Plan: set address space limit with `ulimit -v 67108864` and try running a compiled program Reviewers: simonmar, austin Reviewed By: simonmar Subscribers: thomie, RyanGlScott Differential Revision: https://phabricator.haskell.org/D1405 GHC Trac Issues: #10877
* Provide a utility to check API Annotations docsAlan Zimmerman2015-11-0119-1710/+974
| | | | | | | | | | | | | | | | | | | | | | | A utility to check API Annotations was provided in https://git.haskell.org/ghc.git/commitdiff/43751b2436f370d956d8021b3cdd3 eb77801470b This commit had poor documentation. This patch improves the output generated by the utility as well as supplying better documentation Test Plan: ./validate Reviewers: simonpj, austin, bgamari Reviewed By: austin, bgamari Subscribers: thomie, mpickering Differential Revision: https://phabricator.haskell.org/D1397 GHC Trac Issues: #10917
* Apply WERROR only to stage2 HC optionsBen Gamari2015-11-011-1/+2
| | | | | | | | | | | | | Otherwise validate unnecessarily may fail during the stage1 build when booting with an older compiler. Test Plan: Try it Reviewers: thomie, austin Reviewed By: thomie, austin Differential Revision: https://phabricator.haskell.org/D1390
* Add rts/Linker support for more than 64k sectionsSimon Brenner2015-11-011-39/+141
| | | | | | | | | | | | | | | | | | | Since some ELF fields ran out of range to represent that many sections, they've been extended with magic numbers that indicate that the full value is stored in another field. This will be necessary for GHCi with -split-sections on ELF platforms that don't use GNU ld. Reviewers: austin, bgamari, simonmar, erikd Reviewed By: bgamari, simonmar, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D1357 GHC Trac Issues: #8405
* llvmGen: Really fix build with ClangErik de Castro Lopo2015-11-011-5/+6
| | | | | | | | | | Test Plan: Build with Clang and GCC Reviewers: austin, thomie, hvr, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1414
* llvmGen: Fix build with ClangErik de Castro Lopo2015-11-011-2/+2
| | | | | | | | | | | | | Another weird case of Clang not accepting whitespace in CPP that GCC accepts without a problem. Test Plan: Build with Clang and GCC Reviewers: austin, thomie, hvr, bgamari Reviewed By: bgamari Differential Revision: https://phabricator.haskell.org/D1409
* disable large address space on OpenBSDKarel Gardas2015-10-311-0/+5
| | | | | | | | | | | | | | Summary: This patch disables large address space on OpenBSD. The motivation for this is that OpenBSD does not support MAP_NORESERVE. The flag is supported only for source code compatibility reasons but is otherwise completely ignored by the OS and its mmap syscall. Reviewers: austin, bgamari Subscribers: thomie, erikd Differential Revision: https://phabricator.haskell.org/D1411