-
Notifications
You must be signed in to change notification settings - Fork 698
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
Choice of linker should consider whether it supports LDFLAGS #9828
Comments
Is cabal calling the linker here or GHC? @erikd You looked at linker feature detection before. Do you have any take on this? |
Frustratingly, am having difficulty reproducing, though I updated both |
OK, it indeed seems to be a GHC issue rather than a cabal issue, sorry for the noise. ghcup install ghc "$ghcVer" -- --enable-ld-override
ghcup install cabal "$cabalVer"
ghcup set ghc "$ghcVer"
ghcup set cabal "$cabalVer"
export LDFLAGS='-Wl,-z,pack-relative-relocs'
git clone https://github.com/haskell/"$pkg"
cd "$pkg"
autoreconf -i
cabal configure
cabal build With these parameters, I can reproduce (eg for
It's quite probable nothing needs to be done here, but I leave the closure decision to you. |
Seems to be resolved upstream: https://gitlab.haskell.org/ghc/ghc/-/commit/32a8103f3b3e22907fdd67b69c919c5251d8cc20 Let's optimistically close. |
Nothing to be sorry about. It's a common misconception that cabal invokes the linker. In the most common cases it doesn't and linking is left to ghc. |
Describe the bug
network
,time
,unix
fail to build whenLDFLAGS
contains-Wl,-z,pack-relative-relocs
. This is becausecabal
builds them withLD=ld.gold
, which doesn't support this feature. This breaks builds on Arch Linux, whose default build configuration recently added the flag toLDFLAGS
.To Reproduce
Steps to reproduce the behavior:
Expected behavior
cabal build
tests$LD $LDFLAGS
works before picking it, and then either warnsld.gold doesn't support LDFLAGS as set
orCould not find working linker
System information
cabal
,ghc
versions:cabal-install 3.10.2.1
,ghc 9.8.2
Additional context
Reported in Arch Linux upstream as well, and in GHC which had a similar issue. Also mistakenly reported this in stack due to initial confusion as to the cause.
The text was updated successfully, but these errors were encountered: