1. 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
  2. 06 Jan, 2019 2 commits
    • Zejun Wu's avatar
      Fix bindist for ghci library · 3fb726d0
      Zejun Wu authored
      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
  3. 17 Dec, 2018 1 commit
    • Zejun Wu's avatar
      Merge sections in profiling .a to .p_o and use it whenever it exists · de56a67a
      Zejun Wu authored
      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
  4. 11 Dec, 2018 1 commit
  5. 04 Mar, 2018 1 commit
  6. 21 Feb, 2018 1 commit
  7. 18 Feb, 2018 1 commit
  8. 26 Oct, 2017 1 commit
  9. 09 Sep, 2017 1 commit
  10. 29 Aug, 2017 2 commits
    • 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
      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
  11. 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
  12. 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
  13. 03 Jul, 2017 1 commit
  14. 08 Jun, 2017 1 commit
  15. 25 May, 2017 1 commit
    • 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
  16. 23 Apr, 2017 1 commit
    • 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
  17. 15 Mar, 2017 1 commit
    • Simon Marlow's avatar
      Always build GHCi libs · a7be1631
      Simon Marlow authored
      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
  18. 23 Feb, 2017 1 commit
    • rwbarton's avatar
      Set $1_$2_SplitSections in distdir-opts.mk not build-package.mk · 3cb9b52f
      rwbarton authored
      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
  19. 12 Feb, 2017 1 commit
    • olsner's avatar
      Apply SplitSections to all C compilations · a50082c1
      olsner authored
      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
  20. 10 Feb, 2017 1 commit
  21. 08 Feb, 2017 1 commit
  22. 17 Dec, 2016 2 commits
    • 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/D2776Signed-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
  23. 01 Dec, 2016 1 commit
  24. 29 Nov, 2016 1 commit
  25. 10 Nov, 2016 1 commit
  26. 03 Nov, 2016 1 commit
    • 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
  27. 16 Sep, 2016 1 commit
    • Ben Gamari's avatar
      Remove directories from include paths · ea310f99
      Ben Gamari authored
      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
  28. 01 Jul, 2016 1 commit
  29. 30 Jun, 2016 1 commit
  30. 21 May, 2016 2 commits
  31. 17 May, 2016 3 commits
  32. 16 Apr, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Rework CC/CC_STAGE0 handling in `configure.ac` · 865602e0
      Herbert Valerio Riedel authored
      Rather than using the non-standard/idiomatic `--with-{gcc,clang}=...`
      scheme use the `CC=...` style scheme.
      
      The basic idea is to have Autoconf's CC/CFLAG/CPPFLAG apply to
      stage{1,2,3}, while having a separate _STAGE0 set of env-vars
      denote the bootstrap-toolchain flags/programs.
      
      This should be simpler, less confusing, and somewhat more in line with
      Autoconf's idioms (allowing us to reuse more of Autoconf rather than
      (re)inventing our own confusing non-standard m4 macros to do stuff that
      Autoconf could almost do already for us)
      
      Morever, expose CC_STAGE0 as a so-called "precious" variable.
      
      So now we can better control which bootstrapping gcc is used
      (by default the one used by the stage0 ghc, unless CC_STAGE0 is
      overriden)
      
      ```
      Some influential environment variables:
        CC_STAGE0   C compiler command (bootstrap)
        CC          C compiler command
        CFLAGS      C compiler flags
        ...
      
      Use these variables to override the choices made by `configure' or to
      help it to find libraries and programs with nonstandard names/locations.
      ```
      
      Test Plan: I've tested that cross-compiling with
      `--target=powerpc-linux-gnu` still works, and tried a few variants of
      settting `CC=` and `CC_STAGE0=`; `./validate` passed as well
      
      Reviewers: erikd, austin, bgamari, simonmar
      
      Reviewed By: simonmar
      
      Subscribers: Phyx, thomie
      
      Differential Revision: https://phabricator.haskell.org/D2078
      865602e0
  33. 07 Apr, 2016 1 commit
  34. 27 Mar, 2016 1 commit