cabal2nix
cabal2nix copied to clipboard
Deal with gcc_s in extra-libraries field
The bits-extra package has gcc_s in extra-libraries field. What cabal2nix does is put gcc_s as an extra argument and makes extraLibraries = [ gcc_s ];, which doesn't work because such package doesn't exist. I am told that it instead needs to do something with NIX_LDFLAGS="-lgcc_s" and have gcc as a dependency.
You are right, it would be nice if cabal2nix would recognize that library dependency and do the right thing automatically. I'll take a look at that.
For future reference, I should add that adding configureFlags = "--ghc-option=-lgcc_s"; is the solution to the problem as pointed out on mailing lists
I wonder why Cabal itself doesn't manage to pass -lgcc_s in this case? It is in extra-libraries regardless of what packages are passed in (or not) from Nix.
As sternenseemann pointed out in #552, only two Hackage packages require gcc_s, and both still fail to build for unrelated reasons. Is it still worth attempting to fix this here in cabal2nix (can we reasonably expect new packages to continue to use gcc_s going forward)? If not, I'll close my PR, or someone else can do it themselves.