diff options
Diffstat (limited to 'hadrian')
-rw-r--r-- | hadrian/cfg/system.config.in | 9 | ||||
-rw-r--r-- | hadrian/src/Oracles/Flag.hs | 9 | ||||
-rw-r--r-- | hadrian/src/Settings/Builders/Ar.hs | 6 |
3 files changed, 17 insertions, 7 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in index f3a4e3f438..0541d90138 100644 --- a/hadrian/cfg/system.config.in +++ b/hadrian/cfg/system.config.in @@ -39,10 +39,11 @@ python = @PythonCmd@ # Information about builders: #============================ -ar-supports-at-file = @ArSupportsAtFile@ -ar-supports-dash-l = @ArSupportsDashL@ -cc-llvm-backend = @CcLlvmBackend@ -hs-cpp-args = @HaskellCPPArgs@ +ar-supports-at-file = @ArSupportsAtFile@ +ar-supports-dash-l = @ArSupportsDashL@ +system-ar-supports-dash-l = @ArSupportsDashL_STAGE0@ +cc-llvm-backend = @CcLlvmBackend@ +hs-cpp-args = @HaskellCPPArgs@ # Build options: #=============== diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs index 7c05be5a68..bf0aa62383 100644 --- a/hadrian/src/Oracles/Flag.hs +++ b/hadrian/src/Oracles/Flag.hs @@ -5,7 +5,8 @@ module Oracles.Flag ( platformSupportsSharedLibs, platformSupportsGhciObjects, targetSupportsSMP, - useLibffiForAdjustors + useLibffiForAdjustors, + arSupportsDashL ) where import Hadrian.Oracles.TextFile @@ -16,6 +17,7 @@ import Oracles.Setting data Flag = ArSupportsAtFile | ArSupportsDashL + | SystemArSupportsDashL | CrossCompiling | CcLlvmBackend | GhcUnregisterised @@ -39,6 +41,7 @@ flag f = do let key = case f of ArSupportsAtFile -> "ar-supports-at-file" ArSupportsDashL -> "ar-supports-dash-l" + SystemArSupportsDashL-> "system-ar-supports-dash-l" CrossCompiling -> "cross-compiling" CcLlvmBackend -> "cc-llvm-backend" GhcUnregisterised -> "ghc-unregisterised" @@ -69,6 +72,10 @@ platformSupportsGhciObjects :: Action Bool platformSupportsGhciObjects = not . null <$> settingsFileSetting SettingsFileSetting_MergeObjectsCommand +arSupportsDashL :: Stage -> Action Bool +arSupportsDashL (Stage0 {}) = flag SystemArSupportsDashL +arSupportsDashL _ = flag ArSupportsDashL + platformSupportsSharedLibs :: Action Bool platformSupportsSharedLibs = do windows <- isWinTarget diff --git a/hadrian/src/Settings/Builders/Ar.hs b/hadrian/src/Settings/Builders/Ar.hs index 08379f07f8..65c9d5bb59 100644 --- a/hadrian/src/Settings/Builders/Ar.hs +++ b/hadrian/src/Settings/Builders/Ar.hs @@ -6,7 +6,9 @@ import Settings.Builders.Common -- want to place these in a response file. This is handled in -- 'Hadrian.Builder.Ar.runAr'. arBuilderArgs :: Args -arBuilderArgs = mconcat +arBuilderArgs = do + stage <- getStage + mconcat [ builder (Ar Pack) ? mconcat [ -- When building on platforms which don't support object merging -- we must use the -L flag supported by llvm-ar, which ensures that @@ -14,7 +16,7 @@ arBuilderArgs = mconcat -- not added as a single file. This requires that we are using llvm-ar -- -- See Note [Object merging] in GHC.Driver.Pipeline.Execute for details. - ifM ((&&) <$> notStage0 <*> expr (flag ArSupportsDashL)) (arg "qL") (arg "q") + ifM (expr $ arSupportsDashL stage) (arg "qL") (arg "q") , arg =<< getOutput ] , builder (Ar Unpack) ? mconcat |