Skip to content
Snippets Groups Projects
Commit 1d61cabd 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)
parent 4ff4bc65
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,6 @@ configureBuilderArgs = do ...@@ -15,7 +15,6 @@ configureBuilderArgs = do
targetPlatform <- queryTarget targetPlatformTriple targetPlatform <- queryTarget targetPlatformTriple
buildPlatform <- queryBuild targetPlatformTriple buildPlatform <- queryBuild targetPlatformTriple
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
...@@ -25,6 +24,10 @@ configureBuilderArgs = do ...@@ -25,6 +24,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