[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 20:08:58 UTC 2023
Rodrigo Mesquita pushed to branch wip/romes/drop-clangcmd at Glasgow Haskell Compiler / GHC
Commits:
fb4ace14 by Rodrigo Mesquita at 2023-07-04T21:08:47+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.
- - - - -
13 changed files:
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Settings.hs
- compiler/GHC/Settings/IO.hs
- 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/Oracles/TestSettings.hs
- hadrian/src/Rules/Generate.hs
- m4/fp_settings.m4
- testsuite/ghc-config/ghc-config.hs
Changes:
=====================================
compiler/GHC/Driver/Session.hs
=====================================
@@ -108,7 +108,6 @@ module GHC.Driver.Session (
sPgm_ranlib,
sPgm_lo,
sPgm_lc,
- sPgm_lcc,
sPgm_i,
sOpt_L,
sOpt_P,
@@ -122,7 +121,6 @@ module GHC.Driver.Session (
sOpt_windres,
sOpt_lo,
sOpt_lc,
- sOpt_lcc,
sOpt_i,
sExtraGccViaCFlags,
sTargetPlatformString,
@@ -138,10 +136,10 @@ module GHC.Driver.Session (
extraGccViaCFlags, globalPackageDatabasePath,
pgm_L, pgm_P, pgm_F, pgm_c, pgm_cxx, pgm_cpp, pgm_a, pgm_l, pgm_lm,
pgm_dll, pgm_T, pgm_windres, pgm_ar,
- pgm_ranlib, pgm_lo, pgm_lc, pgm_lcc, pgm_i,
+ pgm_ranlib, pgm_lo, pgm_lc, pgm_i,
opt_L, opt_P, opt_F, opt_c, opt_cxx, opt_a, opt_l, opt_lm, opt_i,
opt_P_signature,
- opt_windres, opt_lo, opt_lc, opt_lcc,
+ opt_windres, opt_lo, opt_lc,
updatePlatformConstants,
-- ** Manipulating DynFlags
@@ -410,8 +408,6 @@ pgm_T :: DynFlags -> String
pgm_T dflags = toolSettings_pgm_T $ toolSettings dflags
pgm_windres :: DynFlags -> String
pgm_windres dflags = toolSettings_pgm_windres $ toolSettings dflags
-pgm_lcc :: DynFlags -> (String,[Option])
-pgm_lcc dflags = toolSettings_pgm_lcc $ toolSettings dflags
pgm_ar :: DynFlags -> String
pgm_ar dflags = toolSettings_pgm_ar $ toolSettings dflags
pgm_ranlib :: DynFlags -> String
@@ -452,8 +448,6 @@ opt_lm :: DynFlags -> [String]
opt_lm dflags= toolSettings_opt_lm $ toolSettings dflags
opt_windres :: DynFlags -> [String]
opt_windres dflags= toolSettings_opt_windres $ toolSettings dflags
-opt_lcc :: DynFlags -> [String]
-opt_lcc dflags= toolSettings_opt_lcc $ toolSettings dflags
opt_lo :: DynFlags -> [String]
opt_lo dflags= toolSettings_opt_lo $ toolSettings dflags
opt_lc :: DynFlags -> [String]
=====================================
compiler/GHC/Settings.hs
=====================================
@@ -42,7 +42,6 @@ module GHC.Settings
, sPgm_ranlib
, sPgm_lo
, sPgm_lc
- , sPgm_lcc
, sPgm_i
, sOpt_L
, sOpt_P
@@ -56,7 +55,6 @@ module GHC.Settings
, sOpt_windres
, sOpt_lo
, sOpt_lc
- , sOpt_lcc
, sOpt_i
, sExtraGccViaCFlags
, sTargetPlatformString
@@ -121,8 +119,6 @@ data ToolSettings = ToolSettings
toolSettings_pgm_lo :: (String, [Option])
, -- | LLVM: llc static compiler
toolSettings_pgm_lc :: (String, [Option])
- , -- | LLVM: c compiler
- toolSettings_pgm_lcc :: (String, [Option])
, toolSettings_pgm_i :: String
-- options for particular phases
@@ -142,8 +138,6 @@ data ToolSettings = ToolSettings
toolSettings_opt_lo :: [String]
, -- | LLVM: llc static compiler
toolSettings_opt_lc :: [String]
- , -- | LLVM: c compiler
- toolSettings_opt_lcc :: [String]
, -- | iserv options
toolSettings_opt_i :: [String]
@@ -242,8 +236,6 @@ sPgm_lo :: Settings -> (String, [Option])
sPgm_lo = toolSettings_pgm_lo . sToolSettings
sPgm_lc :: Settings -> (String, [Option])
sPgm_lc = toolSettings_pgm_lc . sToolSettings
-sPgm_lcc :: Settings -> (String, [Option])
-sPgm_lcc = toolSettings_pgm_lcc . sToolSettings
sPgm_i :: Settings -> String
sPgm_i = toolSettings_pgm_i . sToolSettings
sOpt_L :: Settings -> [String]
@@ -270,8 +262,6 @@ sOpt_lo :: Settings -> [String]
sOpt_lo = toolSettings_opt_lo . sToolSettings
sOpt_lc :: Settings -> [String]
sOpt_lc = toolSettings_opt_lc . sToolSettings
-sOpt_lcc :: Settings -> [String]
-sOpt_lcc = toolSettings_opt_lcc . sToolSettings
sOpt_i :: Settings -> [String]
sOpt_i = toolSettings_opt_i . sToolSettings
=====================================
compiler/GHC/Settings/IO.hs
=====================================
@@ -151,7 +151,6 @@ initSettings top_dir = do
-- We just assume on command line
lc_prog <- getSetting "LLVM llc command"
lo_prog <- getSetting "LLVM opt command"
- lcc_prog <- getSetting "LLVM clang command"
let iserv_prog = libexec "ghc-iserv"
@@ -199,7 +198,6 @@ initSettings top_dir = do
, toolSettings_pgm_ranlib = ranlib_path
, toolSettings_pgm_lo = (lo_prog,[])
, toolSettings_pgm_lc = (lc_prog,[])
- , toolSettings_pgm_lcc = (lcc_prog,[])
, toolSettings_pgm_i = iserv_prog
, toolSettings_opt_L = []
, toolSettings_opt_P = []
@@ -211,7 +209,6 @@ initSettings top_dir = do
, toolSettings_opt_l = []
, toolSettings_opt_lm = []
, toolSettings_opt_windres = []
- , toolSettings_opt_lcc = []
, toolSettings_opt_lo = []
, toolSettings_opt_lc = []
, toolSettings_opt_i = []
=====================================
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/Oracles/TestSettings.hs
=====================================
@@ -37,7 +37,6 @@ data TestSetting = TestHostOS
| TestGhcDynamic
| TestGhcProfiled
| TestAR
- | TestCLANG
| TestLLC
| TestTEST_CC
| TestTEST_CC_OPTS
@@ -69,7 +68,6 @@ testSetting key = do
TestGhcDynamic -> "GhcDynamic"
TestGhcProfiled -> "GhcProfiled"
TestAR -> "AR"
- TestCLANG -> "CLANG"
TestLLC -> "LLC"
TestTEST_CC -> "TEST_CC"
TestTEST_CC_OPTS -> "TEST_CC_OPTS"
=====================================
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)
=====================================
testsuite/ghc-config/ghc-config.hs
=====================================
@@ -33,7 +33,6 @@ main = do
getGhcFieldOrDefault fields "LeadingUnderscore" "Leading underscore" "NO"
getGhcFieldOrDefault fields "GhcTablesNextToCode" "Tables next to code" "NO"
getGhcFieldProgWithDefault fields "AR" "ar command" "ar"
- getGhcFieldProgWithDefault fields "CLANG" "LLVM clang command" "clang"
getGhcFieldProgWithDefault fields "LLC" "LLVM llc command" "llc"
getGhcFieldProgWithDefault fields "TEST_CC" "C compiler command" "gcc"
getGhcFieldProgWithDefault fields "TEST_CC_OPTS" "C compiler flags" ""
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb4ace144dd9ac24f2475d1800c693f20475c665
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fb4ace144dd9ac24f2475d1800c693f20475c665
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/621cf17b/attachment-0001.html>
More information about the ghc-commits
mailing list