Skip to content
Snippets Groups Projects
Commit c7faa919 authored by Cheng Shao's avatar Cheng Shao :beach:
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 5bc4f5e3
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ configureBuilderArgs = do
targetPlatform <- getSetting TargetPlatform
buildPlatform <- getSetting BuildPlatform
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
......@@ -24,6 +23,10 @@ configureBuilderArgs = do
-- more detailed explanation of this configure
-- option.
<> [ "--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
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