summaryrefslogtreecommitdiff
path: root/hadrian/src
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-05-09 18:23:15 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-10 20:50:27 -0400
commitfec3e7aa72bee69ef3a3f363709377990650a5d3 (patch)
tree03b5e14d416fcf2b070550e20d158b493fba912a /hadrian/src
parent9d8f44a98f8345e5223614e0de50fbef2a05dd1d (diff)
downloadhaskell-fec3e7aa72bee69ef3a3f363709377990650a5d3.tar.gz
hadrian: Only copy and install libffi headers when using in-tree libffi
When passed `--use-system-libffi` then we shouldn't copy and install the headers from the system package. Instead the headers are expected to be available as a runtime dependency on the users system. Fixes #21485 #21487
Diffstat (limited to 'hadrian/src')
-rw-r--r--hadrian/src/Rules/Generate.hs4
-rw-r--r--hadrian/src/Rules/Rts.hs2
2 files changed, 4 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Generate.hs b/hadrian/src/Rules/Generate.hs
index aaa83e0060..5653bd1d25 100644
--- a/hadrian/src/Rules/Generate.hs
+++ b/hadrian/src/Rules/Generate.hs
@@ -41,13 +41,15 @@ rtsDependencies :: Expr [FilePath]
rtsDependencies = do
stage <- getStage
rtsPath <- expr (rtsBuildPath stage)
+ useSystemFfi <- expr (flag UseSystemFfi)
+
let headers =
[ "ghcautoconf.h", "ghcplatform.h"
, "DerivedConstants.h"
, "rts" -/- "EventTypes.h"
, "rts" -/- "EventLogConstants.h"
]
- ++ libffiHeaderFiles
+ ++ (if useSystemFfi then [] else libffiHeaderFiles)
pure $ ((rtsPath -/- "include") -/-) <$> headers
genapplyDependencies :: Expr [FilePath]
diff --git a/hadrian/src/Rules/Rts.hs b/hadrian/src/Rules/Rts.hs
index 59a337801f..9a18a41c46 100644
--- a/hadrian/src/Rules/Rts.hs
+++ b/hadrian/src/Rules/Rts.hs
@@ -126,7 +126,7 @@ needRtsLibffiTargets stage = do
let headers = fmap ((rtsPath -/- "include") -/-) libffiHeaderFiles
if useSystemFfi
- then return headers
+ then return []
else do
-- Need Libffi
-- This returns the dynamic library files (in the Libffi build dir).