Skip to content
Snippets Groups Projects
Commit f9c1ae12 authored by Cheng Shao's avatar Cheng Shao Committed by Marge Bot
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.
parent cf49fb5f
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,6 @@ configureBuilderArgs = do
targetPlatform <- queryTarget targetPlatformTriple
buildPlatform <- queryBuild targetPlatformTriple
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
......@@ -25,6 +24,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