简体   繁体   中英

Yesod haskell-stack installing -fPIC

This is the first time I try to install Haskell yesod but I run through some problems when I use these commands on Arch Linux

yesod devel 

or

stack exec -- yesod devel


/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libHSrts.a(Scav.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libHSrts.a(Compact.o): relocation R_X86_64_32S against symbol `mblock_cache' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libHSrts.a(GCAux.o): relocation R_X86_64_32S against symbol `mblock_cache' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libHSrts.a(MarkWeak.o): relocation R_X86_64_32S against symbol `stg_DEAD_WEAK_info' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libCffi.a(closures.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /home/romano/.stack/programs/x86_64-linux/ghc-tinfo6-7.10.3/lib/ghc-7.10.3/rts/libCffi.a(ffi64.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
Exit code ExitFailure 1 while running ["ghc","-clear-package-db","-global-package-db","-hide-all-packages","-package","base","-package","Cabal-1.22.5.0","/tmp/stack16245/Setup.hs","-o","/home/romano/.stack/setup-exe-cache/x86_64-linux-tinfo6/tmp-setup-Simple-Cabal-1.22.5.0-ghc-7.10.3","-rtsopts"] in /tmp/stack16245/
ExitFailure 1
Type help for available commands. Press enter to force a rebuild.

Now I am not sure why this happens but I think my database settings are wrong

Some users have come across a linker errors that seem to be dependent on the local environment, ie the package may compile on a different machine. The issue has been reported to be non-deterministic in some cases.

The issue may be related to the use of hardening flags in some cases, specifically those related to producing position independent executables (PIE).

In Arch Linux, the support for this is provided by the hardening-wrapper package . Possible workaround:

sudo vim /etc/hardening-wrapper.conf

* vim, nan, emacs or whatever editor you prefer.

Change HARDENING_PIE=1 to HARDENING_PIE=0
save it.

That's it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM