configure ignores LDFLAGS
Summary
It seems that ./configure
ignores LDFLAGS
(whereas ghc-toolchain
doesn't).
Steps to reproduce
LDFLAGS="-Lsomethingbogus" ./configure
You should get
There are some differences between the toolchain configured by "configure" (hadrian/cfg/default.target) and the toolchain configured by the "ghc-toolchain" program (hadrian/cfg/default.target.ghc-toolchain).
20c20
< { ccLinkProgram = Program { prgPath = "/usr/bin/gcc" , prgFlags = ["--target=arm64-apple-darwin","-Wl,-no_fixup_chains","-Wl,-no_warn_duplicate_libraries"] }
---
> { ccLinkProgram = Program { prgPath = "/usr/bin/gcc" , prgFlags = ["--target=arm64-apple-darwin","-Lsomethingbogus","-Wl,-no_fixup_chains","-Wl,-no_warn_duplicate_libraries"] }
Expected behavior
./configure
-based toolchain configuration should also consider LDFLAGS
into the cclinker program.
I suppose this is not a priority because ghc-toolchain
is already doing this right and we ultimately want to move toolchain configuration to it. It is yet another datapoint to hurry on the move (BTW, I think it has been two releases since ghc-toolchain is available opt-in... perhaps the time to make the move is drawing close?).
Environment
- GHC version used: HEAD
Optional:
- Operating System: macOS
- System Architecture: aarch64