Commit 0900b584 authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
Browse files

hadrian: disable alloca for in-tree GMP on wasm32

When building in-tree GMP for wasm32, disable its alloca usage, since
it may potentially cause stack overflow (e.g. #22602).
parent 3efd1e99
Pipeline #61938 canceled with stages
in 1 second
......@@ -10,12 +10,20 @@ configureBuilderArgs = do
gmpPath <- expr (gmpBuildPath stage)
libffiPath <- expr (libffiBuildPath stage)
mconcat [ builder (Configure gmpPath) ? do
targetArch <- getSetting TargetArch
targetPlatform <- getSetting TargetPlatform
buildPlatform <- getSetting BuildPlatform
pure [ "--enable-shared=no"
pure $ [ "--enable-shared=no"
, "--with-pic=yes"
, "--host=" ++ targetPlatform -- GMP's host is our target
, "--build=" ++ buildPlatform ]
-- Disable GMP's alloca usage on wasm32, it may
-- cause stack overflow (#22602) due to the
-- rather small 64KB default stack size. See
-- https://gmplib.org/manual/Build-Options for
-- more detailed explanation of this configure
-- option.
<> [ "--enable-alloca=malloc-reentrant" | targetArch == "wasm32" ]
, builder (Configure libffiPath) ? do
top <- expr topDirectory
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment