-
Notifications
You must be signed in to change notification settings - Fork 843
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
Linker error makes it impossible to use a stack-provided ghc #2712
Comments
I think this might be the cause: |
It seems likely that is the cause! Good sleuthing. I am using ubuntu 16.04, which is before the release with gcc hardening. I have ld-2.26.1 What should be done about this? Linking is not something I am very familiar with. Do we need to have a way to compile everything -fPIC? Perhaps we need to use the |
I found that there are a few issues that have already been opened: Frustratingly, all of them are now closed... The good thing, is that a fix to add a The bad thing is... I don't have that flag in Stack 1.2.0 :/ I'm currently building stack from sources, hopefully it'll work (regardless if it works, |
Those issues were recently resolved, they are not yet in a released version of stack. Use stack built from the git repo to get the fix! |
Yeah, I tried it out.... it almost works I'm not yet sure if the detection is broken... I'll test that soon Anyhow, building my project still fails:
I guess that hsc2hs needs to be fixed as well |
I confirm that the autodetection for the correct build-type works correctly. I'd have suggested to release 1.2.1 as soon as possible, but without the fixes for hsc2hs there'll still be plenty of people who will find themselves unable to build their projects |
Does this occur with GHCs from https://launchpad.net/~hvr/+archive/ubuntu/ghc as well? |
I got the build working with your ghc... |
Since about a week I'm experiencing strange build errors within Travis (and only there, not even in a local container): https://travis-ci.org/sgraf812/feed-gipeda/jobs/170090429 This also happens for previously green builds (e.g. from 2 months ago) when I restart them, but only my LTS-2.22 and LTS-6.2* builds are affected, the LTS-3.* and LTS-7.* builds are fine. Is this related? |
I not sure how earlier I got it to work at all |
@berdario it would be interesting to see how exactly |
I'm running Ubuntu 16.10 and seeing messages about fPIC as well.
|
Same thing in Debian Sid with stack 1.2.0:
|
@hvr do you have any suggestions to discover how hsc2hs is being invoked by stack? The only idea I have is to use This is the content of the
Unfortunately, there's no Weirdly, to avoid confusion, be aware that's not a sufficient solution. Try to build an empty project with any of the following packages among the build-depends: |
I updated the issue description with a (for now quite minimal) checklist about the steps that we can take... feel free to amend it as new details are understood |
@hvr This is the output of |
@berdario I don't use Stack myself so I can't debug this, but from the looks of it this is very likely a bug in Stack; it works flawless with |
@hvr I see (sorry, after this I'll stop notifying you), but there's one last interesting tidbit (as I mentioned in the other issue): This also happens with Cabal, if invoked via stack (so apparently, a few environment variables are enough to trigger the problem) like
network.log:
clock.log:
|
@berdario That's interesting... which env-vars does |
@hvr sorry I just realized that OTOH, I installed cabal-install via stack... |
@berdario just to be sure, as I'm not able to reproduce the problem you're experiencing locally with cabal: could you try in a new empty user-account with cabal-install-1.24 & ghc-8.0.1 from my ppa? (you can try |
I already tried... it works But it fails with cabal-install-1.22 and it seems that if I build stack from git, it's picking up Cabal-1.22 |
I am not sure how it relates to |
Seems to have same linking problem for clock. OS: 4.11.9-1-ARCH
is there a fix? Edit: Seems that the problem was fixed by installing ncurses5-compat-libs. |
@ardeleanasm I'm on stack 1.5.0 on Arch and reinstalling doesn't work. |
@nd2s I don't have the problem anymore. I installed ncurses5-compat-libs, removed /home/user/.stack/ and reinstalled stack. hope it works! |
@ardeleanasm Installing |
@nd2s you're welcome and I'm glad I could help you! |
I had the same problem since about 2 weeks. I'm on Arch Linux with stack 1.5.1 and GHC 7.10.3 (according to the build plan). Finally, the @berdario's fix solved the problem for me. My project is a @yesodweb Yesod app, so maybe it is related to position independent execution (PIE). I don't have hardening-wrapper installed. I tried a lot with There is a short FAQ entry on this problem, too. |
I'm having this problem now and installing EDIT: |
I've also had this problem on arch. As been said on wiki there are some troubles with dynamic and static link. So, basically, I tried to installed some libs depend on old base (<4.10) with brand new ghc, just from arch repo, and then ran into dependency hell with errors like described above. So what i've done
That's it! Finally I managed to install stylish-haskell. |
Just ran into this issue on arch, trying to build a project that had been building fine up until now. After checking this issue and #3518 , What worked for me was a slight variation of @Gzernov 's process above:
That worked for me, but unfortunately, After that I remembered that I have Luckily for me when it's time to actually deploy I build my project inside a docker container (and during local development run from GHCI), so being able to start GHCI is enough for me as far as local development goes. UPDATE - |
@t3hmrman I think the problem in Arch started a month ago after this change to the ncurses package. Check senorhesles's workaround: adding "-no-pie" did the trick for me. |
This problem still exists on Arch with current stack 1.5.1 and GHC 8.0.2. I had to change this in the settings file:
Before I found this solution, I desperately removed everything related to xmonad, haskell, stack, cabal, ghc, including |
I'm having this problem with Arch and Stack 1.6.1 with ghc 8.2.2 as well. Changing to |
Adding |
@chrissound, @drvink: This is being discussed in #3518. |
This can be easily fixed in your GHC installation:
Hopefully a fixed bindist (or the newer GHC 8.0.2 which ships with this fix already) will be released soon
Steps needed to support Linux distributions that enable PIE by default (Ubuntu 16.10, Debian Sid, etc.)
Old issue description:
This it the same issue that I reported in this other ticket, but I now realized that my "fix" of removing
~/.stack/programs/x86_64-linux/ghc-8.0.1/
actually brought stack in an inconsistent state... and without it being aware of it, it was always selecting the system-installed ghc.I thus moved away the whole
~/.stack/
directory, and tried to setup again... I tried both with lts version 7 and 6 (with--no-system-ghc
), and the setup of ghc fails at linking step with both versionsI'm running Ubuntu 16.10, and I'm running
The error is the same as in the other ticket, which I'll link again here
Stack version
Method of installation
Installed into
~/.local/bin/
viastack upgrade
The text was updated successfully, but these errors were encountered: