[Git][ghc/ghc][wip/toolchain-selection] Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]

Rodrigo Mesquita (@alt-romes) gitlab at gitlab.haskell.org
Mon May 15 18:02:04 UTC 2023



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


Commits:
5fd71a5b by Rodrigo Mesquita at 2023-05-15T19:01:47+01:00
Fix [host|target]-[os|arch] vs [host|target]-haskell-[os|arch]

- - - - -


4 changed files:

- configure.ac
- hadrian/cfg/system.config.in
- hadrian/src/Oracles/Setting.hs
- m4/fptools_set_platform_vars.m4


Changes:

=====================================
configure.ac
=====================================
@@ -482,10 +482,8 @@ AC_ARG_WITH(hs-cpp-flags,
 AC_SUBST([HaskellCPPCmd])
 AC_SUBST([HaskellCPPArgs])
 
+dnl ROMES:TODO: Are we setting the C99 flags in ghc-toolchain already?
 FP_SET_CFLAGS_C99([CC],[CFLAGS],[CPPFLAGS])
-FP_SET_CFLAGS_C99([CC_STAGE0],[CONF_CC_OPTS_STAGE0],[CONF_CPP_OPTS_STAGE0])
-FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE1],[CONF_CPP_OPTS_STAGE1])
-FP_SET_CFLAGS_C99([CC],[CONF_CC_OPTS_STAGE2],[CONF_CPP_OPTS_STAGE2])
 
 dnl ** Which ld to use
 dnl --------------------------------------------------------------


=====================================
hadrian/cfg/system.config.in
=====================================
@@ -52,27 +52,13 @@ leading-underscore   = @LeadingUnderscore@
 # 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@
 


=====================================
hadrian/src/Oracles/Setting.hs
=====================================
@@ -137,12 +137,12 @@ setting key = case key of
     GhcSourcePath      -> systemConf "ghc-source-path"
     GmpIncludeDir      -> systemConf "gmp-include-dir"
     GmpLibDir          -> systemConf "gmp-lib-dir"
-    HostArch           -> systemConf "host-arch"
-    HostOs             -> systemConf "host-os"
+    HostArch           -> hostConf archStr
+    HostOs             -> hostConf osStr
     HostPlatform       -> systemConf "host-platform"
     HostVendor         -> systemConf "host-vendor"
-    HostArchHaskell    -> hostConf archStr
-    HostOsHaskell      -> hostConf osStr
+    HostArchHaskell    -> hostConf (show . archHaskell)
+    HostOsHaskell      -> hostConf (show . osHaskell)
     IconvIncludeDir    -> systemConf "iconv-include-dir"
     IconvLibDir        -> systemConf "iconv-lib-dir"
     LibdwIncludeDir    -> systemConf "libdw-include-dir"
@@ -159,22 +159,24 @@ setting key = case key of
     ProjectPatchLevel1 -> systemConf "project-patch-level1"
     ProjectPatchLevel2 -> systemConf "project-patch-level2"
     SystemGhc          -> systemConf "system-ghc"
-    TargetArch         -> systemConf "target-arch"
+    TargetArch         -> targetConf archStr
     TargetArmVersion   -> systemConf "target-arm-version"
-    TargetOs           -> systemConf "target-os"
+    TargetOs           -> targetConf osStr
     TargetPlatform     -> systemConf "target-platform"
     TargetPlatformFull -> systemConf "target-platform-full"
     TargetVendor       -> systemConf "target-vendor"
-    TargetArchHaskell  -> targetConf archStr
-    TargetOsHaskell    -> targetConf osStr
+    TargetArchHaskell  -> targetConf (show . archHaskell)
+    TargetOsHaskell    -> targetConf (show . osHaskell)
     TargetWordSize     -> systemConf "target-word-size" -- targetConf tgtWordSize
     BourneShell        -> systemConf "bourne-shell"
   where
     systemConf = lookupSystemConfig
     targetConf = queryTargetTargetConfig
     hostConf   = queryHostTargetConfig
-    archStr    = stringEncodeArch . archOS_arch . tgtArchOs
-    osStr      = stringEncodeOS   . archOS_OS   . tgtArchOs
+    archStr     = stringEncodeArch . archHaskell
+    osStr       = stringEncodeOS   . osHaskell
+    archHaskell = archOS_arch . tgtArchOs
+    osHaskell   = archOS_OS   . tgtArchOs
 
 -- | Look up the value of a 'SettingList' in @cfg/system.config@, tracking the
 -- result.


=====================================
m4/fptools_set_platform_vars.m4
=====================================
@@ -1,3 +1,5 @@
+# ROMES:TODO: We no longer use these e.g. BuildArch_CPP variables.
+# Delete this file but do so carefully...
 # FPTOOLS_SET_PLATFORMS_VARS
 # ----------------------------------
 # Set all the platform variables. First massage the default autoconf



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fd71a5b3192b3c54315739fc72800f98a7c5153

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5fd71a5b3192b3c54315739fc72800f98a7c5153
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/e01ee3e1/attachment-0001.html>


More information about the ghc-commits mailing list