1. 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
  2. 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
  3. 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
  4. 09 Sep, 2017 1 commit
  5. 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
  6. 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
  7. 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
  8. 03 Jul, 2017 1 commit
  9. 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
  10. 21 Apr, 2017 1 commit
  11. 12 Apr, 2017 1 commit
    • rwbarton's avatar
      Remove GhcDynamic (in favor of DYNAMIC_GHC_PROGRAMS) · 2c1312bd
      rwbarton authored
      DYNAMIC_GHC_PROGRAMS and GhcDynamic both tried to control whether
      the ghc binary was built as a dynamic executable, with confusing
      results. In particular, setting GhcDynamic=NO has no effect on
      systems where DYNAMIC_GHC_PROGRAMS defaults to YES.
      
      DYNAMIC_GHC_PROGRAMS is more fully-featured (it ensures that the
      correct flavor of the libraries is built, for example) so let's
      keep it and remove GhcDynamic to reduce confusion.
      
      This effectively reverts commit 3c6190b0.
      
      Test Plan: tested locally; harbormaster
      
      Reviewers: simonmar, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie, snowleopard
      
      Differential Revision: https://phabricator.haskell.org/D3428
      2c1312bd
  12. 06 Apr, 2017 3 commits
  13. 24 Mar, 2017 1 commit
  14. 28 Feb, 2017 2 commits
  15. 04 Feb, 2017 2 commits
    • Takenobu Tani's avatar
      Fix comment (old file names) in mk/ and utils/ · bd818a7c
      Takenobu Tani authored
      There ware some old file names (.lhs, ...) at comments.
      
      * mk/config.mk.in
        - compiler/hsSyn/HsExpr.lhs -> HsExpr.hs
      
      * utils/ghc-pkg/Main.hs
        - compiler/main/Packages.lhs -> Packages.hs
      
      * utils/genapply/Main.hs
        - CgRetConv.lhs -> * REMOVE THIS COMMENT (OLDER FILE THAN GHC6) *
        - Constants.lhs -> Constants.hs
        - compiler/codeGen/CgCallConv.lhs -> compiler/codeGen/StgCmmLayout.hs
        - Apply.hc -> Apply.cmm
        - HeapStackCheck.hc -> HeapStackCheck.cmm
      
      Reviewers: mpickering, austin, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D3077
      bd818a7c
    • rwbarton's avatar
      Make split sections by default work again · 283acec1
      rwbarton authored
      Commit 266a9dc4 changed = to := in one place in mk/config.mk.in.
      This broke SupportsSplitSections because the variable LdIsGNULd
      that it depends on is not defined until later in the file.
      
      Test Plan: pushed to a wip/ branch for perf to build
      
      Reviewers: DemiMarie, austin, bgamari, mpickering
      
      Reviewed By: mpickering
      
      Subscribers: mpickering, thomie
      
      Differential Revision: https://phabricator.haskell.org/D3070
      
      GHC Trac Issues: #13230
      283acec1
  16. 10 Jan, 2017 1 commit
  17. 27 Dec, 2016 1 commit
    • Peter Trommler's avatar
      Testsuite: Skip failing tests on PowerPC 64-bit · 4dec7d19
      Peter Trommler authored
      The Power ISA says the result of a division by zero is undefined.  So
      ignore stdout on PowerPC 64-bit systems.
      
      Disable ext-interp tests on 64-bit PowerPC.  We don't have support for
      PowerPC 64-bit ELF in the RTS linker, which is needed for the external
      interpreter.
      
      Test Plan: ./validate
      
      Reviewers: austin, simonmar, hvr, erikd, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D2782
      4dec7d19
  18. 16 Dec, 2016 1 commit
  19. 15 Dec, 2016 1 commit
  20. 10 Nov, 2016 1 commit
  21. 01 Sep, 2016 1 commit
  22. 16 Jul, 2016 1 commit
  23. 31 May, 2016 1 commit
  24. 24 May, 2016 1 commit
  25. 10 May, 2016 1 commit
  26. 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
  27. 27 Mar, 2016 1 commit
  28. 24 Mar, 2016 1 commit
    • Herbert Valerio Riedel's avatar
      Add NCG support for AIX/ppc32 · df26b955
      Herbert Valerio Riedel authored
      This extends the previous work to revive the unregisterised GHC build
      for AIX/ppc32. Strictly speaking, AIX runs on POWER4 (and later)
      hardware, but the PPC32 instructions implemented in the PPC NCG
      represent a compatible subset of the POWER4 ISA.
      
      IBM AIX follows the PowerOpen ABI (and shares many similiarites with the
      Linux PPC64 ELF V1 NCG backend) but uses the rather limited XCOFF
      format (compared to ELF).
      
      This doesn't support dynamic libraries yet.
      
      A major limiting factor is that the AIX assembler does not support the
      `@ha`/`@l` relocation types nor the ha16()/lo16() functions Darwin's
      assembler supports. Therefore we need to avoid emitting those. In case
      of numeric literals we simply compute the functions ourselves, while for
      labels we have to use local TOCs and hope everything fits into a 16bit
      offset (for ppc32 this gives us at most 16384 entries per TOC section,
      which is enough to compile GHC).
      
      Another issue is that XCOFF doesn't seem to have a relocation type for
      label-differences, and therefore the label-differences placed into
      tables-next-to-code can't be relocated, but the linker may rearrange
      different sections, so we need to place all read-only sections into the
      same `.text[PR]` section to workaround this.
      
      Finally, the PowerOpen ABI distinguishes between function-descriptors
      and actualy entry-point addresses. For AIX we need to be specific when
      emitting assembler code whether we want the address of the function
      descriptor `printf`) or for the entry-point (`.printf`). So we let the
      asm pretty-printer prefix a dot to all emitted subroutine
      calls (i.e. `BL`) on AIX only. For now, STG routines' entry-point labels
      are not prefixed by a label and don't have any associated
      function-descriptor.
      
      Reviewers: austin, trommler, erikd, bgamari
      
      Reviewed By: trommler, erikd, bgamari
      
      Differential Revision: https://phabricator.haskell.org/D2019
      df26b955
  29. 05 Feb, 2016 1 commit
  30. 25 Jan, 2016 1 commit
    • Ben Gamari's avatar
      Ensure that we don't produce code for pre-ARMv7 without barriers · 9fe7d20e
      Ben Gamari authored
      We are unable to produce load/store barriers for pre-ARMv7 targets.
      Phab:D894 added dummy cases to SMP.h for these barriers to prevent the
      build from failing under the assumption that there are no SMP-capable
      devices of this vintage. However, #10433 points out that it is more
      correct to simply set NOSMP for such targets.
      
      Tested By: rwbarton
      
      Test Plan: Validate
      
      Reviewers: erikd, rwbarton, austin
      
      Reviewed By: rwbarton
      
      Subscribers: thomie
      
      Differential Revision: https://phabricator.haskell.org/D1704
      
      GHC Trac Issues: #10433
      9fe7d20e
  31. 18 Jan, 2016 1 commit
    • Edward Z. Yang's avatar
      Switch from -this-package-key to -this-unit-id. · 240ddd7c
      Edward Z. Yang authored
      A small cosmetic change, but we have to do a bit of work to
      actually support it:
      
          - Cabal submodule update, so that Cabal passes us
            -this-unit-id when we ask for it.  This includes
            a Cabal renaming to be consistent with Unit ID, which
            makes ghc-pkg a bit more scrutable.
      
          - Build system is updated to use -this-unit-id rather than
            -this-package-key, to avoid deprecation warnings.  Needs
            a version test so I resurrected the old test we had
            (sorry rwbarton!)
      
          - I've *undeprecated* -package-name, so that we are in the same
            state as GHC 7.10, since the "correct" flag will have only
            entered circulation in GHC 8.0.
      
          - I removed -package-key.  Since we didn't deprecate -package-id
            I think this should not cause any problems for users; they
            can just change their code to use -package-id.
      
          - The package database is indexed by UNIT IDs, not component IDs.
            I updated the naming here.
      
          - I dropped the signatures field from ExposedModule; nothing
            was using it, and instantiatedWith from the package database
            field.
      
          - ghc-pkg was updated to use unit ID nomenclature, I removed
            the -package-key flags but I decided not to add any new flags
            for now.
      Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
      
      Test Plan: validate
      
      Reviewers: austin, hvr, bgamari
      
      Reviewed By: bgamari
      
      Subscribers: 23Skidoo, thomie, erikd
      
      Differential Revision: https://phabricator.haskell.org/D1780
      240ddd7c
  32. 17 Jan, 2016 1 commit
  33. 15 Jan, 2016 1 commit
  34. 07 Jan, 2016 1 commit
  35. 01 Jan, 2016 1 commit