Skip to content
Snippets Groups Projects
  1. May 29, 2019
    • Alp Mestanogullari's avatar
      testsuite: introduce 'static_stats' tests · 7a75a094
      Alp Mestanogullari authored and Marge Bot's avatar Marge Bot committed
      They are a particular type of perf tests. This patch introduces a
      'stats_files_dir' configuration field in the testsuite driver where all
      haddock timing files (and possibly others in the future) are assumed to live.
      We also change both the Make and Hadrian build systems to pass respectively
      $(TOP)/testsuite/tests/perf/haddock/ and
      <build root>/stage1/haddock-timing-files/ as the value of that new
      configuration field, and to generate the timing files in those directories
      in the first place while generating documentation with haddock.
      
      This new test type can be seen as one dedicated to examining stats files that
      are generated while building a GHC distribution. This also lets us get rid of
      the 'extra_files' directives in the all.T entries for haddock.base,
      haddock.Cabal and haddock.compiler.
      7a75a094
  2. 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
  3. 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
  4. Mar 15, 2019
  5. 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
  6. Feb 10, 2019
  7. Jan 23, 2019
    • Alec Theriault's avatar
      Hadrian: support in-tree GMP · efc95841
      Alec Theriault authored and Ben Gamari's avatar Ben Gamari committed
      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. Jan 06, 2019
    • Zejun Wu's avatar
      Fix bindist for ghci library · 3fb726d0
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      https://phabricator.haskell.org/D5169 built libghci for both vanilla way
      and profiling way. We need to include both in the bindist list so they
      will be installed.
      
      Test Plan:
      ```
      $ grep '^BuildFlavour' mk/build.mk
      BuildFlavour=perf
      $ make test_bindist
      $ grep HSghc-prim bindist-list.uniq
      ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.o
      ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.p_o
      ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3.a
      ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3-ghc8.7.20190101.so
      ghc-8.7.20190101/libraries/ghc-prim/dist-install/build/libHSghc-prim-0.5.3_p.a
      ```
      3fb726d0
    • Ben Gamari's avatar
      make: Silence some xelatex output · 3a509d29
      Ben Gamari authored
      Currently build logs from GitLab CI around around 7 megabytes each. Of this,
      around 2 megabytes is latex output. This is quite silly as essentially all of
      this output is unresolved references in the early latex iterations.
      Here we silence this output.
      
      However, to make sure that we don't silence errors we allow each xelatex
      invocation besides the last to fail.
      3a509d29
  9. Dec 17, 2018
    • Zejun Wu's avatar
      Merge sections in profiling .a to .p_o and use it whenever it exists · de56a67a
      Zejun Wu authored and Ben Gamari's avatar Ben Gamari committed
      Summary:
      We do this for vanilla way already.
      Let's also merge sections for profiling way and use it instead of the .a
      library when it exists.
      
      Test Plan:
      ```
       $ inplace/bin/ghc-stage2 --interactive -prof -fexternal-interpreter
       GHCi, version 8.7.20180921: http://www.haskell.org/ghc/  :? for help
       Prelude> pid <- System.Posix.Process.getProcessID
       Prelude> maps <- readFile $ "/proc/" ++ show pid ++ "/maps"
       Prelude> pid
       3807346
       Prelude> putStrLn $ unlines $ take 20 $ lines maps
       00400000-02103000 r-xp 00000000 00:1a 199277344
       /data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
       02104000-02106000 r--p 01d03000 00:1a 199277344
       /data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
       02106000-02417000 rw-p 01d05000 00:1a 199277344
       /data/users/watashi/ghc/inplace/lib/bin/ghc-iserv-prof
       02417000-0280a000 rw-p 00000000 00:00 0
       [heap]
       40098000-400b0000 rwxp 000d2000 00:1a 199276023
       /data/users/watashi/ghc/libraries/bytestring/dist-install/build/HSbytestring-0.10.8.2.p_o
       400b7000-400d8000 rwxp 00000000 00:00 0
       401d1000-401d2000 rwxp 000e9000 00:1a 199276023
       /data/users/watashi/ghc/libraries/bytestring/dist-install/build/HSbytestring-0.10.8.2.p_o
       40415000-40419000 rwxp 0000b000 00:1a 199275165
       /data/users/watashi/ghc/libraries/deepseq/dist-install/build/HSdeepseq-1.4.4.0.p_o
       404f8000-40526000 rwxp 000af000 00:1a 199274234
       /data/users/watashi/ghc/libraries/ghc-prim/dist-install/build/HSghc-prim-0.5.3.p_o
      ```
      
      Reviewers: simonmar, bgamari, austin, hvr
      
      Reviewed By: simonmar
      
      Subscribers: rwbarton, carter
      
      Differential Revision: https://phabricator.haskell.org/D5169
      de56a67a
  10. Dec 11, 2018
  11. Mar 04, 2018
  12. Feb 21, 2018
  13. Feb 18, 2018
  14. Oct 26, 2017
  15. Sep 09, 2017
  16. Aug 29, 2017
    • Tamar Christina's avatar
      Add gen-dll as replacement for dll-split · 5f6a8204
      Tamar Christina authored
      Summary:
      This tool can be used to generate dll's for any list of object files
      given to it. It will then repartition them automatically to fit within
      a dll and generates as many dll's as needed to do this. Cyclic dependencies
      between these generated dlls are handle automatically so there is no need
      to tell it how to partition.
      
      It is also a lot more general than `dll-split` as it is able to split any
      package not just `libGHC`. It also uses a trick using GNU style import libraries
      to hide the splitting from the rest of the pipeline. Which means come linking time
      you don't need to know which dll contains what symbol or how many split dlls were
      created.
      
      The import libraries are by default created with libtool. However since libtool is BFD
      based it is very slow. So if present and detected by configure the `genlib` tool
      from the msys2 project is used. This makes a difference of about ~45 minutes when compiling.
      
      To install `genlib` run `pacman -Sy mingw-w64-$(uname -m)-tools-git`.
      
      More detailed explaination of the process can be found here
      https://ghc.haskell.org/trac/ghc/wiki/WindowsDynamicLinking
      
      Test Plan: ./validate
      
      Reviewers: austin, hvr, bgamari, erikd, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: snowleopard, rwbarton, thomie, erikd, #ghc_windows_task_force
      
      GHC Trac Issues: #5987
      
      Differential Revision: https://phabricator.haskell.org/D3883
      5f6a8204
    • Tamar Christina's avatar
      Remove dll-split. · 5266ab90
      Tamar Christina authored and Ben Gamari's avatar Ben Gamari committed
      This patch removes dll-split from the code base, the reason is dll-split
      no longer makes any sense. It was designed to split a dll in two, but we
      now already have many more symbols than would fit inside two dlls. So we
      need a third one. This means there's no point in having to maintain this
      list as it'll never work anyway and the solution isn't scalable.
      
      Test Plan: ./validate
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, #ghc_windows_task_force
      
      GHC Trac Issues: #5987
      
      Differential Revision: https://phabricator.haskell.org/D3882
      5266ab90
  17. Aug 01, 2017
    • Herbert Valerio Riedel's avatar
      Enable building Cabal with parsec · 36fe21aa
      Herbert Valerio Riedel authored and Ben Gamari's avatar Ben Gamari committed
      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
  18. 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
  19. Jul 03, 2017
  20. Jun 08, 2017
  21. May 25, 2017
    • Sergei Trofimovich's avatar
      rules: add per-library EXTRA_HC_OPTS · f011f587
      Sergei Trofimovich authored
      
      Sometimes it's handy to change a compiler flag
      for a library in stage{0,1,2}.
      
      Usage example:
      
          libraries/binary_EXTRA_HC_OPTS += -O1
          libraries/containers_EXTRA_HC_OPTS += -O1
          libraries/bytestring_EXTRA_HC_OPTS += -O1
      
      Here override default -O2 defined in .cabal files
      for these libraries to speed build up.
      
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      f011f587
  22. Apr 23, 2017
    • Sergei Trofimovich's avatar
      ghc: tweak cross-compilation to mingw32 · 8908ba31
      Sergei Trofimovich authored
      
      The build failure when cross-compiling from
      linux to windows looks like:
      
          HC [stage 1] ghc/stage2/build/tmp/ghc-stage2.exe
            Call hs_init_ghc() from your main() function to set these options.
        /usr/libexec/gcc/i686-w64-mingw32/ld: cannot find -lHSghc-8.3-0
      
      Similar to commit 745032dd
      ("rts: tweak cross-compilation to mingw32") decision to split
      stage2 should be done based based on TargetOS, not HostOS.
      
      Signed-off-by: default avatarSergei Trofimovich <slyfox@gentoo.org>
      8908ba31
  23. Mar 15, 2017
    • Simon Marlow's avatar
      Always build GHCi libs · a7be1631
      Simon Marlow authored and Ben Gamari's avatar Ben Gamari committed
      Since the introduction of -split-sections, using GHCi with the RTS
      linker is really slow:
      
      ```
      $ time (echo :quit | ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter)
      GHCi, version 8.1.20170304: http://www.haskell.org/ghc/  :? for help
      Prelude> Leaving GHCi.
      
      real        0m3.793s
      ```
      
      (when we use `-fexternal-interpreter` it uses the RTS linker by default,
      you can make it use the system linker by adding `-dynamic`)
      
      Building the GHCi libs doesn't take much time or space in the GHC build,
      but makes things much quicker for people using the RTS linker:
      
      ```
      $ time (echo :quit | ./inplace/bin/ghc-stage2 --interactive -fexternal-interpreter)
      GHCi, version 8.1.20170304: http://www.haskell.org/ghc/  :? for help
      Prelude> Leaving GHCi.
      
      real        0m0.285s
      ```
      
      So I propose that we build and ship them unconditionally.
      
      Test Plan: validate, perf tests above
      
      Reviewers: bgamari, austin, niteria, erikd, Phyx
      
      Reviewed By: bgamari
      
      Subscribers: rwbarton, thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3298
      a7be1631
  24. Feb 23, 2017
    • rwbarton's avatar
      Set $1_$2_SplitSections in distdir-opts.mk not build-package.mk · 3cb9b52f
      rwbarton authored and Ben Gamari's avatar Ben Gamari committed
      After commit a50082c1 we use -ffunction-sections -fdata-sections
      for all C compilations, when $1_$2_SplitSections is set. But that
      variable was set in build-package.mk which is not run for the RTS.
      As a result the RTS was not being split, leading to larger binaries.
      
      This commit fixes RTS splitting by moving the definition of
      $1_$2_SplitSections to distdir-opts.mk, which is run for the RTS
      (and also from build-package.mk).
      
      Test Plan:
      manual ./validate and check that RTS and base .c files
      are split, but not object files in the compiler
      
      Reviewers: austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, snowleopard, olsner
      
      Differential Revision: https://phabricator.haskell.org/D3137
      3cb9b52f
  25. Feb 12, 2017
    • olsner's avatar
      Apply SplitSections to all C compilations · a50082c1
      olsner authored and Ben Gamari's avatar Ben Gamari committed
      Previously this was added only to the RTS's C files (those are the bulk
      of it though), but there are C bits in ghc-prim, integer-gmp and base
      too.
      
      Followup for #8405, allows the large table of character properties in
      base to be stripped when not used.
      
      Test Plan: validate
      
      Reviewers: austin, bgamari, simonmar
      
      Reviewed By: bgamari
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3121
      a50082c1
  26. Feb 10, 2017
  27. Feb 08, 2017
  28. Dec 17, 2016
    • Sergei Trofimovich's avatar
      fix OpenBSD linkage (wxneeded) · 87c3b1d4
      Sergei Trofimovich authored
      There is two types of options passed directly to 'ld'
      (and not to 'gcc' driver):
          - CONF_LD_LINKER_OPTS_STAGE$4
          - EXTRA_LD_OPTS
      
      This changedoes two things:
      
      - split 'EXTRA_LD_OPTS' into two variables:
          - EXTRA_LD_OPTS (accepts 'gcc' wrapper options)
          - EXTRA_LD_LINKER_OPTS (accepts raw 'ld' options)
      
      - wraps all LD_LINKER options as '-Wl,' when passed
        to 'gcc' driver.
      
      Fixes https://phabricator.haskell.org/D2776
      
      
      
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      87c3b1d4
    • Sergei Trofimovich's avatar
      revert '-Wl' prefixing to *_LD_OPTS · a6657bd0
      Sergei Trofimovich authored
      
      This reverts f48f5a9e
      
      The prefixing does not work as comma
      is stripped by $(addprefix) macro:
      
      The following call
          $$(addprefix -optl-Wl, $$($1_$2_$3_ALL_LD_OPTS))
      
      prefixes options with "-optl-Wl" not with "-optl-Wl,"
      
      The simplest breakage can be seen by adding
          SRC_LD_OPTS += -O1
      to mk/build.mk:
      
        <no location info>: error:
          Warning: Couldn't figure out linker information!
                   Make sure you're using GNU ld, GNU gold
                   or the built in OS X linker, etc.
        gcc: error: unrecognized command line option '-Wl-O1'
      
      Another problem with original change is loss of ability
      to pass options to gcc as a linker driver, for example:
          SRC_LD_OPTS += -flto
      
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      a6657bd0
  29. Dec 01, 2016
  30. Nov 29, 2016
  31. Nov 10, 2016
  32. Nov 03, 2016
    • Simon Marlow's avatar
      Omit unnecessary linker flags · a977c965
      Simon Marlow authored
      Summary:
      This omits -L and -l flags from the linker command line that shouldn't
      be necessary because GHC will already add them via the -package-id
      flags we pass.
      
      This also reverts part of 90538d86
      that rearranges the linker command line and causes some knock-on
      problems (see D2618).
      
      Test Plan: validate (need to validate on Windows too)
      
      Reviewers: Phyx, bgamari, niteria, austin, erikd
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2639
      
      GHC Trac Issues: #12738
      a977c965
  33. Sep 16, 2016
    • Ben Gamari's avatar
      Remove directories from include paths · ea310f99
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      Previously this was a relative path which worked in the GHC tree, but
      failed elsewhere. This caused trouble for out-of-tree users as well as
      Hadrian, which wants to move build artifacts out of the working
      directory. Fixes #8040.
      
      Test Plan: Validate
      
      Reviewers: thomie, austin, snowleopard, hvr
      
      Reviewed By: snowleopard, hvr
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2530
      
      GHC Trac Issues: #8040
      ea310f99
  34. Jul 01, 2016
  35. Jun 30, 2016
  36. May 21, 2016
Loading