<div dir="ltr">Hi Dominick,<div><br></div><div>which version of Fedora Linux are you on? The -fPIC message from the linker may well be a red herring. AFAIR generating PIC is the default in GHC, at least for dynamic libraries.</div><div><br></div><div>Best,</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">--<br>Mathieu Boespflug<br>Founder at <a href="http://tweag.io" target="_blank">http://tweag.io</a>.</div></div>
<br><div class="gmail_quote">On 13 August 2016 at 05:55, Dominick Samperi <span dir="ltr"><<a href="mailto:djsamperi@gmail.com" target="_blank">djsamperi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
I am getting relocation errors when building an executable<br>
(specifically, the "H"<br>
executable -- part of haskellR) under Fedora Linux, and the message says to<br>
"recompile with -fPIC".<br>
<br>
The FAQ associated with H suggests that I switch to the gold linker<br>
(ld.gold) due to bugs in the default linker (ld.bfd), but this only<br>
changes the wording of the relocation error messages.<br>
<br>
I have tried several strategies for satisfying the -fPIC requirement:<br>
1. In cabal files I insert cc-options: and ghc-options: lines including -fPIC<br>
2. To the 'cabal install' command line I add:<br>
    --ghc-option=-fPIC --hsc2hs-option=-cflag=-fPIC<br>
3. When building ghc 8.0.1 from source I modify <a href="http://config.mk" rel="noreferrer" target="_blank">config.mk</a> by including:<br>
   CONF_CC_OPTS += -fPIC<br>
   SRC_HSC2HS_OPTS += --cflag=-fPIC<br>
   CONF_CC_OPTS_STAGE0 = -fno-stack-protector -fPIC<br>
   [same for STAGE1 and STAGE2]<br>
<br>
All of this doesn't fix the problem, and the error messages still say<br>
"recompile with -fPIC".<br>
<br>
This may be a bug, but I'm not sure where. Any ideas?<br>
<br>
Thanks,<br>
Dominick<br>
______________________________<wbr>_________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/ghc-devs</a><br>
</blockquote></div><br></div>