Skip to content
Snippets Groups Projects
  1. Aug 23, 2023
  2. Aug 16, 2023
  3. Aug 05, 2023
    • Luite Stegeman's avatar
      JS: Improve compatibility with recent emsdk · aa07402e
      Luite Stegeman authored
      The JavaScript code in libraries/base/jsbits/base.js had some
      hardcoded offsets for fields in structs, because we expected
      the layout of the data structures to remain unchanged. Emsdk
      3.1.42 changed the layout of the stat struct, breaking this
      assumption, and causing code in .hsc files accessing the
      stat struct to fail.
      
      This patch improves compatibility with recent emsdk by
      removing the assumption that data layouts stay unchanged:
      
          1. offsets of fields in structs used by JavaScript code are
             now computed by the configure script, so both the .js and
             .hsc files will automatically use the new layout if anything
             changes.
          2. the distrib/configure script checks that the emsdk version
             on a user's system is the same version that a bindist was
             booted with, to avoid data layout inconsistencies
      
      See #23641
      aa07402e
  4. Jul 24, 2023
    • Rodrigo Mesquita's avatar
      Ship ghc-toolchain in the bindist · 38e795ff
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      Add the ghc-toolchain binary to the binary distribution we ship to
      users, and teach the bindist configure to use the existing ghc-toolchain.
      38e795ff
    • Rodrigo Mesquita's avatar
      ghc-toolchain: Toolchain Selection · 31dcd26c
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      This commit integrates ghc-toolchain, the brand new way of configuring
      toolchains for GHC, with the Hadrian build system, with configure, and
      extends and improves the first iteration of ghc-toolchain.
      
      The general overview is
      
      * We introduce a program invoked `ghc-toolchain --triple=...` which, when run,
        produces a file with a `Target`. A `GHC.Toolchain.Target.Target`
        describes the properties of a target and the toolchain (executables
        and configured flags) to produce code for that target
      
      * Hadrian was modified to read Target files, and will both
        * Invoke the toolchain configured in the Target file as needed
        * Produce a `settings` file for GHC based on the Target file for that stage
      
      * `./configure` will invoke ghc-toolchain to generate target files, but
        it will also generate target files based on the flags configure itself
        configured (through `.in` files that are substituted)
      
        * By default, the Targets generated by configure are still (for now) the ones used by Hadrian
      
        * But we additionally validate the Target files generated by
          ghc-toolchain against the ones generated by configure, to get a head
          start on catching configuration bugs before we transition
          completely.
      
        * When we make that transition, we will want to drop a lot of the
          toolchain configuration logic from configure, but keep it otherwise.
      
      * For each compiler stage we should have 1 target file (up to a stage compiler we can't run in our machine)
        * We just have a HOST target file, which we use as the target for stage0
        * And a TARGET target file, which we use for stage1 (and later stages, if not cross compiling)
        * Note there is no BUILD target file, because we only support cross compilation where BUILD=HOST
        * (for more details on cross-compilation see discussion on !9263)
      
      See also
      * Note [How we configure the bundled windows toolchain]
      * Note [ghc-toolchain consistency checking]
      * Note [ghc-toolchain overview]
      
      Ticket: #19877
      MR: !9263
      31dcd26c
  5. Jun 29, 2023
    • Rodrigo Mesquita's avatar
      Configure MergeObjs supports response files rather than Ld · fcf310e7
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      The previous configuration script to test whether Ld supported response
      files was
      * Incorrect (see #23542)
      * Used, in practice, to check if the *merge objects tool* supported
        response files.
      
      This commit modifies the macro to run the merge objects tool (rather
      than Ld), using a response file, and checking the result with $NM
      
      Fixes #23542
      fcf310e7
    • Rodrigo Mesquita's avatar
      Configure CPP into settings · 5ffc7d7b
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      There is a distinction to be made between the Haskell Preprocessor and
      the C preprocessor. The former is used to preprocess Haskell files,
      while the latter is used in C preprocessing such as Cmm files.
      
      In practice, they are both the same program (usually the C compiler) but
      invoked with different flags.
      
      Previously we would, at configure time, configure the haskell
      preprocessor and save the configuration in the settings file, but,
      instead of doing the same for CPP, we had hardcoded in GHC that the CPP
      program was either `cc -E` or `cpp`.
      
      This commit fixes that asymmetry by also configuring CPP at configure
      time, and tries to make more explicit the difference between HsCpp and
      Cpp (see Note [Preprocessing invocations]).
      
      Note that we don't use the standard CPP and CPPFLAGS to configure Cpp,
      but instead use the non-standard --with-cpp and --with-cpp-flags.
      The reason is that autoconf sets CPP to "$CC -E", whereas we expect the
      CPP command to be configured as a standalone executable rather than a
      command. These are symmetrical with --with-hs-cpp and
      --with-hs-cpp-flags.
      
      Cleanup: Hadrian no longer needs to pass the CPP configuration for CPP
               to be C99 compatible through -optP, since we now configure that
               into settings.
      
      Closes #23422
      5ffc7d7b
  6. Jun 28, 2023
    • Rodrigo Mesquita's avatar
      Stop configuring unused Ld command in `settings` · ecdc4353
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      GHC has no direct dependence on the linker. Rather, we depend upon the C
      compiler for linking and an object-merging program (which is typically
      `ld`) for production of GHCi objects and merging of C stubs into final
      object files.
      
      Despite this, for historical reasons we still recorded information about
      the linker into `settings`. Remove these entries from `settings`,
      `hadrian/cfg/system.config`, as well as the `configure` logic
      responsible for this information.
      
      Closes #23566.
      ecdc4353
  7. Jun 27, 2023
  8. Jun 13, 2023
    • Rodrigo Mesquita's avatar
      Configure -Qunused-arguments instead of hardcoding it · c6741e72
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      When GHC invokes clang, it currently passes -Qunused-arguments to
      discard warnings resulting from GHC using multiple options that aren't
      used.
      
      In this commit, we configure -Qunused-arguments into the Cc options
      instead of checking if the compiler is clang at runtime and hardcoding
      the flag into GHC.
      
      This is part of the effort to centralise toolchain information in
      toolchain target files at configure time with the end goal of a runtime
      retargetable GHC.
      
      This also means we don't need to call getCompilerInfo ever, which
      improves performance considerably (see !10589).
      
      Metric Decrease:
          PmSeriesG
          T10421
          T11303b
          T12150
          T12227
          T12234
          T12425
          T13035
          T13253-spj
          T13386
          T15703
          T16875
          T17836b
          T17977
          T17977b
          T18140
          T18282
          T18304
          T18698a
          T18698b
          T18923
          T20049
          T21839c
          T3064
          T5030
          T5321FD
          T5321Fun
          T5837
          T6048
          T9020
          T9198
          T9872d
          T9961
      c6741e72
  9. May 30, 2023
    • Ben Gamari's avatar
      Move via-C flags into GHC · 6629f1c5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      These were previously hardcoded in configure (with no option for
      overriding them) and simply passed onto ghc through the settings file.
      
      Since configure already guarantees gcc supports those flags, we simply
      move them into GHC.
      6629f1c5
  10. May 11, 2023
    • Rodrigo Mesquita's avatar
      Move "target has RTS linker" out of settings · c17bb82f
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      We move the "target has RTS linker" information out of configure into a
      predicate in GHC, and remove this option from the settings file where it
      is unnecessary -- it's information statically known from the platform.
      
      Note that previously we would consider `powerpc`s and `s390x`s other
      than `powerpc-ibm-aix*` and `s390x-ibm-linux` to have an RTS linker,
      but the RTS linker supports neither platform.
      
      Closes #23361
      c17bb82f
  11. Mar 06, 2023
  12. Jan 28, 2023
  13. Jan 10, 2023
  14. Jan 06, 2023
  15. Dec 21, 2022
  16. Nov 11, 2022
  17. Aug 26, 2022
  18. Aug 07, 2022
    • Ben Gamari's avatar
      hadrian: Don't use mk/config.mk.in · afa584a3
      Ben Gamari authored
      Ultimately we want to drop mk/config.mk so here I extract the bits
      needed by the Hadrian bindist installation logic into a Hadrian-specific
      file. While doing this I fixed binary distribution installation, #21901.
      afa584a3
    • Ben Gamari's avatar
      hadrian: Fix binary distribution install attributes · 09bca1de
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously we would use plain `cp` to install various parts of the
      binary distribution. However, `cp`'s behavior w.r.t. file attributes is
      quite unclear; for this reason it is much better to rather use
      `install`.
      
      Fixes #21965.
      09bca1de
  19. Jul 18, 2022
  20. Jul 04, 2022
    • Matthew Pickering's avatar
      hadrian: Add --haddock-base-url option for specifying base-url when generating docs · d002c6e0
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      The motiviation for this flag is to be able to produce documentation
      which is suitable for uploading for hackage, ie, the cross-package links
      work correctly.
      
      There are basically three values you want to set this to:
      
      * off - default, base_url = ../%pkg% which works for local browsing
      * on - no argument , base_url = https:://hackage.haskell.org/package/%pkg%/docs - for hackage docs upload
      * on - argument, for example, base_url = http://localhost:8080/package/%pkg%/docs for testing the documentation.
      
      The `%pkg%` string is a template variable which is replaced with the
      package identifier for the relevant package.
      
      This is one step towards fixing #21749
      d002c6e0
  21. May 26, 2022
  22. May 19, 2022
    • Ben Gamari's avatar
      configure: Check CC_STAGE0 for --target support · 35bdab1c
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      We previously only checked the stage 1/2 compiler
      for --target support. We got away with this for quite a while but it
      eventually caught up with us in #21579, where `bytestring`'s new NEON
      implementation was unbuildable on Darwin due to Rosetta's seemingly
      random logic for determining which executable image to execute. This
      lead to a confusing failure to build `bytestring`'s cbits, when `clang`
      tried to compile NEON builtins while targetting x86-64.
      
      Fix this by checking CC_STAGE0 for --target support.
      
      Fixes #21579.
      35bdab1c
  23. May 17, 2022
    • Ben Gamari's avatar
      Introduce package to capture dependency on C++ stdlib · 0ef249aa
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we introduce a new "virtual" package into the initial package
      database, `system-cxx-std-lib`. This gives users a convenient, platform
      agnostic way to link against C++ libraries, addressing #20010.
      
      Fixes #20010.
      0ef249aa
    • Ben Gamari's avatar
      driver: Introduce pgmcxx · fb579e15
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Here we introduce proper support for compilation of C++ objects. This
      includes:
      
       * logic in `configure` to detect the C++ toolchain and propagating this
         information into the `settings` file
       * logic in the driver to use the C++ toolchain when compiling C++
         sources
      fb579e15
  24. May 11, 2022
  25. Apr 06, 2022
  26. Mar 07, 2022
  27. Nov 27, 2021
  28. Oct 31, 2021
  29. Oct 20, 2021
    • Ben Gamari's avatar
      hadrian: Fix binary-dist support for cross-compilers · 5f274fbf
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Previously the logic which called ghc-pkg failed to account for the fact
      that the executable name may be prefixed with a triple. Moreover, the
      call must occur before we delete the settings file as ghc-pkg needs the
      latter.
      
      Fixes #20267.
      5f274fbf
  30. Oct 13, 2021
  31. Sep 23, 2021
  32. Sep 22, 2021
  33. Sep 11, 2021
Loading