Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC Commits: 8d7e912f by Rodrigo Mesquita at 2025-09-12T17:57:24-04:00 ghc-toolchain: Use ByteOrder rather than new Endianness Don't introduce a duplicate datatype when the previous one is equivalent and already used elsewhere. This avoids unnecessary translation between the two. - - - - - 7d378476 by Rodrigo Mesquita at 2025-09-12T17:57:24-04:00 Read Toolchain.Target files rather than 'settings' This commit makes GHC read `lib/targets/default.target`, a file with a serialized value of `ghc-toolchain`'s `GHC.Toolchain.Target`. Moreover, it removes all the now-redundant entries from `lib/settings` that are configured as part of a `Target` but were being written into `settings`. This makes it easier to support multiple targets from the same compiler (aka runtime retargetability). `ghc-toolchain` can be re-run many times standalone to produce a `Target` description for different targets, and, in the future, GHC will be able to pick at runtime amongst different `Target` files. This commit only makes it read the default `Target` configured in-tree or configured when installing the bindist. The remaining bits of `settings` need to be moved to `Target` in follow up commits, but ultimately they all should be moved since they are per-target relevant. Fixes #24212 On Windows, the constant overhead of parsing a slightly more complex data structure causes some small-allocation tests to wiggle around 1 to 2 extra MB (1-2% in these cases). ------------------------- Metric Increase: MultiLayerModulesTH_OneShot T10421 T10547 T12234 T12425 T13035 T18140 T18923 T9198 TcPlugin_RewritePerf ------------------------- - - - - - e0780a16 by Rodrigo Mesquita at 2025-09-12T17:57:24-04:00 ghc-toolchain: Move TgtHasLibm to per-Target file TargetHasLibm is now part of the per-target configuration Towards #26227 - - - - - 8235dd8c by Rodrigo Mesquita at 2025-09-12T17:57:24-04:00 ghc-toolchain: Move UseLibdw to per-Target file To support DWARF unwinding, the RTS must be built with the -f+libdw flag and with the -DUSE_LIBDW macro definition. These flags are passed on build by Hadrian when --enable-dwarf-unwinding is specified at configure time. Whether the RTS was built with support for DWARF is a per-target property, and as such, it was moved to the per-target GHC.Toolchain.Target.Target file. Additionally, we keep in the target file the include and library paths for finding libdw, since libdw should be checked at configure time (be it by configure, or ghc-toolchain, that libdw is properly available). Preserving the user-given include paths for libdw facilitates in the future building the RTS on demand for a given target (if we didn't keep that user input, we couldn't) Towards #26227 - - - - - d5ecf2e8 by Rodrigo Mesquita at 2025-09-12T17:57:25-04:00 ghc-toolchain: Make "Support SMP" a query on a Toolchain.Target "Support SMP" is merely a function of target, so we can represent it as such in `ghc-toolchain`. Hadrian queries the Target using this predicate to determine how to build GHC, and GHC queries the Target similarly to report under --info whether it "Support SMP" Towards #26227 - - - - - e07b031a by Rodrigo Mesquita at 2025-09-12T17:57:25-04:00 ghc-toolchain: Make "tgt rts linker only supports shared libs" function on Target Just like with "Support SMP", "target RTS linker only supports shared libraries" is a predicate on a `Target` so we can just compute it when necessary from the given `Target`. Towards #26227 - - - - - 41 changed files: - compiler/GHC/Driver/DynFlags.hs - compiler/GHC/Driver/Session.hs - compiler/GHC/Settings.hs - compiler/GHC/Settings/IO.hs - compiler/GHC/SysTools/BaseDir.hs - compiler/ghc.cabal.in - configure.ac - distrib/configure.ac.in - hadrian/bindist/Makefile - hadrian/bindist/config.mk.in - hadrian/cfg/default.host.target.in - hadrian/cfg/default.target.in - hadrian/cfg/system.config.in - hadrian/src/Base.hs - hadrian/src/Oracles/Flag.hs - hadrian/src/Oracles/Setting.hs - hadrian/src/Rules/Generate.hs - hadrian/src/Settings/Packages.hs - libraries/ghc-boot/GHC/Settings/Utils.hs - libraries/ghc-boot/ghc-boot.cabal.in - libraries/ghc-internal/src/GHC/Internal/ResponseFile.hs - m4/fp_find_libdw.m4 - − m4/fp_settings.m4 - m4/fp_setup_windows_toolchain.m4 - m4/ghc_toolchain.m4 - m4/prep_target_file.m4 - + m4/subst_tooldir.m4 - mk/hsc2hs.in - testsuite/tests/ghc-api/T20757.hs - testsuite/tests/ghc-api/settings-escape/T24265.hs - testsuite/tests/ghc-api/settings-escape/T24265.stderr - + testsuite/tests/ghc-api/settings-escape/ghc-install-folder/lib with spaces/targets/.gitkeep - utils/ghc-pkg/Main.hs - utils/ghc-pkg/ghc-pkg.cabal.in - utils/ghc-toolchain/exe/Main.hs - utils/ghc-toolchain/ghc-toolchain.cabal - + utils/ghc-toolchain/src/GHC/Toolchain/Library.hs - utils/ghc-toolchain/src/GHC/Toolchain/PlatformDetails.hs - utils/ghc-toolchain/src/GHC/Toolchain/Target.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cpp.hs - utils/ghc-toolchain/src/GHC/Toolchain/Tools/Cxx.hs The diff was not included because it is too large. View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/418fa78f26d5d2b758899a0825a3c4c... -- View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/418fa78f26d5d2b758899a0825a3c4c... You're receiving this email because of your account on gitlab.haskell.org.