1. 09 Mar, 2019 1 commit
    • Ben Gamari's avatar
      Rip out perl dependency · b760269c
      Ben Gamari authored
      The object splitter was the last major user of perl. There remain a few
      uses in nofib but we can just rely on the system's perl for this since
      it's not critical to the build.
      b760269c
  2. 06 Mar, 2019 1 commit
    • Ben Gamari's avatar
      Rip out object splitting · 37f257af
      Ben Gamari authored
      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
  3. 01 Mar, 2019 1 commit
  4. 24 Feb, 2019 1 commit
    • Vladislav Zavialov's avatar
      Expression/command ambiguity resolution · e61f6e35
      Vladislav Zavialov authored
      This patch removes 'HsArrApp' and 'HsArrForm' from 'HsExpr' by
      introducing a new ambiguity resolution system in the parser.
      
      Problem: there are places in the grammar where we do not know whether we
      are parsing an expression or a command:
      
      	proc x -> do { (stuff) -< x }   -- 'stuff' is an expression
      	proc x -> do { (stuff) }        -- 'stuff' is a command
      
      Until we encounter arrow syntax (-<) we don't know whether to parse
      'stuff' as an expression or a command.
      
      The old solution was to parse as HsExpr always, and rejig later:
      
      	checkCommand :: LHsExpr GhcPs -> P (LHsCmd GhcPs)
      
      This meant polluting 'HsExpr' with command-related constructors. In
      other words, limitations of the parser were affecting the AST, and
      all other code (the renamer, the typechecker) had to deal with these
      extra constructors by panicking.
      
      We fix this abstraction leak by parsing into an intermediate
      representation, 'ExpCmd':
      
      	data ExpCmdG b where
      	  ExpG :: ExpCmdG HsExpr
      	  CmdG :: ExpCmdG HsCmd
      
      	type ExpCmd = forall b. ExpCmdG b -> PV (Located (b GhcPs))
      
      	checkExp :: ExpCmd -> PV (LHsExpr GhcPs)
      	checkCmd :: ExpCmd -> PV (LHsCmd GhcPs)
      	checkExp f = f ExpG  -- interpret as an expression
      	checkCmd f = f CmdG  -- interpret as a command
      
      See Note [Ambiguous syntactic categories] for details.
      
      Now the intricacies of parsing have no effect on the hsSyn AST when it
      comes to the expression/command ambiguity.
      
      Future work: apply the same principles to the expression/pattern
      ambiguity.
      e61f6e35
  5. 03 Feb, 2019 1 commit
  6. 31 Jan, 2019 1 commit
    • Andreas Klebinger's avatar
      Use O2 on stage1 for faster overall build times with make. · 92c7e70f
      Andreas Klebinger authored
      Build times when using the quick flavour:
      
      stage1 opt | time (wall) | time (user)
           -O1   |        13m  |        53m
           -O2   |        13m  |        51m
      So even when we compile stage2 with -O0 (quick)
      using -O2 on stage1 is already faster.
      
      The difference is even bigger when freezing
      stage1 and doing multiple builds or compiling
      stage2 with optimizations.
      92c7e70f
  7. 23 Jan, 2019 1 commit
    • Alec Theriault's avatar
      Hadrian: support in-tree GMP · efc95841
      Alec Theriault authored
      Summary:
      This adds top-level configure flags '--with-intree-gmp' and
      '--with-framework-preferred', both of which are especially relevant
      on MacOS.
      
      Besides gaining two new flags, Hadrian also had to be taught what to
      do with the 'framework' in .cabal files.
      
      Test Plan:
      ./boot && ./configure --with-intree-gmp && ./hadrian/build.sh
      ./boot && ./configure --with-gmp-framework-preferred && ./hadrian/build.sh # on macos
      
      Reviewers: carter, snowleopard, alpmestan, hvr, goldfire, bgamari
      
      Subscribers: rwbarton, erikd
      
      GHC Trac Issues: #16001
      
      Differential Revision: https://phabricator.haskell.org/D5417
      efc95841
  8. 22 Nov, 2018 1 commit
  9. 10 Sep, 2018 1 commit
  10. 21 Aug, 2018 1 commit
  11. 08 Aug, 2018 1 commit
  12. 27 Jul, 2018 1 commit
    • Simon Jakobi's avatar
      Make :doc work for the ghc library · 25e1ea99
      Simon Jakobi authored
      We already include -haddock in the GhcLibHcOpts in order to include
      the boot libraries' docs in their .hi-files.
      
      By including -haddock in the GhcStage2HcOpts and GhcStage3HcOpts, we
      make the docs for the ghc library also available to the GHCi :doc
      command.
      
      Reviewers: bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4913
      25e1ea99
  13. 06 Jul, 2018 2 commits
  14. 04 Jun, 2018 1 commit
    • Simon Jakobi's avatar
      Serialize docstrings to ifaces, display them with new GHCi :doc command · 85309a3c
      Simon Jakobi authored
      If `-haddock` is set, we now extract docstrings from the renamed ast
      and serialize them in the .hi-files.
      
      This includes some of the changes from D4749 with the notable
      exceptions of the docstring lexing and renaming.
      
      A currently limited and experimental GHCi :doc command can be used
      to display docstrings for declarations.
      
      The formatting of pretty-printed docstrings is changed slightly,
      causing some changes in testsuite/tests/haddock.
      
      Test Plan: ./validate
      
      Reviewers: alexbiehl, hvr, gershomb, harpocrates, bgamari
      
      Reviewed By: alexbiehl
      
      Subscribers: rwbarton, thomie, carter
      
      Differential Revision: https://phabricator.haskell.org/D4758
      85309a3c
  15. 06 Mar, 2018 1 commit
  16. 02 Mar, 2018 2 commits
  17. 21 Feb, 2018 1 commit
  18. 03 Feb, 2018 1 commit
    • Ben Gamari's avatar
      ghc-prim: Emulate C11 atomics when not available · 217e4170
      Ben Gamari authored
      GCC's __sync primitives apparently "usually" imply a full barrier,
      meaning they can be used to emulate the more precise C11 atomics albeit
      with a loss of efficiency. This restores compatibility with GCC 4.4.
      
      This partially reverts commit 59de2909.
      
      Test Plan: Validate on Centos
      
      Reviewers: hvr, simonmar, trommler
      
      Subscribers: rwbarton, thomie, erikd, carter
      
      GHC Trac Issues: #14244
      
      Differential Revision: https://phabricator.haskell.org/D4364
      217e4170
  19. 17 Jan, 2018 1 commit
  20. 11 Nov, 2017 1 commit
  21. 06 Nov, 2017 1 commit
    • Peter Trommler's avatar
      Update autoconf test for gcc to require 4.7 and up · 59de2909
      Peter Trommler authored
      Fixing #14244 required the newer gcc atomic built-ins that are provided
      from 4.7 and up. This updates the test to check for minimum gcc version
      4.7.
      
      The version tests for 3.4 (!), 4.4, and 4.6 are no longer needed and can
      be removed. This makes the build system simpler.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, hvr, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D4165
      59de2909
  22. 03 Nov, 2017 1 commit
  23. 25 Oct, 2017 3 commits
  24. 26 Sep, 2017 1 commit
    • Ben Gamari's avatar
      configure: Don't hard-code strip tool · 65f7d87a
      Ben Gamari authored
      For reasons that I don't entirely understand we didn't previously detect
      `strip` using autoconf. This naturally broke during cross-compilation.
      How did this ever work? I have no idea.
      
      Test Plan: Try cross-compiling
      
      Reviewers: austin, hvr, angerman
      
      Subscribers: rwbarton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D4008
      65f7d87a
  25. 09 Sep, 2017 1 commit
  26. 06 Sep, 2017 1 commit
    • Moritz Angermann's avatar
      Clean up opt and llc · 22733532
      Moritz Angermann authored
      The LLVM backend shells out to LLVMs `opt` and `llc` tools. This clean
      up introduces a shared data structure to carry the arguments we pass to
      each tool so that corresponding flags are next to each other. It drops
      the hard coded data layouts in favor of using `-mtriple` and have LLVM
      infer them. Furthermore we add `clang` as a proper tool, so we don't
      rely on assuming that `clang` is called `clang` on the `PATH` when using
      `clang` as the assembler.  Finally this diff also changes the type of
      `optLevel` from `Int` to `Word`, as we do not have negative optimization
      levels.
      
      Reviewers: erikd, hvr, austin, rwbarton, bgamari, kavon
      
      Reviewed By: kavon
      
      Subscribers: michalt, Ericson2314, ryantrinkle, dfeuer, carter, simonpj,
      kavon, simonmar, thomie, erikd, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3352
      22733532
  27. 05 Sep, 2017 2 commits
  28. 19 Aug, 2017 1 commit
  29. 01 Aug, 2017 1 commit
    • Herbert Valerio Riedel's avatar
      Enable building Cabal with parsec · 36fe21aa
      Herbert Valerio Riedel authored
      Cabal's parser has been rewritten in terms of Parsec (which is not
      enabled yet in Cabal-2.0 by default, but can be enabled by a cabal
      flag). The plan for Cabal is to drop support for the non-parsec parser,
      so we need to prepare GHC to cope with new situation.
      
      However, this means that lib:Cabal requires three new library
      dependency submodules,
      
       - parsec
       - text
       - mtl
      
      What complicates matters is that we need to build `ghc-cabal` early on
      during the bootstrap phase which currently needs to invoke `ghc --make`
      directly. So these additional dependencies need to be integrated into
      the monolithic `ghc --make` invocation which produces the `ghc-cabal`
      executable.
      
      Test Plan: `./validate --fast` passed
      
      Reviewers: austin, bgamari
      
      Subscribers: erikd, phadej, rwbarton, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3757
      36fe21aa
  30. 13 Jul, 2017 1 commit
    • Tamar Christina's avatar
      [skip ci] Temporarily disable split-sections on Windows. · f656fba1
      Tamar Christina authored
      Summary:
      This temporarily disabled split-sections again on Windows because
      of the overhead in linking it introduces. Unfortunately because BFD
      is so slow a testsuite run gets almost 2x slower. Simply linking
      Hello World takes an unacceptable long time.
      
      So for now, it'll be disabled as we look into different linkers such
      as LLD.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari
      
      Subscribers: rwbarton, thomie
      
      GHC Trac Issues: #12913
      
      Differential Revision: https://phabricator.haskell.org/D3731
      f656fba1
  31. 07 Jul, 2017 1 commit
    • 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
  32. 03 Jul, 2017 1 commit
  33. 23 May, 2017 2 commits
    • Gabor Greif's avatar
      Typos in comments and manual [ci skip] · 0b4b4a34
      Gabor Greif authored
      0b4b4a34
    • Sergei Trofimovich's avatar
      mk/config.mk.in: lower -O2 optimization down to -O1 on UNREG · 432a1f18
      Sergei Trofimovich authored
      It's not a new behaviour. First it was introduced by
      2d5372cf
      ("lower -O2 optimization down to -O1 on UNREG") to fix build
      failure on unregisterised powerpc64.
      
      This time I've noticed build failures on unregisterised ia64.
      
      The change was accidentally reverted by commit
      14d0f7f1
      ("Build system: Add stage specific SRC_HC_(WARNING_)OPTS)
      
      The revert happened due to the following code rearrangement:
      
          ifeq "$(GhcUnregisterised)" "YES"
          GhcStage1HcOpts=
          GhcStage2HcOpts=
          GhcStage3HcOpts=
          endif
      
          GhcUnregisterised=@Unregisterised@
      
      As a result 'ifeq' part has no effect.
      
      The change moves 'ifeq' down to the very end of file
      and adds a note it depends on the 'GhcUnregisterised' variable.
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      432a1f18
  34. 11 May, 2017 1 commit
    • Moritz Angermann's avatar
      Pass LLVMTarget (identical to --target) · 1345c7cc
      Moritz Angermann authored
      Sometimes it might be of interest to
      have access to the raw target value when calling
      subcommands (e.g. llvm tools with --target), as
      such we forward the specified (or inferred)
      --target for later consumption.
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D3559
      1345c7cc