[Git][ghc/ghc][wip/toolchain-selection] fixup! Windows builtin toolchain
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Jul 11 14:18:11 UTC 2023
Rodrigo Mesquita pushed to branch wip/toolchain-selection at Glasgow Haskell Compiler / GHC
Commits:
7996317b by Rodrigo Mesquita at 2023-07-11T15:18:01+01:00
fixup! Windows builtin toolchain
- - - - -
5 changed files:
- m4/fp_settings.m4
- m4/fp_setup_windows_toolchain.m4
- m4/ghc_toolchain.m4
- m4/prep_target_file.m4
- utils/ghc-toolchain/src/GHC/Toolchain/Monad.hs
Changes:
=====================================
m4/fp_settings.m4
=====================================
@@ -6,7 +6,7 @@
AC_DEFUN([SUBST_TOOLDIR],
[
dnl See Note [tooldir: How GHC finds mingw on Windows]
- $1=`echo $1 | sed 's%'"$mingwpath"'%$$tooldir/mingw%'`
+ $1=`echo $$1 | sed 's%'"$mingwpath"'%$$tooldir/mingw%'`
])
# FP_SETTINGS
=====================================
m4/fp_setup_windows_toolchain.m4
=====================================
@@ -120,6 +120,8 @@ AC_DEFUN([FP_SETUP_WINDOWS_TOOLCHAIN],[
RANLIB="${mingwbin}llvm-ranlib.exe"
OBJDUMP="${mingwbin}llvm-objdump.exe"
DLLTOOL="${mingwbin}llvm-dlltool.exe"
+ DllWrapCmd="${mingwbin}llvm-dllwrap.exe"
+ WindresCmd="${mingwbin}llvm-windres.exe"
# N.B. LLD does not support -r
MergeObjsCmd=""
=====================================
m4/ghc_toolchain.m4
=====================================
@@ -94,7 +94,7 @@ AC_DEFUN([FIND_GHC_TOOLCHAIN],
echo "--ar=$AR" >> acargs
echo "--ranlib=$RANLIB" >> acargs
echo "--nm=$NM" >> acargs
- echo "--merge-objs=$SettingsMergeObjectsCommand" >> acargs
+ echo "--merge-objs=$MergeObjsCmd" >> acargs
echo "--readelf=$READELF" >> acargs
echo "--windres=$WindresCmd" >> acargs
echo "--dllwrap=$DllWrapCmd" >> acargs
=====================================
m4/prep_target_file.m4
=====================================
@@ -2,7 +2,7 @@
# =========================
#
# Issue a substitution of [$1MaybeProg] with
-# * Nothing, if $1 is /bin/false (this is unfortunately hardcoded since SettingsDllWrapCommand and SettingsWindresCommand get set to this on windows).
+# * Nothing, if $1 is empty
# * Just (Program {prgPath = "$$1", prgFlags = []}), otherwise
#
# $1 = optional value
=====================================
utils/ghc-toolchain/src/GHC/Toolchain/Monad.hs
=====================================
@@ -34,6 +34,8 @@ import qualified Control.Monad.Trans.Reader as Reader
import qualified Control.Monad.Trans.Except as Except
import System.IO hiding (readFile, writeFile, appendFile)
-- import qualified System.Directory
+import qualified Data.Text as T
+import qualified Data.Text.IO as T
data Env = Env { verbosity :: Int
@@ -100,7 +102,7 @@ logMsg v msg = do
when (verbosity e >= v) (liftIO $ hPutStrLn stderr $ indent ++ msg)
readFile :: FilePath -> M String
-readFile path = liftIO $ Prelude.readFile path
+readFile path = liftIO $ T.unpack <$> T.readFile path
writeFile :: FilePath -> String -> M ()
writeFile path s = liftIO $ Prelude.writeFile path s
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7996317b03dd2180494d5dc1e63877abd0cff9be
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/7996317b03dd2180494d5dc1e63877abd0cff9be
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/20230711/8056c1a4/attachment-0001.html>
More information about the ghc-commits
mailing list