diff options
author | Ben Gamari <ben@smart-cactus.org> | 2020-08-01 11:34:32 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-08-05 04:00:39 -0400 |
commit | 53ce0db5a06598c88c6b8cb32043b878e7083dd4 (patch) | |
tree | 281c045c9f198c5bb046780881931b41de1f15d4 /hadrian/src/Oracles/Setting.hs | |
parent | 2bff2f87e43985e02bdde8c6fa39279df86cb617 (diff) | |
download | haskell-53ce0db5a06598c88c6b8cb32043b878e7083dd4.tar.gz |
Refactor handling of object merging
Previously to merge a set of object files we would invoke the linker as
usual, adding -r to the command-line. However, this can result in
non-sensical command-lines which causes lld to balk (#17962).
To avoid this we introduce a new tool setting into GHC, -pgmlm, which is
the linker which we use to merge object files.
Diffstat (limited to 'hadrian/src/Oracles/Setting.hs')
-rw-r--r-- | hadrian/src/Oracles/Setting.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs index bd4d239e68..1e65ddb52d 100644 --- a/hadrian/src/Oracles/Setting.hs +++ b/hadrian/src/Oracles/Setting.hs @@ -91,6 +91,7 @@ data SettingList = ConfCcArgs Stage | ConfCppArgs Stage | ConfGccLinkerArgs Stage | ConfLdLinkerArgs Stage + | ConfMergeObjectsArgs Stage | HsCppArgs -- TODO compute solely in Hadrian, removing these variables' definitions @@ -109,6 +110,8 @@ data SettingsFileSetting | SettingsFileSetting_CCompilerSupportsNoPie | SettingsFileSetting_LdCommand | SettingsFileSetting_LdFlags + | SettingsFileSetting_MergeObjectsCommand + | SettingsFileSetting_MergeObjectsFlags | SettingsFileSetting_ArCommand | SettingsFileSetting_RanlibCommand | SettingsFileSetting_DllWrapCommand @@ -176,6 +179,7 @@ settingList key = fmap words $ lookupValueOrError configFile $ case key of ConfCppArgs stage -> "conf-cpp-args-" ++ stageString stage ConfGccLinkerArgs stage -> "conf-gcc-linker-args-" ++ stageString stage ConfLdLinkerArgs stage -> "conf-ld-linker-args-" ++ stageString stage + ConfMergeObjectsArgs stage -> "conf-merge-objects-args-" ++ stageString stage HsCppArgs -> "hs-cpp-args" -- | Look up the value of a 'SettingList' in @cfg/system.config@, tracking the @@ -191,6 +195,8 @@ settingsFileSetting key = lookupValueOrError configFile $ case key of SettingsFileSetting_CCompilerSupportsNoPie -> "settings-c-compiler-supports-no-pie" SettingsFileSetting_LdCommand -> "settings-ld-command" SettingsFileSetting_LdFlags -> "settings-ld-flags" + SettingsFileSetting_MergeObjectsCommand -> "settings-merge-objects-command" + SettingsFileSetting_MergeObjectsFlags -> "settings-merge-objects-flags" SettingsFileSetting_ArCommand -> "settings-ar-command" SettingsFileSetting_RanlibCommand -> "settings-ranlib-command" SettingsFileSetting_DllWrapCommand -> "settings-dll-wrap-command" |