diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index eff542a80b7c58f27cbd74c5a319195fcc623b2c..a9e486c94a63cbcb9f1ba6d9054c418864196b92 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