1. 23 Dec, 2015 1 commit
    • Ben Gamari's avatar
      config.mk.in: Disable stripping by default on ARM · 353e97a3
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      The Cortex A8 hardware apparently has a bug which ld.gold will try to
      correct; however in order to do so it must have unstripped executables
      lest we see warnings of the form (see #10376, #10464),
          /usr/bin/ld.gold: warning: cannot scan executable section 1 of ...
          for Cortex-A8 erratum because it has no mapping symbols.
      Consequently we disabling stripping by default on this architecture.
      A bit more discussion about this issue can be found in this [Android
      Test Plan: Try validating on ARM
      Reviewers: erikd, austin, thomie
      Reviewed By: austin, thomie
      Differential Revision: https://phabricator.haskell.org/D1599
      GHC Trac Issues: #10376, #10464
  2. 04 Dec, 2015 1 commit
    • Sergei Trofimovich's avatar
      libdw: enable support only on i386 and amd64 · e2c518e6
      Sergei Trofimovich authored
      Currently libdw requires per-arch implementation of
      set_initial_registers() function.
      Otherwise build fails with linkage error
      (seen on sparc):
            undefined reference to `set_initial_registers'
        collect2: error: ld returned 1 exit status
        `gcc' failed in phase `Linker'. (Exit code: 1)
        make[1]: *** [ghc/stage2/build/tmp/ghc-stage2] Error 1
      Converted link-time error to compile-time error,
      added arch whitelist.
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      Reviewers: austin, thomie, bgamari
      Reviewed By: bgamari
      Differential Revision: https://phabricator.haskell.org/D1567
  3. 01 Dec, 2015 1 commit
    • thomie's avatar
      Build system: Add stage specific SRC_HC_(WARNING_)OPTS · 14d0f7f1
      thomie authored and Herbert Valerio Riedel's avatar Herbert Valerio Riedel committed
      * Add stage specific versions of SRC_HC_OPTS. These are currently only
        used for -Werror. The previous combination of GhcStage2HcOpts and
        GhcLibHcOpts didn't apply to utils/*.
      * Add stage specific versions of SRC_HC_WARNING_OPTS. These will later be
        used for new warning supression flags that should not be passed to the
        bootstrap compiler.
      * Move -Wall (and -Werror) related code back to mk/warnings.mk, where it
        was before 987d5427. Now all warning related code is nicely together.
        Include mk/warnings.mk after mk/custom-settings.mk to make this work.
      Reviewed By: bgamari, hvr
      Differential Revision: https://phabricator.haskell.org/D1536
  4. 18 Nov, 2015 1 commit
  5. 12 Nov, 2015 1 commit
    • 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
      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
  6. 17 Oct, 2015 1 commit
    • Ben Gamari's avatar
      Libdw: Add libdw-based stack unwinding · a6a3dabc
      Ben Gamari authored and Ben Gamari's avatar Ben Gamari committed
      This adds basic support to the RTS for DWARF-assisted unwinding of the
      Haskell and C stack via libdw. This only adds the infrastructure;
      consumers of this functionality will be introduced in future diffs.
      Currently we are carrying the initial register collection code in
      Libdw.c but this will eventually make its way upstream to libdw.
      Test Plan: See future patches
      Reviewers: Tarrasch, scpmw, austin, simonmar
      Reviewed By: austin, simonmar
      Subscribers: simonmar, thomie, erikd
      Differential Revision: https://phabricator.haskell.org/D1196
      GHC Trac Issues: #10656
  7. 15 Oct, 2015 1 commit
  8. 03 Oct, 2015 1 commit
  9. 08 Sep, 2015 2 commits
    • thomie's avatar
      Build system: cleanup BUILD_DIRS + add lots of Notes · 8be43dd9
      thomie authored
      See Note [CrossCompiling vs Stage1Only] in mk/config.mk.in.
      See Note [Stage1Only vs stage=1] in mk/config.mk.in.
      See Note [No stage2 packages when CrossCompiling or Stage1Only].
        * use stage2 to build mkUserGuidePart, as was probably intended.
          Now the following represent the same set of packages:
          - packages that we build with ghc-stage2
          - packages that depend on the ghc library
          Those packages are: haddock, mkUserGuidePart and ghctags.
        * don't let utils that don't depend on the ghc library depend on its
          package-data.mk file. Instead, let those utils directly depend on
          the package-data.mk files of the stage1 packages. Not sure if it
          improves anything, but I found it easier to explain what's going on
          this way.
      (partially) reviewed by: austin
      Differential Revision: https://phabricator.haskell.org/D1218
    • thomie's avatar
      Build system: delete the InstallExtraPackages variable · a1586074
      thomie authored
      Just install all packages that are built. Don't make an exception for
      the dph and extra packages.
      You can control whether the dph and extra packages should be build using
      the variables BUILD_DPH and BUILD_EXTRA_PKGS. These variables didn't
      exist before. But now that they do, InstallExtraPackages isn't really
      needed anymore.
      Reviewed by: austin
      Differential Revision: https://phabricator.haskell.org/D1227
  10. 20 Aug, 2015 1 commit
  11. 13 Jul, 2015 1 commit
    • thomie's avatar
      Build system: do not build stm and parallel by default · 392ff06d
      thomie authored
      stm and parallel have an 'extra' tag in the ./packages file, so would get
      added to PACKAGES_STAGE2 by default, and subsequently build by the stage2
      With this patch, this happens only when you set BUILD_EXTRA_PKGS=YES in
      build.mk. A normal validate still builds (and tests) the 'extra'
      packages, but they are skipped for `validate --fast`. Maybe this brings
      us closer to finishing within the 50 minute Travis limit as well.
      We can later try to give random, primitive and vector an 'extra' tag as
      well (now they have a 'dph' tag), but some tests will probably fail at
      Differential Revision: https://phabricator.haskell.org/D1065
  12. 07 Jul, 2015 1 commit
    • thomie's avatar
      Build system: don't set GhcLibWays explicitly in build.mk.sample (#10536) · 37de4ad7
      thomie authored
      We used to have the following in mk/build.mk.sample:
        GhcLibWays = $(if $(filter $(DYNAMIC_GHC_PROGRAMS),YES),v dyn,v)
      This commit removes that statement for the following reasons:
        1) It depends on the variable DYNAMIC_GHC_PROGRAMS, which is set later
           in the file for some BuildFlavours. Although this works because
           `make` does multiple passes when reading Makefiles, it is confusing
           to users [1]. Instead, test for DYNAMIC_GHC_PROGRAMS in
        2) Although it looks like that line is about compiling the `dyn` way,
           its purpose is really to not build the `prof` way. This commit
           introduces the variable BUILD_PROF_LIBS, to make this more
      This simplifies mk/build.mk.sample and mk/validate-settings.mk.
      Note that setting GhcLibWays explicitly still works, and
      DYNAMIC_GHC_PROGRAMS=NO in build.mk does not build the `dyn` way.
      [1] https://mail.haskell.org/pipermail/ghc-devs/2014-December/007725.html
      Differential Revision: https://phabricator.haskell.org/D1021
  13. 03 Jul, 2015 1 commit
    • Peter Trommler's avatar
      Implement PowerPC 64-bit native code backend for Linux · d3c1dda6
      Peter Trommler authored and Ben Gamari's avatar Ben Gamari committed
      Extend the PowerPC 32-bit native code generator for "64-bit
      PowerPC ELF Application Binary Interface Supplement 1.9" by
      Ian Lance Taylor and "Power Architecture 64-Bit ELF V2 ABI Specification --
      OpenPOWER ABI for Linux Supplement" by IBM.
      The latter ABI is mainly used on POWER7/7+ and POWER8
      Linux systems running in little-endian mode. The code generator
      supports both static and dynamic linking. PowerPC 64-bit
      code for ELF ABI 1.9 and 2 is mostly position independent
      anyway, and thus so is all the code emitted by the code
      generator. In other words, -fPIC does not make a difference.
      rts/stg/SMP.h support is implemented.
      Following the spirit of the introductory comment in
      PPC/CodeGen.hs, the rest of the code is a straightforward
      extension of the 32-bit implementation.
      * Code is generated only in the medium code model, which
        is also gcc's default
      * Local symbols are not accessed directly, which seems to
        also be the case for 32-bit
      * LLVM does not work, but this does not work on 32-bit either
      * Must use the system runtime linker in GHCi, because the
        GHC linker for "static" object files (rts/Linker.c) for
        PPC 64-bit is not implemented. The system runtime
        (dynamic) linker works.
      * The handling of the system stack (register 1) is not ELF-
        compliant so stack traces break. Instead of allocating a new
        stack frame, spill code should use the "official" spill area
        in the current stack frame and deallocation code should restore
        the back chain
      * DWARF support is missing
      Fixes #9863
      Test Plan: validate (on powerpc, too)
      Reviewers: simonmar, trofi, erikd, austin
      Reviewed By: trofi
      Subscribers: bgamari, arnons1, kgardas, thomie
      Differential Revision: https://phabricator.haskell.org/D629
      GHC Trac Issues: #9863
  14. 30 Jun, 2015 1 commit
  15. 23 Jun, 2015 1 commit
  16. 19 Jun, 2015 1 commit
    • pali.gabor@gmail.com's avatar
      docs: Unbreak the PS/PDF builds for the User's Guide (#10509) · 440d1bc1
      pali.gabor@gmail.com authored
      dblatex can only translate the Unicode glyphs introduced in #10509 for LaTeX
      if the `latex.unicode.use=1` flag is set, otherwise it will just fail.
      However, note that adding this flag is not going to fully solve the problem as
      those symbols are not known by LaTeX, so the corresponding character codes
      will be added instead to the resulting PS/PDF files.  Hence it is considered
      an interim solution only, not a true fix, until a better one is found.
  17. 21 Apr, 2015 1 commit
  18. 31 Mar, 2015 1 commit
    • Herbert Valerio Riedel's avatar
      Drop old integer-gmp-0.5 from GHC source tree · 995e8c1c
      Herbert Valerio Riedel authored
      This completes what c774b28f (#9281)
      started.  `integer-gmp-1.0` was added as an additional
      `libraries/integer-gmp2` folder while retaining the ability to configure
      GHC w/ the old `integer-gmp-0.5` to have a way back, and or the ability
      to easily switch between old/new `integer-gmp` for benchmark/debugging
      This commit removes the old `libraries/integer-gmp` folder and moves
      `libraries/integer-gmp2` into its place, while removing any mentions of
      "gmp2" as well as the to support two different `integer-gmp` packages in
      GHC's source-tree.
      Reviewed By: austin
      Differential Revision: https://phabricator.haskell.org/D769
  19. 16 Mar, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Fix build on amd64/solaris. · 83afcd17
      Erik de Castro Lopo authored
      Commit 71fcc4c0 breaks the 64bit build on Solaris 11. Solaris
      is a multi-lib OS so both 32bit and 64bit binaries may  be run, but
      by default it compiles to 32bit so that -m64 needs to be added in
      the appropriate place when compiling for 64 bits.
      Patch-from: Karel Gardas <karel.gardas@centrum.cz>
      Reviewers: kgardas, austin
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D733
  20. 12 Mar, 2015 1 commit
    • Erik de Castro Lopo's avatar
      Use the gold linker for linux/ARM and android/ARM targets. · 71fcc4c0
      Erik de Castro Lopo authored
      Fixes #8976 and #9873 by making use of the Binutils ld.gold
      linker explicit whenever the target is linux/ARM or android/ARM.
      This does not affect iOS where Apple provides its own linker.
      In order to achieve this, we need to add `-fuse-ld=gold` to
      the SettingsCCompilerLinkFlags setting and set
      SettingsLdCommand to `ld.gold` (or `${target}-ld.gold` when
      cross-compiling). In addition, simplifying the use of
      This patch was tested by ensuring that the following worked
      as expected:
        * Native builds on linux/x86_64 (nothing changed).
        * Native builds on linux/arm (and uses the gold linker).
        * Linux to linux/arm cross compiles (and uses the cross
          gold linker).
      Contributions by Ben Gamari, Joachim Breitner and Reid Barton.
      Reviewers: nomeata, bgamari, austin, rwbarton
      Subscribers: thomie
      Differential Revision: https://phabricator.haskell.org/D715
      GHC Trac Issues: #8976 #9873
  21. 23 Feb, 2015 1 commit
    • PHO's avatar
      Make top-level "configure" accept and propagate --with-curses-{includes,libraries} to libraries · bbb57a6b
      PHO authored
      If curses is installed into some non-standard path, we currently have
      to say something like the following in mk/build.mk:
        libraries/terminfo_CONFIGURE_OPTS += \
            --configure-option=--with-curses-includes=/somewhere/include \
      This is because the top-level configure does not accept nor propagate
      --with-curses-{includes,libraries} to libraries while it does so for
      iconv, gmp and libffi. It would be nice if curses were handled in the
      same manner.
      Test Plan: Install curses into some non-standard path. Then run the top-level "configure" script with options "--with-curses-includes=/path/to/curses/include" and "--with-curses-libraries=/path/to/curses/lib".
      Reviewers: austin
      Reviewed By: austin
      Subscribers: thomie, PHO
      Differential Revision: https://phabricator.haskell.org/D665
      GHC Trac Issues: #10096
  22. 17 Feb, 2015 1 commit
  23. 13 Jan, 2015 1 commit
  24. 14 Dec, 2014 1 commit
    • Sergei Trofimovich's avatar
      powerpc: fix and enable shared libraries by default on linux · fa31e8f4
      Sergei Trofimovich authored
      And fix things all the way down to it. Namely:
          - remove 'r30' from free registers, it's an .LCTOC1 register
            for gcc. generated .plt stubs expect it to be initialised.
          - fix PicBase computation, which originally forgot to use 'tmp'
            reg in 'initializePicBase_ppc.fetchPC'
          - mark 'ForeighTarget's as implicitly using 'PicBase' register
            (see comment for details)
          - add 64-bit MO_Sub and test on alloclimit3/4 regtests
          - fix dynamic label offsets to match with .LCTOC1 offset
      Signed-off-by: default avatarSergei Trofimovich <siarheit@google.com>
      Test Plan: validate passes equal amount of vanilla/dyn tests
      Reviewers: simonmar, erikd, austin
      Reviewed By: erikd, austin
      Subscribers: carter, thomie
      Differential Revision: https://phabricator.haskell.org/D560
      GHC Trac Issues: #8024, #9831
  25. 01 Dec, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Revert "Remove RAWCPP_FLAGS" · 0511c0ab
      Herbert Valerio Riedel authored
      This reverts commit 460eebec.
      Thomas requested to revert the commit with the words:
      > Please revert this commit, it is horribly wrong. I'll have a proper look
      > later, but not supplying `-traditional` to the C preprocessor is the cause
      > of #9828.
      the reverted commit was related to #9094
  26. 12 Nov, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Implement new integer-gmp2 from scratch (re #9281) · c774b28f
      Herbert Valerio Riedel authored
      This is done as a separate `integer-gmp2` backend library because it
      turned out to become a complete rewrite from scratch.
      Due to the different (over)allocation scheme and potentially different
      accounting (via the new `{shrink,resize}MutableByteArray#` primitives),
      some of the nofib benchmarks actually results in increased allocation
      numbers (but not necessarily an increase in runtime!).  I believe the
      allocation numbers could improve if `{resize,shrink}MutableByteArray#`
      could be optimised to reallocate in-place more efficiently.
      Here are the more apparent changes in the latest nofib comparision
      between `integer-gmp` and `integer-gmp2`:
                Program     Size    Allocs   Runtime   Elapsed  TotalMem
             bernouilli    +1.6%    +15.3%     0.132     0.132      0.0%
           cryptarithm1    -2.2%      0.0%     -9.7%     -9.7%      0.0%
                  fasta    -0.7%     -0.0%    +10.9%    +10.9%      0.0%
                  kahan    +0.6%    +38.9%     0.169     0.169      0.0%
                   lcss    -0.7%     -0.0%     -6.4%     -6.4%      0.0%
                 mandel    +1.6%    +33.6%     0.049     0.049      0.0%
               pidigits    +0.8%     +8.5%     +3.9%     +3.9%      0.0%
                  power    +1.4%    -23.8%    -18.6%    -18.6%    -16.7%
              primetest    +1.3%    +50.1%     0.085     0.085      0.0%
                    rsa    +1.6%    +53.4%     0.026     0.026      0.0%
                    scs    +1.2%     +6.6%     +6.5%     +6.6%    +14.3%
                 symalg    +1.0%     +9.5%     0.010     0.010      0.0%
              transform    -0.6%     -0.0%     -5.9%     -5.9%      0.0%
                    Min    -2.3%    -23.8%    -18.6%    -18.6%    -16.7%
                    Max    +1.6%    +53.4%    +10.9%    +10.9%    +14.3%
         Geometric Mean    -0.3%     +1.9%     -0.8%     -0.8%     +0.0%
      (see P35 / https://phabricator.haskell.org/P35 for full report)
      By default, `INTEGER_LIBRARY=integer-gmp2` is active now, which results
      in the package `integer-gmp-` being registered in the package db.
      The previous `integer-gmp-` can be restored by setting
      `INTEGER_LIBRARY=integer-gmp` (but will probably be removed altogether
      for GHC 7.12). In-tree GMP support has been stolen from the old
      `integer-gmp` (while unpatching the custom memory-allocators, as well as
      forcing `-fPIC`)
      A minor hack to `ghc-cabal` was necessary in order to support two different
      `integer-gmp` packages (in different folders) with the same package key.
      There will be a couple of follow-up commits re-implementing some features
      that were dropped to keep D82 minimal, as well as further
      More information can be found via #9281 and
      Reviewed By: austin, rwbarton, simonmar
      Differential Revision: https://phabricator.haskell.org/D82
  27. 07 Oct, 2014 1 commit
    • thomie's avatar
      Remove RAWCPP_FLAGS · 460eebec
      thomie authored
      #9094 mentions to "remove the RAW_CPP bits from the ghc build system because
      they're not longer needed", "once the CPP settings ticket is merged #8683"
      #8683 was merged with 34f7e9a3, Phab:D26.
      Test Plan: harbormaster
      Reviewers: carter, austin
      Reviewed By: austin
      Subscribers: simonmar, ezyang, carter
      Differential Revision: https://phabricator.haskell.org/D240
      GHC Trac Issues: #9094
  28. 27 Aug, 2014 1 commit
  29. 13 Aug, 2014 1 commit
  30. 10 Aug, 2014 1 commit
  31. 29 Jun, 2014 1 commit
    • Herbert Valerio Riedel's avatar
      Add BUILD_DPH variable to GHC build-system · 88d85aa6
      Herbert Valerio Riedel authored
      Now that the `libraries/dph` submodule is checked out always we need
      a different way to disable building DPH to save compile-time while
      developing GHC.
      This commit adds a new YES/NO Make variable `BUILD_DPH` that can be used
      inside mk/build.mk to control whether to build libraries/dph or not.
      The default setting is `BUILD_DPH=YES` (via `mk/config.mk.in`).
      This also changes `validate`'s flag `--no-dph` to explicitly disable DPH
      for the current validation run.
      Signed-off-by: Herbert Valerio Riedel's avatarHerbert Valerio Riedel <hvr@gnu.org>
      Test Plan: successful validates with `--fast --no-dph`
      Differential Revision: https://phabricator.haskell.org/D31
  32. 03 May, 2014 1 commit
  33. 23 Mar, 2014 1 commit
  34. 13 Mar, 2014 3 commits
  35. 28 Feb, 2014 1 commit
    • Austin Seipp's avatar
      binary-dist: when using xz, use extreme compression. · 251b18ab
      Austin Seipp authored
      When building a binary distribution with TAR_COMP=xz, using the -9e flag
      (extremely high compression) results in substantial savings: for the
      Mavericks builds, bzip2 scores in at about 120mb, while xz at level 9
      scores about 60mb - a huge reduction!
      This of course takes significantly longer - but it does not affect
      decompression speed for end users, so it's certainly worth it.
      Signed-off-by: default avatarAustin Seipp <austin@well-typed.com>
  36. 26 Feb, 2014 2 commits