diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-03-29 12:26:50 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-25 10:19:29 -0400 |
commit | 9420d26b4b9dd42238d3ec2a92abe0552d37775e (patch) | |
tree | 83ab1953b68e9a6bf17dfcdefe66894411d1a197 | |
parent | cb71226f9537e542c6eadb90d8006e525c941605 (diff) | |
download | haskell-9420d26b4b9dd42238d3ec2a92abe0552d37775e.tar.gz |
Drop libtool path from settings file
GHC no longers uses libtool for linking and therefore this is no longer
necessary.
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 7 | ||||
-rw-r--r-- | compiler/GHC/Settings.hs | 4 | ||||
-rw-r--r-- | compiler/GHC/Settings/IO.hs | 2 | ||||
-rw-r--r-- | compiler/GHC/SysTools/Ar.hs | 11 | ||||
-rw-r--r-- | compiler/GHC/SysTools/Tasks.hs | 9 | ||||
-rw-r--r-- | docs/users_guide/phases.rst | 7 | ||||
-rw-r--r-- | hadrian/bindist/Makefile | 1 | ||||
-rw-r--r-- | hadrian/cfg/system.config.in | 1 | ||||
-rw-r--r-- | hadrian/src/Oracles/Setting.hs | 2 | ||||
-rw-r--r-- | hadrian/src/Rules/Generate.hs | 1 | ||||
-rw-r--r-- | rts/include/ghc.mk | 1 |
11 files changed, 7 insertions, 39 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 00e7c726dd..c9a785b4f5 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -98,7 +98,6 @@ module GHC.Driver.Session ( sPgm_dll, sPgm_T, sPgm_windres, - sPgm_libtool, sPgm_ar, sPgm_ranlib, sPgm_lo, @@ -132,7 +131,7 @@ module GHC.Driver.Session ( versionedAppDir, versionedFilePath, extraGccViaCFlags, globalPackageDatabasePath, pgm_L, pgm_P, pgm_F, pgm_c, pgm_a, pgm_l, pgm_lm, pgm_dll, pgm_T, - pgm_windres, pgm_libtool, pgm_ar, pgm_otool, pgm_install_name_tool, + pgm_windres, pgm_ar, pgm_otool, pgm_install_name_tool, pgm_ranlib, pgm_lo, pgm_lc, pgm_lcc, pgm_i, opt_L, opt_P, opt_F, opt_c, opt_cxx, opt_a, opt_l, opt_lm, opt_i, opt_P_signature, @@ -829,8 +828,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_libtool :: DynFlags -> String -pgm_libtool dflags = toolSettings_pgm_libtool $ toolSettings dflags pgm_lcc :: DynFlags -> (String,[Option]) pgm_lcc dflags = toolSettings_pgm_lcc $ toolSettings dflags pgm_ar :: DynFlags -> String @@ -2145,8 +2142,6 @@ dynamic_flags_deps = [ $ hasArg $ \f -> alterToolSettings $ \s -> s { toolSettings_pgm_dll = (f,[]) } , make_ord_flag defFlag "pgmwindres" $ hasArg $ \f -> alterToolSettings $ \s -> s { toolSettings_pgm_windres = f } - , make_ord_flag defFlag "pgmlibtool" - $ hasArg $ \f -> alterToolSettings $ \s -> s { toolSettings_pgm_libtool = f } , make_ord_flag defFlag "pgmar" $ hasArg $ \f -> alterToolSettings $ \s -> s { toolSettings_pgm_ar = f } , make_ord_flag defFlag "pgmotool" diff --git a/compiler/GHC/Settings.hs b/compiler/GHC/Settings.hs index 92bfa75699..e6226696dc 100644 --- a/compiler/GHC/Settings.hs +++ b/compiler/GHC/Settings.hs @@ -34,7 +34,6 @@ module GHC.Settings , sPgm_dll , sPgm_T , sPgm_windres - , sPgm_libtool , sPgm_ar , sPgm_otool , sPgm_install_name_tool @@ -108,7 +107,6 @@ data ToolSettings = ToolSettings , toolSettings_pgm_dll :: (String, [Option]) , toolSettings_pgm_T :: String , toolSettings_pgm_windres :: String - , toolSettings_pgm_libtool :: String , toolSettings_pgm_ar :: String , toolSettings_pgm_otool :: String , toolSettings_pgm_install_name_tool :: String @@ -222,8 +220,6 @@ sPgm_T :: Settings -> String sPgm_T = toolSettings_pgm_T . sToolSettings sPgm_windres :: Settings -> String sPgm_windres = toolSettings_pgm_windres . sToolSettings -sPgm_libtool :: Settings -> String -sPgm_libtool = toolSettings_pgm_libtool . sToolSettings sPgm_ar :: Settings -> String sPgm_ar = toolSettings_pgm_ar . sToolSettings sPgm_otool :: Settings -> String diff --git a/compiler/GHC/Settings/IO.hs b/compiler/GHC/Settings/IO.hs index 8e23706410..308c5447e1 100644 --- a/compiler/GHC/Settings/IO.hs +++ b/compiler/GHC/Settings/IO.hs @@ -107,7 +107,6 @@ initSettings top_dir = do unlit_path <- getToolSetting "unlit command" windres_path <- getToolSetting "windres command" - libtool_path <- getToolSetting "libtool command" ar_path <- getToolSetting "ar command" otool_path <- getToolSetting "otool command" install_name_tool_path <- getToolSetting "install_name_tool command" @@ -180,7 +179,6 @@ initSettings top_dir = do , toolSettings_pgm_dll = (mkdll_prog,mkdll_args) , toolSettings_pgm_T = touch_path , toolSettings_pgm_windres = windres_path - , toolSettings_pgm_libtool = libtool_path , toolSettings_pgm_ar = ar_path , toolSettings_pgm_otool = otool_path , toolSettings_pgm_install_name_tool = install_name_tool_path diff --git a/compiler/GHC/SysTools/Ar.hs b/compiler/GHC/SysTools/Ar.hs index daed11f432..ab4e02cf42 100644 --- a/compiler/GHC/SysTools/Ar.hs +++ b/compiler/GHC/SysTools/Ar.hs @@ -1,8 +1,9 @@ {-# LANGUAGE CPP #-} {-# LANGUAGE OverloadedStrings, GeneralizedNewtypeDeriving #-} -{- Note: [The need for Ar.hs] -Building `-staticlib` required the presence of libtool, and was a such -restricted to mach-o only. As libtool on macOS and gnu libtool are very +{- Note [The need for Ar.hs] + ~~~~~~~~~~~~~~~~~~~~~~~~~ +Building `-staticlib` previously required the presence of libtool, and was a +such restricted to mach-o only. As libtool on macOS and gnu libtool are very different, there was no simple portable way to support this. libtool for static archives does essentially: concatinate the input archives, @@ -11,9 +12,9 @@ fails as even `ar` (bsd and gnu, llvm, ...) do not provide the same features across platforms (e.g. index prefixed retrieval of objects with the same name.) -As Archives are rather simple structurally, we can just build the archives +As archives are rather simple structurally, we can just build the archives with Haskell directly and use ranlib on the final result to get the symbol -index. This should allow us to work around with the differences/abailability +index. This should allow us to work around with the differences/availability of libtool across different platforms. -} module GHC.SysTools.Ar diff --git a/compiler/GHC/SysTools/Tasks.hs b/compiler/GHC/SysTools/Tasks.hs index d6532a6234..9b4400903e 100644 --- a/compiler/GHC/SysTools/Tasks.hs +++ b/compiler/GHC/SysTools/Tasks.hs @@ -342,15 +342,6 @@ runMergeObjects logger tmpfs dflags args = else do runSomething logger "Merge objects" p args2 -runLibtool :: Logger -> DynFlags -> [Option] -> IO () -runLibtool logger dflags args = traceToolCommand logger "libtool" $ do - linkargs <- neededLinkArgs `fmap` getLinkerInfo logger dflags - let args1 = map Option (getOpts dflags opt_l) - args2 = [Option "-static"] ++ args1 ++ args ++ linkargs - libtool = pgm_libtool dflags - mb_env <- getGccEnv args2 - runSomethingFiltered logger id "Libtool" libtool args2 Nothing mb_env - runAr :: Logger -> DynFlags -> Maybe FilePath -> [Option] -> IO () runAr logger dflags cwd args = traceToolCommand logger "ar" $ do let ar = pgm_ar dflags diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index c931268bbd..fdb08a4209 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -123,13 +123,6 @@ given compilation phase: GHC installation. See ``-fno-embed-manifest`` in :ref:`options-linker`. -.. ghc-flag:: -pgmlibtool ⟨cmd⟩ - :shortdesc: Use ⟨cmd⟩ as the command for libtool (with :ghc-flag:`-staticlib` only). - :type: dynamic - :category: phase-programs - - Use ⟨cmd⟩ as the libtool command (when using :ghc-flag:`-staticlib` only). - .. ghc-flag:: -pgmi ⟨cmd⟩ :shortdesc: Use ⟨cmd⟩ as the external interpreter command. :type: dynamic diff --git a/hadrian/bindist/Makefile b/hadrian/bindist/Makefile index d4e52f8c65..5290a5e9df 100644 --- a/hadrian/bindist/Makefile +++ b/hadrian/bindist/Makefile @@ -128,7 +128,6 @@ lib/settings : @echo ',("touch command", "$(SettingsTouchCommand)")' >> $@ @echo ',("dllwrap command", "$(SettingsDllWrapCommand)")' >> $@ @echo ',("windres command", "$(SettingsWindresCommand)")' >> $@ - @echo ',("libtool command", "$(SettingsLibtoolCommand)")' >> $@ @echo ',("unlit command", "$$topdir/bin/unlit")' >> $@ @echo ',("cross compiling", "$(CrossCompiling)")' >> $@ @echo ',("target platform string", "$(TARGETPLATFORM)")' >> $@ diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index 6544261cd3..ddb6f54cb6 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -159,7 +159,6 @@ settings-otool-command = @SettingsOtoolCommand@ settings-install_name_tool-command = @SettingsInstallNameToolCommand@ settings-dll-wrap-command = @SettingsDllWrapCommand@ settings-windres-command = @SettingsWindresCommand@ -settings-libtool-command = @SettingsLibtoolCommand@ settings-touch-command = @SettingsTouchCommand@ settings-clang-command = @SettingsClangCommand@ settings-llc-command = @SettingsLlcCommand@ diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs index 72f67941ae..6ce01327c5 100644 --- a/hadrian/src/Oracles/Setting.hs +++ b/hadrian/src/Oracles/Setting.hs @@ -122,7 +122,6 @@ data SettingsFileSetting | SettingsFileSetting_InstallNameToolCommand | SettingsFileSetting_DllWrapCommand | SettingsFileSetting_WindresCommand - | SettingsFileSetting_LibtoolCommand | SettingsFileSetting_TouchCommand | SettingsFileSetting_ClangCommand | SettingsFileSetting_LlcCommand @@ -215,7 +214,6 @@ settingsFileSetting key = lookupSystemConfig $ case key of SettingsFileSetting_InstallNameToolCommand -> "settings-install_name_tool-command" SettingsFileSetting_DllWrapCommand -> "settings-dll-wrap-command" SettingsFileSetting_WindresCommand -> "settings-windres-command" - SettingsFileSetting_LibtoolCommand -> "settings-libtool-command" SettingsFileSetting_TouchCommand -> "settings-touch-command" SettingsFileSetting_ClangCommand -> "settings-clang-command" SettingsFileSetting_LlcCommand -> "settings-llc-command" diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs index 912618662e..aaa83e0060 100644 --- a/hadrian/src/Rules/Generate.hs +++ b/hadrian/src/Rules/Generate.hs @@ -319,7 +319,6 @@ generateSettings = do , ("touch command", expr $ settingsFileSetting SettingsFileSetting_TouchCommand) , ("dllwrap command", expr $ settingsFileSetting SettingsFileSetting_DllWrapCommand) , ("windres command", expr $ settingsFileSetting SettingsFileSetting_WindresCommand) - , ("libtool command", expr $ settingsFileSetting SettingsFileSetting_LibtoolCommand) , ("unlit command", ("$topdir/bin/" <>) <$> expr (programName (ctx { Context.package = unlit }))) , ("cross compiling", expr $ yesNo <$> flag CrossCompiling) , ("target platform string", getSetting TargetPlatform) diff --git a/rts/include/ghc.mk b/rts/include/ghc.mk index f5a198bcdd..b8b74f4a89 100644 --- a/rts/include/ghc.mk +++ b/rts/include/ghc.mk @@ -216,7 +216,6 @@ $(includes_SETTINGS) : rts/include/Makefile | $$(dir $$@)/. @echo ',("touch command", "$(SettingsTouchCommand)")' >> $@ @echo ',("dllwrap command", "$(SettingsDllWrapCommand)")' >> $@ @echo ',("windres command", "$(SettingsWindresCommand)")' >> $@ - @echo ',("libtool command", "$(SettingsLibtoolCommand)")' >> $@ @echo ',("unlit command", "$$topdir/bin/$(utils/unlit_dist_PROG)")' >> $@ @echo ',("cross compiling", "$(CrossCompiling)")' >> $@ @echo ',("target platform string", "$(TARGETPLATFORM)")' >> $@ |