summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2022-05-03 12:40:43 -0400
committerBen Gamari <ben@smart-cactus.org>2022-05-03 12:44:01 -0400
commit34069a2faeefec2d11f7d8224b95dad77b428fe3 (patch)
tree37da3cd30602cac9db9213a1f6b92d6436c52b2f
parent4eaf0f33c10b7e8fe544f848520df075fc69ef25 (diff)
downloadhaskell-wip/T21478.tar.gz
rts/ghc.mk: Only build StgCRunAsm.S when it is neededwip/T21478
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"