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

Void Linux: stack build crashes - GHC's choice of ld #5633

Open
Osrepnay opened this issue Nov 7, 2021 · 2 comments
Open

Void Linux: stack build crashes - GHC's choice of ld #5633

Osrepnay opened this issue Nov 7, 2021 · 2 comments

Comments

@Osrepnay
Copy link

Osrepnay commented Nov 7, 2021

General summary/comments (optional)

I'm using the musl version of Void Linux, so the error might have something to do with musl. Also, when running the command that caused the error manually (/home/jimothy/.stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple...) I get a segfault.

Steps to reproduce

  1. Run stack new helloworld new-template
  2. Run stack build --verbose

Expected

The project building successfully

Actual

Error: https://gist.github.com/Osrepnay/ecd91eb57788a69f33826adf3f4dae6a

Stack version

$ stack --version
Version 2.7.3, Git revision 7927a3aec32e2b2e5e4fb5be76d0d50eddcc197f x86_64 hpack-0.34.4

Method of installation

Both installing from void's repos with # xbps-install stack and installing with the shell script do this, with the dependencies gcc, make, libffi, libffi-devel, zlib, zlib-devel, gmp, gmp-devel, ncurses-libtinfo-libs, ncurses-libtinfo-devel installed (although I'm not sure which -devel packages are necessary).
I also needed to use the fix from #3847 (specifically sudo ln /lib64/ld-musl-x86_64.so.1 /lib/ld-linux-x86-64.so.2) to make stack download ghc and cabal.

@Osrepnay
Copy link
Author

Osrepnay commented Nov 8, 2021

Update: I've switched to directly using the official musl ghc builds in my ~/.stack/config.yaml, but using stack ghc on even a hello world segfaults.

Update Update: I've gotten 8.10.7 working on redneb's musl bindists, but 8.10.4 segfaults because of a libgmp/ld.gold issue.

Update Update Update: I've tested 9.0.1, 8.10.7, 8.10.4, 8.10.3, and 8.10.4 seems to be the only one generating broken executables.

Update Update Update Update: I've tried reconfiguring and installing 8.10.4, and it works now. I don't know why it works now, maybe configure doesn't update disable-ld-override on the second run??\

Update Update Update Update Update: On redneb's builds at least, it does appear that I need to set $LD to ld.bfd and run ./configure with --disable-ld-override (?) on the first attempt at configuring for it to work.

@hasufell
Copy link
Contributor

hasufell commented Mar 31, 2024

GHCup is moving towards passing --disable-ld-override by default (not yet released). You will then be able to use that in conjunction with the stack provided metadata: https://www.haskell.org/ghcup/guide/#using-stacks-setup-info-metadata-to-install-ghc

@mpilgrem mpilgrem changed the title Building a project on Void Linux crashes Void Linux: stack build crashes - GHC's choice of ld Mar 31, 2024
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

3 participants