[commit: ghc] master: Revert "driver: unconditionally disable relaxation when linking partially" (44ba665)

git at git.haskell.org git at git.haskell.org
Wed Aug 22 13:22:55 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/44ba66527ae207ce2dd64eb2bce14656d474f6d1/ghc

>---------------------------------------------------------------

commit 44ba66527ae207ce2dd64eb2bce14656d474f6d1
Author: Ryan Scott <ryan.gl.scott at gmail.com>
Date:   Wed Aug 22 09:19:42 2018 -0400

    Revert "driver: unconditionally disable relaxation when linking partially"
    
    This reverts commit 1cc9061fce4270739677d475190fd6e890e8b1f9.
    
    This appears to break a clean build with certain versions of
    `ld.gold`. See
    https://phabricator.haskell.org/rGHC1cc9061fce42#132967.


>---------------------------------------------------------------

44ba66527ae207ce2dd64eb2bce14656d474f6d1
 compiler/main/DriverPipeline.hs | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index eff542a..a9e486c 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -2171,11 +2171,12 @@ joinObjectFiles dflags o_files output_fn = do
                      ++ (if osInfo == OSFreeBSD
                           then [SysTools.Option "-L/usr/lib"]
                           else [])
-                        -- gcc on sparc sets -Wl,--relax implicitly (another
-                        -- use case is when use passes -optl-Wl,--relax)
-                        -- but -r and --relax are incompatible for ld, so
+                        -- gcc on sparc sets -Wl,--relax implicitly, but
+                        -- -r and --relax are incompatible for ld, so
                         -- disable --relax explicitly.
-                     ++ (if ldIsGnuLd
+                     ++ (if platformArch (targetPlatform dflags)
+                                `elem` [ArchSPARC, ArchSPARC64]
+                         && ldIsGnuLd
                             then [SysTools.Option "-Wl,-no-relax"]
                             else [])
                      ++ map SysTools.Option ld_build_id



More information about the ghc-commits mailing list