Skip to content
Snippets Groups Projects
  1. Aug 26, 2022
  2. Jul 25, 2022
    • Zubin's avatar
      Fix #21889, GHCi misbehaves with Ctrl-C on Windows · 3bbde957
      Zubin authored and Marge Bot's avatar Marge Bot committed
      On Windows, we create multiple levels of wrappers for GHCi which ultimately
      execute ghc --interactive. In order to handle console events properly, each of
      these wrappers must call FreeConsole() in order to hand off event processing to
      the child process. See #14150.
      
      In addition to this, FreeConsole must only be called from interactive processes (#13411).
      
      This commit makes two changes to fix this situation:
      
      1. The hadrian wrappers generated using `hadrian/bindist/cwrappers/version-wrapper.c` call `FreeConsole`
         if the CPP flag INTERACTIVE_PROCESS is set, which is set when we are generating a wrapper for GHCi.
      2. The GHCi wrapper in `driver/ghci/` calls the `ghc-$VER.exe` executable which is not wrapped rather
         than calling `ghc.exe` is is wrapped on windows (and usually non-interactive, so can't call `FreeConsole`:
      
         Before:
         ghci-$VER.exe calls ghci.exe which calls ghc.exe which calls ghc-$VER.exe
      
         After:
         ghci-$VER.exe calls ghci.exe which calls ghc-$VER.exe
      3bbde957
  3. Apr 06, 2022
    • Ben Gamari's avatar
      Windows/Clang: Build system adaptation · 6be2c5a7
      Ben Gamari authored
      * Bump win32-tarballs to 0.7
      * Move Windows toolchain autoconf logic into separate file
      * Use clang and LLVM utilities as described in #21019
      * Disable object merging as lld doesn't support -r
      * Drop --oformat=pe-bigobj-x86-64 arguments from ld flags as LLD detects
        that the output is large on its own.
      * Drop gcc wrapper since Clang finds its root fine on its own.
      6be2c5a7
  4. Feb 21, 2022
    • Zubin's avatar
      Reinstallable GHC · 7ce1b694
      Zubin authored and Matthew Pickering's avatar Matthew Pickering committed
      This patch allows ghc and its dependencies to be built using a normal
      invocation of cabal-install. Each componenent which relied on generated
      files or additional configuration now has a Setup.hs file.
      
      There are also various fixes to the cabal files to satisfy
      cabal-install.
      
      There is a new hadrian command which will build a stage2 compiler and
      then a stage3 compiler by using cabal.
      
      ```
      ./hadrian/build build-cabal
      ```
      
      There is also a new CI job which tests running this command.
      
      For the 9.4 release we will upload all the dependent executables to
      hackage and then end users will be free to build GHC and GHC executables
      via cabal.
      
      There are still some unresolved questions about how to ensure soundness
      when loading plugins into a reinstalled GHC (#20742) which will be
      tighted up in due course.
      
      Fixes #19896
      7ce1b694
  5. Feb 01, 2021
    • Ryan Scott's avatar
      Add driver/ghci/ghci-wrapper.cabal to .gitignore · 5464845a
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      After commit 55ef3bdc, running `./configure`
      now generates a `driver/ghci/ghci-wrapper.cabal` file from
      `driver/ghci/ghci-wrapper.cabal.in`, which pollutes the `git` tree:
      
      ```
      $ git status
      On branch master
      Your branch is up to date with 'origin/master'.
      
      Untracked files:
        (use "git add <file>..." to include in what will be committed)
              driver/ghci/ghci-wrapper.cabal
      
      nothing added to commit but untracked files present (use "git add" to track)
      ```
      
      Since `driver/ghci/ghci-wrapper.cabal` is autogenerated, the sensible thing to
      do is to add it to `.gitignore`. While I was in town, I also added the standard
      `*.in` file disclaimer to `driver/ghci/ghci-wrapper.cabal.in`.
      
      [ci skip]
      5464845a
  6. Jan 30, 2021
  7. May 27, 2019
    • Moritz Angermann's avatar
      Lowercase windows imports · 4b228768
      Moritz Angermann authored
      While windows and macOS are currently on case-insensitive file
      systems, this poses no issue on those.  When cross compiling from
      linux with a case sensitive file system and mingw providing only
      lowercase headers, this in fact produces an issue.  As such we just
      lowercase the import headers, which should still work fine on a
      case insensitive file system and also enable mingw's headers to
      be usable porperly.
      4b228768
  8. Mar 25, 2019
    • Takenobu Tani's avatar
      Update Wiki URLs to point to GitLab · 3769e3a8
      Takenobu Tani authored and Marge Bot's avatar Marge Bot committed
      This moves all URL references to Trac Wiki to their corresponding
      GitLab counterparts.
      
      This substitution is classified as follows:
      
      1. Automated substitution using sed with Ben's mapping rule [1]
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...
      
      2. Manual substitution for URLs containing `#` index
          Old: ghc.haskell.org/trac/ghc/wiki/XxxYyy...#Zzz
          New: gitlab.haskell.org/ghc/ghc/wikis/xxx-yyy...#zzz
      
      3. Manual substitution for strings starting with `Commentary`
          Old: Commentary/XxxYyy...
          New: commentary/xxx-yyy...
      
      See also !539
      
      [1]: https://gitlab.haskell.org/bgamari/gitlab-migration/blob/master/wiki-mapping.json
      3769e3a8
  9. Mar 06, 2019
    • Ben Gamari's avatar
      Rip out object splitting · 37f257af
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      The splitter is an evil Perl script that processes assembler code.
      Its job can be done better by the linker's --gc-sections flag. GHC
      passes this flag to the linker whenever -split-sections is passed on
      the command line.
      
      This is based on @DemiMarie's D2768.
      
      Fixes Trac #11315
      Fixes Trac #9832
      Fixes Trac #8964
      Fixes Trac #8685
      Fixes Trac #8629
      37f257af
  10. Feb 25, 2018
  11. Oct 26, 2017
  12. Sep 26, 2017
    • Tamar Christina's avatar
      Release console for ghci wrapper · 3ec579d5
      Tamar Christina authored
      Summary:
      It seems the call that caused issues with the gcc wrapper before
      was needed for the ghci wrapper in order for the child process
      to be the one handling console events.
      
      This code slightly refactors the wrappers to make sure only ghci
      calls FreeConsole and nothing else.
      
      Test Plan: ./validate , open ghci.exe press ctrl+c
      
      Reviewers: RyanGlScott, austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, erikd
      
      GHC Trac Issues: #14150
      
      Differential Revision: https://phabricator.haskell.org/D4028
      3ec579d5
  13. Jul 07, 2017
    • Tamar Christina's avatar
      Implement split-sections support for windows. · bd4fdc6a
      Tamar Christina authored
      Summary:
      Initial implementation of split-section on Windows.
      
      This also corrects section namings and uses the platform
      convention of `$` instead of `.` to separate sections.
      
      Implementation is based on @awson's patches to binutils.
      
      Binutils requires some extra help when compiling the libraries
      for GHCi usage. We drop the `-T` and use implicit scripts to amend
      the linker scripts instead of replacing it.
      
      Because of these very large GHCi object files, we need big-obj support,
      which will be added by another patch.
      
      Test Plan: ./validate
      
      Reviewers: awson, austin, bgamari
      
      Subscribers: dfeuer, rwbarton, thomie, snowleopard, #ghc_windows_task_force
      
      GHC Trac Issues: #12913
      
      Differential Revision: https://phabricator.haskell.org/D3383
      bd4fdc6a
  14. Jun 29, 2017
    • Simon Peyton Jones's avatar
      Revert "Remove the Windows GCC driver." · 58c781da
      Simon Peyton Jones authored
      This reverts commit d6cecde5.
      
      The patch broke Simon PJ's Windows build, becuase he didn't
      have (and should not need) a separate msys2 gcc.
      
      Following an exchange on the ghc-devs list, Tamar wrote
      
        Oops, sorry, didn’t notice it because both mine and harbormaster’s
        msys2 have separate GCCs installed as well.
      
        I don’t see an easy fix that would also work for end user Configure
        based cabal installs. So I think I’ll have to go back to the drawing
        board for this one.
      
        You can just leave it reverted.
      58c781da
  15. Jun 17, 2017
    • Tamar Christina's avatar
      Remove the Windows GCC driver. · d6cecde5
      Tamar Christina authored
      Summary:
      This patch drops the GCC driver and instead moves
      the only remaining path that we need to keep for
      backwards compatibility to the settings file.
      
      It also generalizes the code that expands `$TopDir`
      so it can expand it within any location in the string
      and also changes it so `$TopDir` is expanded only
      after the words call because `$TopDir` can contains
      spaces which would be horribly broken.
      
      Test Plan: ./validate
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, erikd
      
      GHC Trac Issues: #13709
      
      Differential Revision: https://phabricator.haskell.org/D3592
      d6cecde5
  16. Jun 08, 2017
  17. Apr 29, 2017
  18. Apr 23, 2017
  19. Apr 06, 2017
  20. Mar 14, 2017
    • Tamar Christina's avatar
      Fix Windows GCC driver · 4b673e80
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      In Windows 10 Insiders build 15019+ which will probably be released
      mainstream somewhere this year Microsoft seems to have started being
      stricter with API calls.
      
      The call to `FreeConsole` just after `CreateProcess` is making Windows
      treat the process
      as an interactive process. In which case it tries to use the `Desktop
      session` but fails resulting
      in the cryptic error reported.
      
      I don't understand why the call to `FreeConsole` was there and it
      doesn't seem to be needed,
      so removed.
      
      This fixes #13411
      
      Test Plan: ./validate, alternative just do anything with ghc which
      requires compilation.
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D3319
      4b673e80
  21. Jan 10, 2017
    • dobenour's avatar
      Don't use the splitter on Darwin · 266a9dc4
      dobenour authored and Ben Gamari's avatar Ben Gamari committed
      Test Plan: GHC CI
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2879
      266a9dc4
    • Ryan Scott's avatar
      Properly detect MinTTY when running GHCi on Windows · 6fe9b057
      Ryan Scott authored
      Before, we detecting the presence of MinTTY on Windows in a very
      imprecise way: by checking if the `_` environment variable was set. Not
      only is this easy to circumvent, but it also yields false positives on
      terminals like ConEmu.
      
      This changes the test to use the `GetFileInformationByHandleEx` function
      instead, which provides a far more accurate check for MinTTY's presence.
      I've tested this on PowerShell, MSYS2, Cygwin, ConEmu, and Git Bash, and
      it does the right thing on each one.
      
      Fixes #12958.
      
      Test Plan: Run GHCi on many different Windows and MinTTY consoles
      
      Reviewers: erikd, Phyx, austin, bgamari
      
      Reviewed By: Phyx, bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2878
      
      GHC Trac Issues: #12958
      6fe9b057
  22. Dec 10, 2016
    • Tamar Christina's avatar
      Automate GCC driver wrapper · 490b9429
      Tamar Christina authored
      Summary:
      Everytime we upgrade the GCC version this wrapper needed updating.
      This is a big fragile and we kept forgetting it.
      
      Instead automate it so we don't have to worry about it.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, #ghc_windows_task_force
      
      Differential Revision: https://phabricator.haskell.org/D2820
      
      GHC Trac Issues: #12871
      490b9429
  23. Dec 08, 2016
  24. Nov 29, 2016
  25. May 24, 2016
    • seraphime's avatar
      Fix: #12084 deprecate old profiling flags · 1956cbf1
      seraphime authored and Thomas Miedema's avatar Thomas Miedema committed
      Change help message so it doesn't specify -auto-all.
      Make old profiling flags deprecated as they are no longer
      documented.
      Update Makefile and documentation accordingly.
      Update release notes for ghc 8.2
      
      Test Plan:
      ./verify; `ghc --help` shouldn't specify the -auto-all
      flag. Furthermore `ghc -fprof -auto-all` should emit a warning
      
      Reviewed By: thomie, austin
      
      Differential Revision: https://phabricator.haskell.org/D2257
      
      GHC Trac Issues: #12084
      
      Update submodule nofib
      1956cbf1
  26. Jan 06, 2016
  27. Nov 12, 2015
    • olsner's avatar
      Implement function-sections for Haskell code, #8405 · 4a32bf92
      olsner authored and Ben Gamari's avatar Ben Gamari committed
      This adds a flag -split-sections that does similar things to
      -split-objs, but using sections in single object files instead of
      relying on the Satanic Splitter and other abominations. This is very
      similar to the GCC flags -ffunction-sections and -fdata-sections.
      
      The --gc-sections linker flag, which allows unused sections to actually
      be removed, is added to all link commands (if the linker supports it) so
      that space savings from having base compiled with sections can be
      realized.
      
      Supported both in LLVM and the native code-gen, in theory for all
      architectures, but really tested on x86 only.
      
      In the GHC build, a new SplitSections variable enables -split-sections
      for relevant parts of the build.
      
      Test Plan: validate with both settings of SplitSections
      
      Reviewers: dterei, Phyx, austin, simonmar, thomie, bgamari
      
      Reviewed By: simonmar, thomie, bgamari
      
      Subscribers: hsyl20, erikd, kgardas, thomie
      
      Differential Revision: https://phabricator.haskell.org/D1242
      
      GHC Trac Issues: #8405
      4a32bf92
  28. Aug 21, 2015
    • Thomas Miedema's avatar
      Build system: simplify install.mk.in · 47493e60
      Thomas Miedema authored
      This will allow fixing #1851 more easily
      ("make install-strip" should work).
      
      This reverts 57e2a81c:
        "On Cygwin, use a Cygwin-style path for /bin/install's destination"
      
      Update submodule haddock and hsc2hs.
      47493e60
  29. Aug 12, 2015
    • Tamar Christina's avatar
      Upgrade GCC to 5.2.0 for Windows x86 and x86_64 · 7b211b4e
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      This patch does a few things
      
      - Moved GHC x86 to MinGW-w64 (Using Awson's patch)
      - Moves Both GHCs to MSYS2 toolchains
      - Completely removes the dependencies on the git tarball repo
        - Downloads only the required tarball for the architecture for
          which we are building
        - Downloads the perl tarball is missing as well
        - Fixed a few bugs in the linker to fix tests on Windows
      
      The links currently point to repo.msys2.org and GitHub, it might be
      more desirable to mirror them on
      http://downloads.haskell.org/~ghc/mingw/ as with the previous patch
      attempt.
      
      For more details on what the MSYS2 packages I include see #10726
      (Awson's comment). but it should contain all we need
      and no python or fortran, which makes the uncompressed tar a 1-2
      hundreds mb smaller.
      
      The `GCC 5.2.0` in the package supports `libgcc` as a shared library,
      this is a problem since
      when compiling with -shared the produced dll now has a dependency on
      `libgcc_s_sjlj-1.dll`.
      To solve this the flag `-static-libgcc` is now being used for all GCC
      calls on windows.
      
      Test Plan:
      ./validate was ran both on x86 and x86_64 windows and compared against
      the baseline.
      
      A few test were failing due to Ld no longer being noisy. These were
      updated.
      
      The changes to the configure script *should* be validated by the build
      bots for the other platforms before landing
      
      Reviewers: simonmar, awson, bgamari, austin, thomie
      
      Reviewed By: thomie
      
      Subscribers: #ghc_windows_task_force, thomie, awson
      
      Differential Revision: https://phabricator.haskell.org/D1123
      
      GHC Trac Issues: #10726, #9014, #9218, #10435
      7b211b4e
  30. Nov 30, 2014
  31. Oct 20, 2014
  32. Oct 07, 2014
  33. Oct 02, 2014
    • Edward Z. Yang's avatar
      Rename _closure to _static_closure, apply naming consistently. · 35672072
      Edward Z. Yang authored
      
      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: default avatarEdward 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
      35672072
  34. Jul 28, 2014
  35. Jul 03, 2014
    • Jan Stolarek's avatar
      Update documentation · 311c55d1
      Jan Stolarek authored
        * fix links to the User's Guide in ghc and ghci --help messages
        * fix default stack size info in RTS help message
      311c55d1
  36. Mar 21, 2014
  37. Oct 01, 2013
  38. Sep 23, 2013
  39. Sep 04, 2013
Loading