[Git][ghc/ghc][wip/romes/drop-clangcmd] configure: Drop Clang command from settings
Rodrigo Mesquita (@alt-romes)
gitlab at gitlab.haskell.org
Tue Jul 4 19:09:18 UTC 2023
Rodrigo Mesquita pushed to branch wip/romes/drop-clangcmd at Glasgow Haskell Compiler / GHC
Commits:
5e4e99e4 by Rodrigo Mesquita at 2023-07-04T20:09:08+01:00
configure: Drop Clang command from settings
Due to 01542cb7227614a93508b97ecad5b16dddeb6486 we no longer use the
`runClang` function, and no longer need to configure into settings the
Clang command. We used to determine options at runtime to pass clang when
it was used as an assembler, but now that we configure at configure time
we no longer need to.
- - - - -
8 changed files:
- compiler/GHC/SysTools/Tasks.hs
- configure.ac
- hadrian/bindist/Makefile
- hadrian/bindist/config.mk.in
- hadrian/cfg/system.config.in
- hadrian/src/Oracles/Setting.hs
- hadrian/src/Rules/Generate.hs
- m4/fp_settings.m4
Changes:
=====================================
compiler/GHC/SysTools/Tasks.hs
=====================================
@@ -12,7 +12,6 @@ module GHC.SysTools.Tasks where
import GHC.Prelude
import GHC.Platform
import GHC.ForeignSrcLang
-import GHC.IO (catchException)
import GHC.CmmToLlvm.Config (LlvmVersion, llvmVersionStr, supportedLlvmVersionUpperBound, parseLlvmVersion, supportedLlvmVersionLowerBound)
@@ -217,28 +216,6 @@ runLlvmLlc logger dflags args = traceSystoolCommand logger "llc" $ do
args1 = map Option (getOpts dflags opt_lc)
runSomething logger "LLVM Compiler" p (args0 ++ args1 ++ args)
--- | Run the clang compiler (used as an assembler for the LLVM
--- backend on OS X as LLVM doesn't support the OS X system
--- assembler)
-runClang :: Logger -> DynFlags -> [Option] -> IO ()
-runClang logger dflags args = traceSystoolCommand logger "clang" $ do
- let (clang,_) = pgm_lcc dflags
- -- be careful what options we call clang with
- -- see #5903 and #7617 for bugs caused by this.
- (_,args0) = pgm_a dflags
- args1 = map Option (getOpts dflags opt_a)
- args2 = args0 ++ args1 ++ args
- mb_env <- getGccEnv args2
- catchException
- (runSomethingFiltered logger id "Clang (Assembler)" clang args2 Nothing mb_env)
- (\(err :: SomeException) -> do
- errorMsg logger $
- text ("Error running clang! you need clang installed to use the" ++
- " LLVM backend") $+$
- text "(or GHC tried to execute clang incorrectly)"
- throwIO err
- )
-
runEmscripten :: Logger -> DynFlags -> [Option] -> IO ()
runEmscripten logger dflags args = traceSystoolCommand logger "emcc" $ do
let (p,args0) = pgm_a dflags
=====================================
configure.ac
=====================================
@@ -545,13 +545,6 @@ sUPPORTED_LLVM_VERSION_MAX=$(echo \($LlvmMaxVersion\) | sed 's/\./,/')
AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MIN], ${sUPPORTED_LLVM_VERSION_MIN}, [The minimum supported LLVM version number])
AC_DEFINE_UNQUOTED([sUPPORTED_LLVM_VERSION_MAX], ${sUPPORTED_LLVM_VERSION_MAX}, [The maximum supported LLVM version number])
-dnl ** Which LLVM clang to use?
-dnl --------------------------------------------------------------
-AC_ARG_VAR(CLANG,[Use as the path to clang [default=autodetect]])
-AC_CHECK_TARGET_TOOL([CLANG], [clang])
-ClangCmd="$CLANG"
-AC_SUBST([ClangCmd])
-
dnl ** Which LLVM llc to use?
dnl --------------------------------------------------------------
AC_ARG_VAR(LLC,[Use as the path to LLVM's llc [default=autodetect]])
@@ -1286,7 +1279,6 @@ echo "\
libdw : $USING_LIBDW
Using LLVM tools
- clang : $ClangCmd
llc : $LlcCmd
opt : $OptCmd"
=====================================
hadrian/bindist/Makefile
=====================================
@@ -120,7 +120,6 @@ lib/settings : config.mk
@echo ',("LLVM target", "$(LLVMTarget_CPP)")' >> $@
@echo ',("LLVM llc command", "$(SettingsLlcCommand)")' >> $@
@echo ',("LLVM opt command", "$(SettingsOptCommand)")' >> $@
- @echo ',("LLVM clang command", "$(SettingsClangCommand)")' >> $@
@echo ',("Use inplace MinGW toolchain", "$(SettingsUseDistroMINGW)")' >> $@
@echo
@echo ',("Use interpreter", "$(GhcWithInterpreter)")' >> $@
=====================================
hadrian/bindist/config.mk.in
=====================================
@@ -275,7 +275,6 @@ SettingsDllWrapCommand = @SettingsDllWrapCommand@
SettingsWindresCommand = @SettingsWindresCommand@
SettingsLibtoolCommand = @SettingsLibtoolCommand@
SettingsTouchCommand = @SettingsTouchCommand@
-SettingsClangCommand = @SettingsClangCommand@
SettingsLlcCommand = @SettingsLlcCommand@
SettingsOptCommand = @SettingsOptCommand@
SettingsUseDistroMINGW = @SettingsUseDistroMINGW@
=====================================
hadrian/cfg/system.config.in
=====================================
@@ -159,7 +159,6 @@ settings-install_name_tool-command = @SettingsInstallNameToolCommand@
settings-dll-wrap-command = @SettingsDllWrapCommand@
settings-windres-command = @SettingsWindresCommand@
settings-touch-command = @SettingsTouchCommand@
-settings-clang-command = @SettingsClangCommand@
settings-llc-command = @SettingsLlcCommand@
settings-opt-command = @SettingsOptCommand@
settings-use-distro-mingw = @SettingsUseDistroMINGW@
=====================================
hadrian/src/Oracles/Setting.hs
=====================================
@@ -126,7 +126,6 @@ data SettingsFileSetting
| SettingsFileSetting_DllWrapCommand
| SettingsFileSetting_WindresCommand
| SettingsFileSetting_TouchCommand
- | SettingsFileSetting_ClangCommand
| SettingsFileSetting_LlcCommand
| SettingsFileSetting_OptCommand
| SettingsFileSetting_DistroMinGW
@@ -224,7 +223,6 @@ settingsFileSetting key = lookupSystemConfig $ case key of
SettingsFileSetting_DllWrapCommand -> "settings-dll-wrap-command"
SettingsFileSetting_WindresCommand -> "settings-windres-command"
SettingsFileSetting_TouchCommand -> "settings-touch-command"
- SettingsFileSetting_ClangCommand -> "settings-clang-command"
SettingsFileSetting_LlcCommand -> "settings-llc-command"
SettingsFileSetting_OptCommand -> "settings-opt-command"
SettingsFileSetting_DistroMinGW -> "settings-use-distro-mingw"
=====================================
hadrian/src/Rules/Generate.hs
=====================================
@@ -479,7 +479,6 @@ generateSettings = do
, ("LLVM target", getSetting LlvmTarget)
, ("LLVM llc command", expr $ settingsFileSetting SettingsFileSetting_LlcCommand)
, ("LLVM opt command", expr $ settingsFileSetting SettingsFileSetting_OptCommand)
- , ("LLVM clang command", expr $ settingsFileSetting SettingsFileSetting_ClangCommand)
, ("Use inplace MinGW toolchain", expr $ settingsFileSetting SettingsFileSetting_DistroMinGW)
, ("Use interpreter", expr $ yesNo <$> ghcWithInterpreter)
=====================================
m4/fp_settings.m4
=====================================
@@ -75,12 +75,6 @@ AC_DEFUN([FP_SETTINGS],
fi
fi
- # Platform-agnostic tools
- if test -z "$ClangCmd"; then
- ClangCmd="clang"
- fi
- SettingsClangCommand="$ClangCmd"
-
# LLVM backend tools
if test -z "$LlcCmd"; then
LlcCmd="llc"
@@ -124,7 +118,6 @@ AC_DEFUN([FP_SETTINGS],
AC_SUBST(SettingsDllWrapCommand)
AC_SUBST(SettingsWindresCommand)
AC_SUBST(SettingsTouchCommand)
- AC_SUBST(SettingsClangCommand)
AC_SUBST(SettingsLlcCommand)
AC_SUBST(SettingsOptCommand)
AC_SUBST(SettingsUseDistroMINGW)
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e4e99e478d4692b1a90c67b477073f34009e6c1
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e4e99e478d4692b1a90c67b477073f34009e6c1
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/20230704/85b2e562/attachment-0001.html>
More information about the ghc-commits
mailing list