[Git][ghc/ghc][wip/toolchain-selection] 10 commits: Stop configuring into settings unused Ld command

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon Jun 26 21:19:11 UTC 2023



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


Commits:
9ee6d789 by Rodrigo Mesquita at 2023-06-26T22:16:11+01:00
Stop configuring into settings unused Ld command

- - - - -
cf389a6d by Rodrigo Mesquita at 2023-06-26T22:16:11+01: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

- - - - -
625ad17c by Ben Gamari at 2023-06-26T22:16:11+01:00
ghc-toolchain: Initial commit

- - - - -
99752b0c by Ben Gamari at 2023-06-26T22:16:11+01: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.

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)

Co-author: Rodrigo Mesquita (@alt-romes)

- - - - -
c84b6ab9 by Rodrigo Mesquita at 2023-06-26T22:16:11+01:00
Create ghc_toolchain.m4

Don't pass options to ghc-toolchain, it should arrive at the same conclusion as configure for now

- - - - -
eba07800 by Rodrigo Mesquita at 2023-06-26T22:18:32+01:00
ghc-toolchain: Toolchain Selection

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.

Fixes

Re-introduce ld-override option

ghc-toolchain library and usage in hadrian flags

Re-introduce flags in hadrian config

ghc-toolchain: UseLibFFI, LdCompactUnwind, LdFileList

A more complete ghc-toolchain.
Added configuration of:

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

Handle passing CPP cmd and flags from configure to ghc-toolchain

Rip more of configure that is no longer being used

Remove configure checks of GNUnoexecStack and ident directive

And fix bug in ghc-toolchain respective code

Rip out more from hadrians system.config.in

Configure CLink supports response files

Read deleted keys from host and target's target

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.

Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]

Handle unspecified vs specified flags and commands better

Configure Cpp and HsCpp separately

Fixes for compilation

Link is GNU linkerg

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 01f5d4b4.

Revert get_arm_isa deletion from 74f03f24

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...

helper AC function for enable/disable

Delete unused imports of SysTools.Info

Drop PROG_CPP in distrib/autoconf too

Get rid of MonadCatch instances and dependencies

ghc-toolchain: Check Cc supports extra-via-c-flags

Consider empty programs as non-specified programs

Cpp and HsCpp cleanup

Add comment from check for gold t22266

Remove more settings bits from hadrian/cfg

Use llvm target from ghc-toolchain

Print default.target

Fix bugs in MergeTool and Ar

Add check and log errors on error

X

Revert LLVMTarget deletion in mkprojectmkin

Fix stack job

Fixes for ghc-toolchain to match configure output

ghc-toolchain: Fix ar supports at file

Fixes

ghc-toolchain: Fix check for gold bug

ghc-toolchain: configure linker options correctly

Support more targets and dont use llvmtarget

allow duplos in place of triples

A TODO comment

- - - - -
60e19d57 by Rodrigo Mesquita at 2023-06-26T22:18:46+01:00
configure: Create and validate toolchain target file

- - - - -
b2d1c0ee by Rodrigo Mesquita at 2023-06-26T22:18:46+01:00
ghc-toolchain: set CC LD plat. dependent flags

A lot to be said about this approach, we might want to re-do this all
eventually...
Perhaps I ought to add a TODO at the top level of these functions?

We might also not do it altogether, some of these might be outdated?

- - - - -
5d5b7a45 by Rodrigo Mesquita at 2023-06-26T22:18:46+01:00
Split GHC.Platform.ArchOS from ghc-boot into ghc-platform

- - - - -
81ff5187 by Rodrigo Mesquita at 2023-06-26T22:18:46+01:00
Use ghc-platform instead of ghc-boot

- - - - -


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/Linker/ExtraObj.hs
- compiler/GHC/Linker/Static.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- compiler/GHC/SysTools.hs
- − compiler/GHC/SysTools/Info.hs
- compiler/GHC/SysTools/Tasks.hs
- compiler/ghc.cabal.in
- configure.ac
- + default.target.in
- distrib/configure.ac.in
- ghc/Main.hs
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- 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/Packages.hs
- hadrian/src/Rules/BinaryDist.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ce4566e51239a15a0df67d8de79ad0e37bf7af7f...81ff5187eee4aad09067c721c26763c010b49999

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/ce4566e51239a15a0df67d8de79ad0e37bf7af7f...81ff5187eee4aad09067c721c26763c010b49999
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/20230626/c3948380/attachment.html>


More information about the ghc-commits mailing list