[Git][ghc/ghc][wip/marge_bot_batch_merge_job] 4 commits: Configure CPP into settings

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Jun 28 02:27:46 UTC 2023



Marge Bot pushed to branch wip/marge_bot_batch_merge_job at Glasgow Haskell Compiler / GHC


Commits:
7cb6b12a by Rodrigo Mesquita at 2023-06-27T22:27:36-04:00
Configure CPP into settings

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

- - - - -
799f4b71 by aadaa_fgtaa at 2023-06-27T22:27:39-04:00
Optimise ELF linker (#23464)

- cache last elements of `relTable`, `relaTable` and `symbolTables` in `ocInit_ELF`
- cache shndx table in ObjectCode
- run `checkProddableBlock` only with debug rts

- - - - -
b7fd9d0f by Rodrigo Mesquita at 2023-06-27T22:27:40-04:00
Configure MergeObjs supports response files rather than Ld

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

- - - - -
bb0eb710 by Ben Gamari at 2023-06-27T22:27:41-04:00
Rip out runtime linker/compiler checks

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)

- - - - -


30 changed files:

- compiler/GHC/Driver/Backend.hs
- compiler/GHC/Driver/DynFlags.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Pipeline/Execute.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Linker/ExtraObj.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/StgToJS/Linker/Linker.hs
- compiler/GHC/SysTools.hs
- compiler/GHC/SysTools/Cpp.hs
- − compiler/GHC/SysTools/Info.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/ghc.cabal.in
- configure.ac
- distrib/configure.ac.in
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/cfg/system.config.in
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Settings/Builders/Ghc.hs
- hadrian/src/Settings/Builders/Hsc2Hs.hs
- m4/fp_cpp_cmd_with_args.m4
- + m4/fp_hs_cpp_cmd_with_args.m4
- − m4/fp_ld_supports_response_files.m4
- + m4/fp_link_supports_no_as_needed.m4
- + m4/fp_merge_objects_supports_response_files.m4
- m4/fp_settings.m4
- m4/fptools_set_c_ld_flags.m4


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/12f0fb5afa382e1da45d4e8dd3b3a10c353fde24...bb0eb7104298be878567bd9f15919f538fff2bc1

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/12f0fb5afa382e1da45d4e8dd3b3a10c353fde24...bb0eb7104298be878567bd9f15919f538fff2bc1
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230627/e34219ac/attachment.html>


More information about the ghc-commits mailing list