diff options
author | Ben Gamari <ben@smart-cactus.org> | 2022-03-23 17:37:25 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-04-06 13:01:28 -0400 |
commit | 694d39f0391c58cd926887e274c227e99099a900 (patch) | |
tree | 0e4dfc3c591aba6cad52697f29ba7608d43f48ad /compiler/GHC/Settings | |
parent | 400666c81af024b6d16100aba88c2e8e78e8eef8 (diff) | |
download | haskell-694d39f0391c58cd926887e274c227e99099a900.tar.gz |
driver: Make object merging optional
On Windows we don't have a linker which supports object joining (i.e.
the `-r` flag). Consequently, `-pgmlm` is now a `Maybe`.
See #21068.
Diffstat (limited to 'compiler/GHC/Settings')
-rw-r--r-- | compiler/GHC/Settings/IO.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/GHC/Settings/IO.hs b/compiler/GHC/Settings/IO.hs index 7d9be2f403..08e60776a3 100644 --- a/compiler/GHC/Settings/IO.hs +++ b/compiler/GHC/Settings/IO.hs @@ -130,6 +130,9 @@ initSettings top_dir = do ld_args = map Option (cc_args ++ words cc_link_args_str) ld_r_prog <- getToolSetting "Merge objects command" ld_r_args <- getSetting "Merge objects flags" + let ld_r + | null ld_r_prog = Nothing + | otherwise = Just (ld_r_prog, map Option $ words ld_r_args) llvmTarget <- getSetting "LLVM target" @@ -171,7 +174,7 @@ initSettings top_dir = do , toolSettings_pgm_c = cc_prog , toolSettings_pgm_a = (as_prog, as_args) , toolSettings_pgm_l = (ld_prog, ld_args) - , toolSettings_pgm_lm = (ld_r_prog, map Option $ words ld_r_args) + , toolSettings_pgm_lm = ld_r , toolSettings_pgm_dll = (mkdll_prog,mkdll_args) , toolSettings_pgm_T = touch_path , toolSettings_pgm_windres = windres_path |