summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-05-03 12:40:43 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-05-04 09:58:50 -0400
commitd61f742876bdf2cd32e76f7bca389106ad99a316 (patch)
tree51ec0bd505f7ca7412cfdd02f73cd6294303b2b8
parent063d485ebfb366165140465b8901d1666e642cd6 (diff)
downloadhaskell-d61f742876bdf2cd32e76f7bca389106ad99a316.tar.gz
rts/ghc.mk: Only build StgCRunAsm.S when it is needed
Previously the make build system unconditionally included StgCRunAsm.S in the link, meaning that the RTS would require an execstack unnecessarily. Fixes #21478.
-rw-r--r--rts/ghc.mk3
1 files changed, 3 insertions, 0 deletions
diff --git a/rts/ghc.mk b/rts/ghc.mk
index 36a82f9f2c..0e56515a56 100644
--- a/rts/ghc.mk
+++ b/rts/ghc.mk
@@ -57,8 +57,11 @@ ifneq "$(PORTING_HOST)" "YES"
# unregisterised builds use the mini interpreter
ifneq "$(GhcUnregisterised)" "YES"
+# use StgCRunAsm.S on ppc, ppc64, s390x, and riscv64
+ifneq "$(findstring $(TargetArch_CPP), ppc) $(findstring $(TargetArch_CPP), ppc64) $(findstring $(TargetArch_CPP), s390x) $(findstring $(TargetArch_CPP), riscv64)" ""
rts_S_SRCS += rts/StgCRunAsm.S
endif
+endif
# select adjustor implementation. This much match the logic in rts.cabal.in.
ifneq "$(CLEANING)" "YES"