summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/src/Builder.hs4
-rw-r--r--hadrian/src/Oracles/Flag.hs9
3 files changed, 11 insertions, 3 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index 78f66df02f..8cefe803ac 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -40,6 +40,7 @@ python = @PythonCmd@
#============================
ar-supports-at-file = @ArSupportsAtFile@
+system-ar-supports-at-file = @ArSupportsAtFile_STAGE0@
ar-supports-dash-l = @ArSupportsDashL@
system-ar-supports-dash-l = @ArSupportsDashL_STAGE0@
cc-llvm-backend = @CcLlvmBackend@
diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs
index 5bc5cacc80..77c0f514d6 100644
--- a/hadrian/src/Builder.hs
+++ b/hadrian/src/Builder.hs
@@ -312,8 +312,8 @@ instance H.Builder Builder where
-- see Note [Capture stdout as a ByteString]
writeFileChangedBS output stdout
case builder of
- Ar Pack _ -> do
- useTempFile <- flag ArSupportsAtFile
+ Ar Pack stg -> do
+ useTempFile <- arSupportsAtFile stg
if useTempFile then runAr path buildArgs buildInputs
else runArWithoutTempFile path buildArgs buildInputs
diff --git a/hadrian/src/Oracles/Flag.hs b/hadrian/src/Oracles/Flag.hs
index 836834cbfc..1f585595c5 100644
--- a/hadrian/src/Oracles/Flag.hs
+++ b/hadrian/src/Oracles/Flag.hs
@@ -7,7 +7,8 @@ module Oracles.Flag (
targetSupportsThreadedRts,
targetSupportsSMP,
useLibffiForAdjustors,
- arSupportsDashL
+ arSupportsDashL,
+ arSupportsAtFile
) where
import Hadrian.Oracles.TextFile
@@ -18,6 +19,7 @@ import Oracles.Setting
data Flag = ArSupportsAtFile
| ArSupportsDashL
+ | SystemArSupportsAtFile
| SystemArSupportsDashL
| CrossCompiling
| CcLlvmBackend
@@ -48,6 +50,7 @@ flag f = do
let key = case f of
ArSupportsAtFile -> "ar-supports-at-file"
ArSupportsDashL -> "ar-supports-dash-l"
+ SystemArSupportsAtFile-> "system-ar-supports-at-file"
SystemArSupportsDashL-> "system-ar-supports-dash-l"
CrossCompiling -> "cross-compiling"
CcLlvmBackend -> "cc-llvm-backend"
@@ -89,6 +92,10 @@ arSupportsDashL :: Stage -> Action Bool
arSupportsDashL (Stage0 {}) = flag SystemArSupportsDashL
arSupportsDashL _ = flag ArSupportsDashL
+arSupportsAtFile :: Stage -> Action Bool
+arSupportsAtFile (Stage0 {}) = flag SystemArSupportsAtFile
+arSupportsAtFile _ = flag ArSupportsAtFile
+
platformSupportsSharedLibs :: Action Bool
platformSupportsSharedLibs = do
windows <- isWinTarget