[Git][ghc/ghc][wip/toolchain-selection] ROMES: WIP 3

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon May 15 16:01:00 UTC 2023



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


Commits:
0cc52a47 by Rodrigo Mesquita at 2023-05-15T17:00:53+01:00
ROMES: WIP 3

- - - - -


5 changed files:

- hadrian/cfg/system.config.in
- hadrian/src/Hadrian/Oracles/TextFile.hs
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- m4/fptools_set_haskell_platform_vars.m4


Changes:

=====================================
hadrian/cfg/system.config.in
=====================================
@@ -49,20 +49,30 @@ leading-underscore   = @LeadingUnderscore@
 # Information about build, host and target systems:
 #==================================================
 
+# ROMES:TODO: Deal with vendor
+
 build-platform        = @BuildPlatform@
+
 build-arch            = @BuildArch_CPP@
 build-os              = @BuildOS_CPP@
+
 build-vendor          = @BuildVendor_CPP@
 
 host-platform         = @HostPlatform@
+
+# ROMES:TODO: These will be computed from the function in ghc-toolchain mapped from the Haskell constructor name.
 host-arch             = @HostArch_CPP@
 host-os               = @HostOS_CPP@
+
 host-vendor           = @HostVendor_CPP@
 
 target-platform       = @TargetPlatform@
 target-platform-full  = @TargetPlatformFull@
+
+# ROMES:TODO: These will be computed from the function in ghc-toolchain mapped from the Haskell constructor name.
 target-arch           = @TargetArch_CPP@
 target-os             = @TargetOS_CPP@
+
 target-vendor         = @TargetVendor_CPP@
 llvm-target           = @LLVMTarget_CPP@
 
@@ -75,7 +85,7 @@ ghc-major-version     = @GhcMajVersion@
 ghc-minor-version     = @GhcMinVersion@
 ghc-patch-level       = @GhcPatchLevel@
 
-bootstrap-threaded-rts      = @GhcThreadedRts@
+bootstrap-threaded-rts = @GhcThreadedRts@
 
 project-name           = @ProjectName@
 project-version        = @ProjectVersion@
@@ -86,35 +96,6 @@ project-patch-level1   = @ProjectPatchLevel1@
 project-patch-level2   = @ProjectPatchLevel2@
 project-git-commit-id  = @ProjectGitCommitId@
 
-# Compilation and linking flags:
-#===============================
-
-conf-cc-args-stage0         = @CONF_CC_OPTS_STAGE0@
-conf-cc-args-stage1         = @CONF_CC_OPTS_STAGE1@
-conf-cc-args-stage2         = @CONF_CC_OPTS_STAGE2@
-conf-cc-args-stage3         = @CONF_CC_OPTS_STAGE3@
-
-conf-cpp-args-stage0        = @CONF_CPP_OPTS_STAGE0@
-conf-cpp-args-stage1        = @CONF_CPP_OPTS_STAGE1@
-conf-cpp-args-stage2        = @CONF_CPP_OPTS_STAGE2@
-conf-cpp-args-stage3        = @CONF_CPP_OPTS_STAGE3@
-
-conf-gcc-linker-args-stage0 = @CONF_GCC_LINKER_OPTS_STAGE0@
-conf-gcc-linker-args-stage1 = @CONF_GCC_LINKER_OPTS_STAGE1@
-conf-gcc-linker-args-stage2 = @CONF_GCC_LINKER_OPTS_STAGE2@
-conf-gcc-linker-args-stage3 = @CONF_GCC_LINKER_OPTS_STAGE3@
-
-conf-ld-linker-args-stage0  = @CONF_LD_LINKER_OPTS_STAGE0@
-conf-ld-linker-args-stage1  = @CONF_LD_LINKER_OPTS_STAGE1@
-conf-ld-linker-args-stage2  = @CONF_LD_LINKER_OPTS_STAGE2@
-conf-ld-linker-args-stage3  = @CONF_LD_LINKER_OPTS_STAGE3@
-
-conf-merge-objects-args-stage0  = @MergeObjsArgs@
-conf-merge-objects-args-stage1  = @MergeObjsArgs@
-conf-merge-objects-args-stage2  = @MergeObjsArgs@
-conf-merge-objects-args-stage3  = @MergeObjsArgs@
-
-
 # Settings:
 #==========
 
@@ -126,6 +107,7 @@ conf-merge-objects-args-stage3  = @MergeObjsArgs@
 gcc-extra-via-c-opts = @GccExtraViaCOpts@
 ld-is-gnu-ld = @LdIsGNULd@
 
+# ROMES:TODO: Drop almost every of these from settings.
 settings-c-compiler-command = @SettingsCCompilerCommand@
 settings-cxx-compiler-command = @SettingsCxxCompilerCommand@
 settings-haskell-cpp-command = @SettingsHaskellCPPCommand@


=====================================
hadrian/src/Hadrian/Oracles/TextFile.hs
=====================================
@@ -163,5 +163,5 @@ instance Hashable Toolchain.Target where
   hashWithSalt s = hashWithSalt s . show
 
 instance NFData Toolchain.Target where
-  rnf = flip seq () -- ROMES:TODO: Is this a good enough instance?
+  rnf = flip seq () -- ROMES:TODO: Would be better to do this well, but it isn't easy to make instances for Target
 


=====================================
hadrian/src/Oracles/Setting.hs
=====================================
@@ -135,6 +135,8 @@ data ToolchainSetting
 
 -- | Look up the value of a 'Setting' in @cfg/system.config@, tracking the
 -- result.
+-- ROMES:TODO: Things that are gotten from the toolchain configs will no longer
+-- be part of settings, so they should be moved out
 setting :: Setting -> Action String
 setting key = case key of
     BuildArch          -> systemConf "build-arch"
@@ -153,7 +155,6 @@ setting key = case key of
     GhcSourcePath      -> systemConf "ghc-source-path"
     GmpIncludeDir      -> systemConf "gmp-include-dir"
     GmpLibDir          -> systemConf "gmp-lib-dir"
-    -- ROMES:TODO: What's the difference between hostArch and hostArchHaskell?
     HostArch           -> systemConf "host-arch"
     HostOs             -> systemConf "host-os"
     HostPlatform       -> systemConf "host-platform"


=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -362,6 +362,9 @@ cppify :: String -> String
 cppify = replaceEq '-' '_' . replaceEq '.' '_'
 
 -- | Generate @ghcplatform.h@ header.
+-- ROMES:TODO: These will eventually have to be determined at runtime, and no
+-- longer hardcoded to a file (passed as -D flags to the preprocessor,
+-- probably)
 generateGhcPlatformH :: Expr String
 generateGhcPlatformH = do
     trackGenerateHs


=====================================
m4/fptools_set_haskell_platform_vars.m4
=====================================
@@ -40,4 +40,7 @@ AC_DEFUN([GHC_SUBSECTIONS_VIA_SYMBOLS],
          AC_MSG_RESULT(no)])
 ])
 
-# ROMES:TODO: We can't still remove this because of the DEFINE HAVE_SUBSECTIONS_VIA_SYMBOLS 1, which is used in the rts
+# ROMES:TODO: We can't still remove this because of the #DEFINE HAVE_SUBSECTIONS_VIA_SYMBOLS 1, which is used in the rts
+# We might have to generate a bunch of -D CPP flags to satisfy these dependencies (future work).
+
+



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cc52a47ffb63f6e3dfd79d48cf1100e383e32cc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0cc52a47ffb63f6e3dfd79d48cf1100e383e32cc
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/20230515/a690925d/attachment-0001.html>


More information about the ghc-commits mailing list