[Git][ghc/ghc][master] 2 commits: hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Wed Jun 5 15:36:04 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
accc8c33 by Cheng Shao at 2024-06-05T11:35:36-04:00
hadrian: don't depend on inplace/mingw when --enable-distro-toolchain on Windows

- - - - -
6ffbd678 by Cheng Shao at 2024-06-05T11:35:37-04:00
autoconf: normalize paths of some build-time dependencies on Windows

This commit applies path normalization via cygpath -m to some
build-time dependencies on Windows. Without this logic, the
/clang64/bin prefixed msys2-style paths cause the build to fail with
--enable-distro-toolchain.

- - - - -


4 changed files:

- configure.ac
- hadrian/src/Builder.hs
- m4/fp_find_nm.m4
- m4/fp_prog_ar_args.m4


Changes:

=====================================
configure.ac
=====================================
@@ -314,6 +314,8 @@ else
         AC_CHECK_TARGET_TOOL([WindresCmd],[windres])
         AC_CHECK_TARGET_TOOL([OBJDUMP],[objdump])
 
+        WindresCmd="$(cygpath -m $WindresCmd)"
+
         if test "$Genlib" != ""; then
             GenlibCmd="$(cygpath -m $Genlib)"
         fi
@@ -464,7 +466,12 @@ case $HostOS_CPP in
     ;;
 esac
 
-ObjdumpCmd="$OBJDUMP"
+if test "$HostOS" = "mingw32"
+then
+  ObjdumpCmd=$(cygpath -m "$OBJDUMP")
+else
+  ObjdumpCmd="$OBJDUMP"
+fi
 AC_SUBST([ObjdumpCmd])
 
 dnl ** Which ranlib to use?
@@ -473,7 +480,12 @@ AC_PROG_RANLIB
 if test "$RANLIB" = ":"; then
     AC_MSG_ERROR([cannot find ranlib in your PATH])
 fi
-RanlibCmd="$RANLIB"
+if test "$HostOS" = "mingw32"
+then
+  RanlibCmd=$(cygpath -m "$RANLIB")
+else
+  RanlibCmd="$RANLIB"
+fi
 AC_SUBST([RanlibCmd])
 
 dnl ** which strip to use?


=====================================
hadrian/src/Builder.hs
=====================================
@@ -34,6 +34,7 @@ import Base
 import Context
 import Oracles.Flag
 import Oracles.Setting (setting, Setting(..))
+import Oracles.Setting (settingsFileSetting, ToolchainSetting(..))
 import Packages
 
 import GHC.IO.Encoding (getFileSystemEncoding)
@@ -239,9 +240,10 @@ instance H.Builder Builder where
         Ghc {} -> do
             root <- buildRoot
             unlitPath  <- builderPath Unlit
+            distro_mingw <- settingsFileSetting ToolchainSetting_DistroMinGW
 
             return $ [ unlitPath ]
-                  ++ [ root -/- mingwStamp | windowsHost ]
+                  ++ [ root -/- mingwStamp | windowsHost, distro_mingw == "NO" ]
                      -- proxy for the entire mingw toolchain that
                      -- we have in inplace/mingw initially, and then at
                      -- root -/- mingw.


=====================================
m4/fp_find_nm.m4
=====================================
@@ -9,7 +9,12 @@ AC_DEFUN([FP_FIND_NM],
             AC_MSG_ERROR([cannot find nm in your PATH])
         fi
     fi
-    NmCmd="$NM"
+    if test "$HostOS" = "mingw32"
+    then
+      NmCmd=$(cygpath -m "$NM")
+    else
+      NmCmd="$NM"
+    fi
     AC_SUBST([NmCmd])
 
     if test "$TargetOS_CPP" = "darwin"
@@ -37,4 +42,3 @@ AC_DEFUN([FP_FIND_NM],
             esac
     fi
 ])
-


=====================================
m4/fp_prog_ar_args.m4
=====================================
@@ -30,7 +30,13 @@ else
   fi
 fi])
 fp_prog_ar_args=$fp_cv_prog_ar_args
-AC_SUBST([ArCmd], ["$fp_prog_ar"])
+if test "$HostOS" = "mingw32"
+then
+  ArCmd=$(cygpath -m "$fp_prog_ar")
+else
+  ArCmd="$fp_prog_ar"
+fi
+AC_SUBST([ArCmd])
 AC_SUBST([ArArgs], ["$fp_prog_ar_args"])
 
 ])# FP_PROG_AR_ARGS



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5132754b80d468e0c24e39b63eea525dc1ee3a5b...6ffbd678836775f9ea77335ef0086feaa94dc515

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/5132754b80d468e0c24e39b63eea525dc1ee3a5b...6ffbd678836775f9ea77335ef0086feaa94dc515
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/20240605/4f7c61f5/attachment-0001.html>


More information about the ghc-commits mailing list