From 969b58e67caa5422e748697cf5acc72c82b77e9b Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Tue, 19 Sep 2023 11:29:47 +1000 Subject: [PATCH] Reverse change as a test --- Cabal/src/Distribution/Simple/Program/Ld.hs | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/Cabal/src/Distribution/Simple/Program/Ld.hs b/Cabal/src/Distribution/Simple/Program/Ld.hs index 4e4d8edb081..d7449b93964 100644 --- a/Cabal/src/Distribution/Simple/Program/Ld.hs +++ b/Cabal/src/Distribution/Simple/Program/Ld.hs @@ -18,8 +18,6 @@ module Distribution.Simple.Program.Ld import Distribution.Compat.Prelude import Prelude () -import qualified Data.Map as Map - import Distribution.Simple.Compiler (arResponseFilesSupported) import Distribution.Simple.Flag ( fromFlagOrDefault @@ -69,10 +67,10 @@ combineObjectFiles verbosity lbi ld target files = do -- have a slight problem. What we have to do is link files in batches into -- a temp object file and then include that one in the next batch. - let simpleArgs = prependRelocatableFlag ["-o", target] + let simpleArgs = ["-r", "-o", target] - initialArgs = prependRelocatableFlag ["-o", target] - middleArgs = prependRelocatableFlag ["-o", target, tmpfile] + initialArgs = ["-r", "-o", target] + middleArgs = ["-r", "-o", target, tmpfile] finalArgs = middleArgs simple = programInvocation ld simpleArgs @@ -106,10 +104,3 @@ combineObjectFiles verbosity lbi ld target files = do runProgramInvocation verbosity inv renameFile target tmpfile run invs - - -- Prepend "-r" to the list if the linker supports relocatable outputs. - prependRelocatableFlag :: [String] -> [String] - prependRelocatableFlag xs = - case Map.lookup "Supports relocatable output" $ programProperties ld of - Just "YES" -> "-r" : xs - _other -> xs