[Git][ghc/ghc][wip/toolchain-selection] 37 commits: Configure CPP into settings

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon May 29 13:40:01 UTC 2023



Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC


Commits:
0f2495a8 by Rodrigo Mesquita at 2023-05-29T12:34:51+01: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

- - - - -
e466605e by Ben Gamari at 2023-05-29T14:33:46+01:00
configure: Rip out Solaris dyld check

Solaris 11 was released over a decade ago and, moreover, I doubt we have
any Solaris users

- - - - -
2e0524f9 by Ben Gamari at 2023-05-29T14:34:14+01:00
ghc-toolchain: Initial commit

- - - - -
97a82a82 by Ben Gamari at 2023-05-29T14:35:48+01:00
Move via-C flags into GHC

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.

- - - - -
f61b94c9 by Ben Gamari at 2023-05-29T14:35:48+01:00
configure: Rip out toolchain selection logic

- - - - -
71f1dd39 by Ben Gamari at 2023-05-29T14:35:48+01:00
Fixes

- - - - -
cc63ff07 by Rodrigo Mesquita at 2023-05-29T14:35:48+01:00
ghc-toolchain: Rename readProcess to readProcessStdout

Fixes bugs regarding a translation from the original autconf program
that failed to account for the exit code.

The longer name reenforces that we really only care about the stdout,
and the exit code and stderr of the program are irrelevant for the case.

- - - - -
9174f095 by Rodrigo Mesquita at 2023-05-29T14:35:48+01:00
Re-introduce ld-override option

- - - - -
9ab01e51 by Rodrigo Mesquita at 2023-05-29T14:39:50+01:00
ROMES:WIP

- - - - -
b62687bf by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ghc-toolchain library and usage in hadrian flags

- - - - -
0e829b33 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ROMES: WIP

- - - - -
8eb31dc1 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Re-introduce flags in hadrian config

- - - - -
e77ceac6 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ROMES WIP

- - - - -
ad193863 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ghc-toolchain: UseLibFFI, LdCompactUnwind, LdFileList

A more complete ghc-toolchain.
Added configuration of:

* Use libffi for adjustors
* Supports compact unwind
* Supports filelist

- - - - -
3e19cb2c by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Handle passing CPP cmd and flags from configure to ghc-toolchain

- - - - -
42f64fd1 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Rip more of configure that is no longer being used

- - - - -
769482a0 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Remove configure checks of GNUnoexecStack and ident directive

And fix bug in ghc-toolchain respective code

- - - - -
c51d5ed7 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Rip out more from hadrians system.config.in

- - - - -
85d273c7 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Configure CLink supports response files

- - - - -
b6c962d5 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Read deleted keys from host and target's target

- - - - -
175a7139 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ROMES: WIP 3

- - - - -
971c6125 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Delete CMD_OPTS_STAGEX

Instead of having configure configure different options for different
programs depend on the stage, we delete this completely and have hadrian
select the correct target toolchain configuration file depending on the
stage, from which it can read those options.

- - - - -
ea40aade by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]

- - - - -
ae4ea31b by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Handle unspecified vs specified flags and commands better

- - - - -
5ae5f357 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ROMES: WIP 4

- - - - -
f48aa614 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Configure Cpp and HsCpp separately

- - - - -
3c85c98c by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Fixes for compilation

- - - - -
7fc65804 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Link is GNU linkerg

- - - - -
7ee0354a by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
ROMES: WIP 5

- - - - -
944d5fef by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Revert "Rip more of configure that is no longer being used"

I realized we still need this function in rts/configure.ac

This reverts commit 01f5d4b480f4ab1514ac0a4fc957db199d1a0279.

- - - - -
1f5c111c by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Revert get_arm_isa deletion from 74f03f243d08aa910d39cdd9dadb976e9386283a

As in the previous commit, we still need this info from the rts
configure script.

I suppose it could be useful for the rts to also read somehow the
toolchain information...

- - - - -
0be70d89 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
helper AC function for enable/disable

- - - - -
321ce008 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Delete unused imports of SysTools.Info

- - - - -
0793d743 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Drop PROG_CPP in distrib/autoconf too

- - - - -
7e9ec6b5 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Delete trailing whitespace

- - - - -
b076bec4 by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Delete trailing whitespace

- - - - -
7891623e by Rodrigo Mesquita at 2023-05-29T14:39:52+01:00
Get rid of MonadCatch instances and dependencies

- - - - -


30 changed files:

- 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/Linker/Static.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
- configure.ac
- distrib/configure.ac.in
- hadrian/bindist/Makefile
- hadrian/cabal.project
- hadrian/cfg/system.config.in
- hadrian/hadrian.cabal
- hadrian/src/Base.hs
- hadrian/src/Builder.hs
- hadrian/src/Context.hs
- hadrian/src/Hadrian/Haskell/Hash.hs
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Oracles/Flag.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Generate.hs
- hadrian/src/Rules/Gmp.hs
- hadrian/src/Rules/Libffi.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b58ffb71bf7fe28e5e2484f0cc7ea1e6036b522b...7891623edd386d8bde976ab59255ad66e92a4a46

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b58ffb71bf7fe28e5e2484f0cc7ea1e6036b522b...7891623edd386d8bde976ab59255ad66e92a4a46
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/20230529/01326ae2/attachment-0001.html>


More information about the ghc-commits mailing list