Skip to content
Snippets Groups Projects
  1. Aug 16, 2023
  2. 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
  3. Aug 04, 2023
  4. Jul 26, 2023
    • Rodrigo Mesquita's avatar
      configure: Default missing options to False when preparing ghc-toolchain Targets · 20db7e26
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      This commit fixes building ghc with 9.2 as the boostrap compiler.
      
      The ghc-toolchain patch assumed all _STAGE0 options were available, and
      forgot to account for this missing information in 9.2.
      
      Ghc 9.2 does not have in settings whether ar supports -l, hence can't
      report it with --info (unliked 9.4 upwards).
      
      The fix is to default the missing information (we default "ar supports
      -l" and other missing options to False)
      20db7e26
  5. 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
      Split ghc-toolchain executable to new packge · 61eea240
      Rodrigo Mesquita authored and Matthew Pickering's avatar Matthew Pickering committed
      In light of #23690, we split the ghc-toolchain executable out of the
      library package to be able to ship it in the bindist using Hadrian.
      
      Ideally, we eventually revert this commit.
      61eea240
    • 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
  6. Jul 15, 2023
  7. Jul 13, 2023
    • Rodrigo Mesquita's avatar
      configure: Drop DllWrap command · 5e951395
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      We used to configure into settings a DllWrap command for windows
      builds and distributions, however, we no longer do, and dllwrap is
      effectively unused.
      
      This simplification is motivated in part by the larger
      toolchain-selection project (#19877, !9263)
      5e951395
  8. Jul 08, 2023
    • Ben Gamari's avatar
      configure: Don't use ld.gold on i386 · c7026962
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      ld.gold appears to produce invalid static constructor tables on i386.
      While ideally we would add an autoconf check to check for this
      brokenness, sadly such a check isn't easy to compose. Instead to
      summarily reject such linkers on i386.
      
      Somewhat hackily closes #23579.
      c7026962
  9. Jul 05, 2023
  10. Jun 29, 2023
    • Ben Gamari's avatar
      Rip out runtime linker/compiler checks · b1e611d5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      We used to choose flags to pass to the toolchain at runtime based on the
      platform running GHC, and in this commit we drop all of those runtime
      linker checks
      
      Ultimately, this represents a change in policy: We no longer adapt at
      runtime to the toolchain being used, but rather make final decisions
      about the toolchain used at /configure time/
      (we have deleted Note [Run-time linker info] altogether!).
      
      This works towards the goal of having all toolchain configuration logic
      living in the same place, which facilities the work towards a
      runtime-retargetable GHC (see #19877).
      
      As of this commit, the runtime linker/compiler logic was moved to
      autoconf, but soon it, and the rest of the existing toolchain
      configuration logic, will live in the standalone ghc-toolchain program
      (see !9263)
      
      In particular, what used to be done at runtime is now as follows:
      * The flags -Wl,--no-as-needed for needed shared libs are configured
        into settings
      * The flag -fstack-check is configured into settings
      * The check for broken tables-next-to-code was outdated
      * We use the configured c compiler by default as the assembler program
      * We drop `asmOpts` because we already configure -Qunused-arguments flag
        into settings (see !10589)
      
      Fixes #23562
      
      Co-author: Rodrigo Mesquita (@alt-romes)
      b1e611d5
    • 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
  11. 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
  12. Jun 19, 2023
    • Finley McIlwaine's avatar
      IPE data compression · cb9e1ce4
      Finley McIlwaine authored
      IPE data resulting from the `-finfo-table-map` flag may now be
      compressed by configuring the GHC build with the
      `--enable-ipe-data-compression` flag. This results in about a 20%
      reduction in the size of IPE-enabled build results.
      
      The compression library, zstd, may optionally be statically linked by
      configuring with the `--enabled-static-libzstd` flag (on non-darwin
      platforms)
      
      libzstd version 1.4.0 or greater is required.
      cb9e1ce4
  13. 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
  14. Jun 07, 2023
  15. Jun 01, 2023
  16. 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
  17. May 24, 2023
    • Rodrigo Mesquita's avatar
      configure: Fix support check for response files. · a320ca76
      Rodrigo Mesquita authored and Marge Bot's avatar Marge Bot committed
      In failing to escape the '-o' in '-o\nconftest\nconftest.o\n' argument
      to printf, the writing of the arguments response file always failed.
      
      The fix is to pass the arguments after `--` so that they are treated
      positional arguments rather than flags to printf.
      
      Closes #23435
      a320ca76
  18. May 18, 2023
  19. May 15, 2023
  20. Mar 16, 2023
    • Ben Gamari's avatar
      configure: Fix FIND_CXX_STD_LIB test on Darwin · 6e3ce9a4
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Annoyingly, Darwin's <cstddef> includes <version> and APFS is
      case-insensitive. Consequently, it will end up #including the
      `VERSION` file generated by the `configure` script on the second
      and subsequent runs of the `configure` script.
      
      See #23116.
      6e3ce9a4
Loading