Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stack setup fails on arch linux #2414

Closed
wedens opened this issue Jul 25, 2016 · 7 comments
Closed

stack setup fails on arch linux #2414

wedens opened this issue Jul 25, 2016 · 7 comments

Comments

@wedens
Copy link

wedens commented Jul 25, 2016

stack new stack-error && cd stack-error && stack setup fails on any resolver with ghc version different from system ghc.
Perhaps it is #614.

stack (from community/stack): 1.1.2
ghc: 8.0.1
ncurses5-compat-libs is installed

Version 1.1.2 x86_64 hpack-0.14.1
2016-07-25 15:49:08.922891: [debug] Checking for project config at: /tmp/dsfsd/stack.yaml @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:811:9)
2016-07-25 15:49:08.923064: [debug] Loading project config file stack.yaml @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:829:13)
2016-07-25 15:49:08.924994: [debug] Checking whether stack was built with libgmp4 @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:326:5)
2016-07-25 15:49:08.925071: [debug] Run process: ldd /usr/bin/stack @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-25 15:49:08.930017: [debug] Stack was not built with libgmp4 @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:330:14)
2016-07-25 15:49:08.930109: [debug] Trying to decode /home/wedens/.stack/build-plan-cache/x86_64-linux/lts-6.9.cache @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-07-25 15:49:08.948281: [debug] Success decoding /home/wedens/.stack/build-plan-cache/x86_64-linux/lts-6.9.cache @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-07-25 15:49:08.948560: [debug] Checking whether stack was built with libgmp4 @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:326:5)
2016-07-25 15:49:08.948673: [debug] Run process: ldd /usr/bin/stack @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-25 15:49:08.953705: [debug] Stack was not built with libgmp4 @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Config src/Stack/Config.hs:330:14)
2016-07-25 15:49:08.953790: [debug] Getting system compiler version @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Setup src/Stack/Setup.hs:341:17)
2016-07-25 15:49:08.953885: [debug] Run process: ghc --info @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-25 15:49:08.998771: [debug] Performing a sanity check on: /home/wedens/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:Stack.Setup src/Stack/Setup.hs:1326:5)
2016-07-25 15:49:08.998879: [debug] Run process: ghc /tmp/stack-sanity-check16621/Main.hs -no-user-package-db @(stack-1.1.2-E7j2u8dvJq15OGUl9w7aBF:System.Process.Read src/System/Process/Read.hs:283:3)
The GHC located at /home/wedens/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc failed to compile a sanity check. Please see:

    http://docs.haskellstack.org/en/stable/install_and_upgrade/

for more information. Exception was:
Running /home/wedens/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc /tmp/stack-sanity-check16621/Main.hs -no-user-package-db in directory /tmp/stack-sanity-check16621/ exited with ExitFailure 1

[1 of 1] Compiling Main             ( /tmp/stack-sanity-check16621/Main.hs, /tmp/stack-sanity-check16621/Main.o )
Linking /tmp/stack-sanity-check16621/Main ...

/usr/bin/ld: /tmp/stack-sanity-check16621/Main.o: relocation R_X86_64_32S against `stg_bh_upd_frame_info' can not be used when making a shared object; recompile with -fPIC
/tmp/stack-sanity-check16621/Main.o: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
@wedens
Copy link
Author

wedens commented Jul 25, 2016

Works on other arch linux system with almost the same environment

@mgsloan mgsloan added this to the Support milestone Jul 26, 2016
@lthms
Copy link

lthms commented Jul 30, 2016

I currently have the same issue :.

@dkasak
Copy link
Contributor

dkasak commented Aug 7, 2016

I determined this to be a problem of using Arch's hardening-wrapper (which wraps calls to gcc to include special hardening flags). Either of the following workarounds fix the problem for me:

  • Removing the hardening-wrapper package and logging out then into your account again.
  • Setting HARDENING_PIE=0 in /etc/hardening-wrapper.conf.

The relevant upstream ticket for this issue seems to be this.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 8, 2016

@dkasak Cool, good sleuthing! Feel like adding to the FAQ section here https://docs.haskellstack.org/en/stable/faq/#i-get-strange-ld-errors-about-recompiling-with-fpic ?

@lethom @wedens Does @dkasak 's info help?

@wedens
Copy link
Author

wedens commented Aug 9, 2016

@mgsloan yes it does. I hope this issue will be fixed upstream.
thanks, @dkasak

@dkasak
Copy link
Contributor

dkasak commented Aug 9, 2016

@mgsloan Added the information in #2462. I think this can be closed once you merge.

@mgsloan
Copy link
Contributor

mgsloan commented Aug 9, 2016

Great, thanks!

@mgsloan mgsloan closed this as completed Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants