Skip to content
Snippets Groups Projects
  1. Jul 03, 2023
  2. Jun 30, 2023
  3. Jun 29, 2023
    • Ben Gamari's avatar
      hadrian: Ignore warnings in unix and semaphore-compat · dec81dd1
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      dec81dd1
    • Ben Gamari's avatar
      rts: Various warnings fixes · cb92051e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      cb92051e
    • Ben Gamari's avatar
      rts/Trace: Ensure that debugTrace arguments are used · 7c7d1f66
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      As debugTrace is a macro we must take care to ensure that
      the fact is clear to the compiler lest we see warnings.
      7c7d1f66
    • Ben Gamari's avatar
      base: Fix incorrect CPP guard · d7ef1704
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This was guarded on `darwin_HOST_OS` instead of `defined(darwin_HOST_OS)`.
      d7ef1704
    • Ben Gamari's avatar
      Define FFI_GO_CLOSURES · 8b35e8ca
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      The libffi shipped with Apple's XCode toolchain does not contain a
      definition of the FFI_GO_CLOSURES macro, despite containing references
      to said macro. Work around this by defining the macro, following the
      model of a similar workaround in OpenJDK [1].
      
      [1] https://github.com/openjdk/jdk17u-dev/pull/741/files
      8b35e8ca
    • 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
    • Matthew Pickering's avatar
      Add -fpolymorphic-specialisation flag (off by default at all optimisation levels) · 9f01d14b
      Matthew Pickering authored and Marge Bot's avatar Marge Bot committed
      Polymorphic specialisation has led to a number of hard to diagnose
      incorrect runtime result bugs (see #23469, #23109, #21229, #23445) so
      this commit introduces a flag `-fpolymorhphic-specialisation` which
      allows users to turn on this experimental optimisation if they are
      willing to buy into things going very wrong.
      
      Ticket #23469
      9f01d14b
    • Sylvain Henry's avatar
      JS: fix JS stack printing (#23565) · 78b2f3cc
      Sylvain Henry authored and Marge Bot's avatar Marge Bot committed
      78b2f3cc
    • 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
    • Ryan Scott's avatar
      Fix typechecking of promoted empty lists · c335fb7c
      Ryan Scott authored and Marge Bot's avatar Marge Bot committed
      The `'[]` case in `tc_infer_hs_type` is smart enough to handle arity-0 uses of
      `'[]` (see the newly added `T23543` test case for an example), but the `'[]`
      case in `tc_hs_type` was not. We fix this by changing the `tc_hs_type` case to
      invoke `tc_infer_hs_type`, as prescribed in `Note [Future-proofing the type
      checker]`.
      
      There are some benign changes to test cases' expected output due to the new
      code path using `forall a. [a]` as the kind of `'[]` rather than `[k]`.
      
      Fixes #23543.
      c335fb7c
    • Sven Tennie's avatar
      Fix number of free double regs · ef81a1eb
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      D1..D4 are defined for aarch64 and thus not free.
      ef81a1eb
    • Ben Gamari's avatar
      rts: Make collectFreshWeakPtrs definition a prototype · bb0ed354
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      x86-64/Darwin's toolchain inexplicably warns that collectFreshWeakPtrs
      needs to be a prototype.
      bb0ed354
    • Sven Tennie's avatar
      Delete write_barrier function · 9f63da66
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      9f63da66
    • Ben Gamari's avatar
      rts: Drop load_load_barrier · 7a7d326c
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This is no longer used.
      7a7d326c
    • Sven Tennie's avatar
      compiler: Drop MO_ReadBarrier · 0fc5cb97
      Sven Tennie authored and Marge Bot's avatar Marge Bot committed
      0fc5cb97
    • Ben Gamari's avatar
      rts: Eliminate remaining uses of load_load_barrier · 965ac2ba
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      965ac2ba
    • Ben Gamari's avatar
      rts: Drop last instances of prim_{write,read}_barrier · d5f2875e
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      d5f2875e
    • Ben Gamari's avatar
      rts: Drop load_store_barrier() · 7550b4a5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      This is no longer used.
      7550b4a5
    • Ben Gamari's avatar
      compiler: Drop MO_WriteBarrier · b787e259
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      rts: Drop write_barrier
      b787e259
    • Ben Gamari's avatar
      compiler: Introduce MO_{ACQUIRE,RELEASE}_FENCE · 30525b00
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      30525b00
    • aadaa-fgtaa's avatar
      Optimise ELF linker (#23464) · b3e1436f
      aadaa-fgtaa authored and Marge Bot's avatar Marge Bot committed
      - cache last elements of `relTable`, `relaTable` and `symbolTables` in `ocInit_ELF`
      - cache shndx table in ObjectCode
      - run `checkProddableBlock` only with debug rts
      b3e1436f
    • Ben Gamari's avatar
      hadrian: Always canonicalize topDirectory · 5efa9ca5
      Ben Gamari authored and Marge Bot's avatar Marge Bot committed
      Hadrian's `topDirectory` is intended to provide an absolute path to the
      root of the GHC tree. However, if the tree is reached via a symlink this
      
      One question here is whether the `canonicalizePath` call is expensive
      enough to warrant caching. In a quick microbenchmark I observed that
      `canonicalizePath "."` takes around 10us per call; this seems
      sufficiently low not to worry.
      
      Alternatively, another approach here would have been to rather move the
      canonicalization into `m4/fp_find_root.m4`. This would have avoided
      repeated canonicalization but sadly path canonicalization is a hard
      problem in POSIX shell.
      
      Addresses #22451.
      5efa9ca5
    • 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
  4. Jun 28, 2023
Loading