[Nix-dev] gcc_s with Haskell packages

Mateusz Kowalczyk fuuzetsu at fuuzetsu.co.uk
Fri Aug 1 06:30:03 CEST 2014


On 08/01/2014 06:22 AM, Patrick Wheeler wrote:
>> I'm trying to get the bits-extras Haskell package to compile. The caveat
> is that it needs gcc_s as an available library.
> 
> One method that has work for in past for similar problems was to use a
> custom ghc using `ghcWtihPackages`. `gcc_s` would be one of the packages
> you would add to the scope of ghc. I think that most all packages can then
> only be added or removed by changing your custom derivation though rather
> than using `nix-env -iA` however.

???

gcc_s is not a package so I have no idea what you're suggesting here

> Alternatively it seems like you could create you own `cabal` nix derivation
> that would use NIX_LDFLAGS by adding it with `--extra-lib-dir` option.
>  Pretty sure that option should work even when not invoking cabal directly.

As I already pointed out, just setting NIX_LDFLAGS inside the nix file
did take effect but it did not change the resulting error

> Here is where you would add it:
> https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/cabal/default.nix#L209
> 
> You could then override the definition of `cabal` in your config file so
> that you could install all current packages with the new version of cabal.
> 
> A down side of this second method is that your package installs become less
> pure.  They could have un track dependencies that you would have to
> manually keep track of.
> 
> Patrick

What I did try recently that I foolishly haven't tried earlier was
removing the mention of gcc_s from the cabal file (and the .nix file)
itself upon a suggestion on IRC. This does let it build but I stumble
upon a different problem I haven't had a chance to investigate yet but
seems disjoint from this.

So it seems like the ‘solution’ was to remove gcc_s mention from the
extra-libraries bit in the cabal file but I can not confirm whether that
produces a functioning library yet. I do not that doing something like
ghci -lgcc_s *does* find gcc_s and loads it up so it perhaps seems that
the cabal builder is being too eager with passing whatever is in
extra-libraries to ld.

> 
> On Thu, Jul 31, 2014 at 2:23 PM, Mateusz Kowalczyk <fuuzetsu at fuuzetsu.co.uk>
> wrote:
> 
>> Hi,
>>
>> I'm trying to get the bits-extras Haskell package to compile. The caveat
>> is that it needs gcc_s as an available library.
>>
>> What I'm currently doing is adding -lgcc_s to NIX_LDFLAGS but that does
>> not seem to help as the compilation fails with:
>>
>>>> /nix/store/gnk8w6qh6fwfamwy8ipl8zg149inw9rg-gcc-wrapper-4.8.3/bin/ld
>> returned
>> ExitFailure 1 with error message:
>> /nix/store/bzvdg7g74rkw7p3zw3mqpp7ynnq4mxf1-binutils-2.23.1/bin/ld: cannot
>> find -lgcc_s
>> Setup: /tmp/6042.o: does not exist
>>
>> I tried adding gcc to buildInputs just in case but it did not seem to
>> change anything. You can see my default.nix for bits-extras at [1]. I
>> have also produced a more verbose than default output by using runghc on
>> Setup by hand with -v3 which shows various vars, you can see that at [2].
>>
>> I see many packages in nixpkgs with the NIX_LDFLAGS="-lgcc_s" present
>> but it does not seem to work in my case: perhaps something extra is
>> needed for Haskell packages. Can anyone point me in the right direction?
>>
>> [1]: http://lpaste.net/108516
>> [2]: http://lpaste.net/108517
>>
>> --
>> Mateusz K.
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at lists.science.uu.nl
>> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>>
> 
> 
> 


-- 
Mateusz K.


More information about the nix-dev mailing list