Skip to content
Snippets Groups Projects
Commit 7d982a31 authored by Cheng Shao's avatar Cheng Shao
Browse files

hadrian: disable PIC for in-tree GMP on wasm32

This patch disables PIC for in-tree GMP on wasm32 target. Enabling PIC
unconditionally adds undesired code size and runtime overhead for
wasm32.

(cherry picked from commit f9c1ae12)
(cherry picked from commit 5f728fc4)
(cherry picked from commit f45b02a8)
parent ff795e0f
No related branches found
No related tags found
No related merge requests found
...@@ -14,7 +14,6 @@ configureBuilderArgs = do ...@@ -14,7 +14,6 @@ configureBuilderArgs = do
targetPlatform <- getSetting TargetPlatform targetPlatform <- getSetting TargetPlatform
buildPlatform <- getSetting BuildPlatform buildPlatform <- getSetting BuildPlatform
pure $ [ "--enable-shared=no" pure $ [ "--enable-shared=no"
, "--with-pic=yes"
, "--host=" ++ targetPlatform -- GMP's host is our target , "--host=" ++ targetPlatform -- GMP's host is our target
, "--build=" ++ buildPlatform ] , "--build=" ++ buildPlatform ]
-- Disable GMP's alloca usage on wasm32, it may -- Disable GMP's alloca usage on wasm32, it may
...@@ -24,6 +23,10 @@ configureBuilderArgs = do ...@@ -24,6 +23,10 @@ configureBuilderArgs = do
-- more detailed explanation of this configure -- more detailed explanation of this configure
-- option. -- option.
<> [ "--enable-alloca=malloc-reentrant" | targetArch == "wasm32" ] <> [ "--enable-alloca=malloc-reentrant" | targetArch == "wasm32" ]
-- Enable PIC unless target is wasm32, in which
-- case we don't want libgmp.a to be bloated due
-- to PIC overhead.
<> [ "--with-pic=yes" | targetArch /= "wasm32" ]
, builder (Configure libffiPath) ? do , builder (Configure libffiPath) ? do
top <- expr topDirectory top <- expr topDirectory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment