Created
January 3, 2018 15:46
-
-
Save bts/0f0abdef6f69b1a165181ef1d1be0360 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[1 of 1] Compiling Columnate ( src/Columnate.hs, dist/build/Columnate.o ) | |
/nix/store/drcl6z8jqwkqkbwspilyk017biyfd969-binutils-2.28.1/bin/ld: /nix/store/v8qa2qbwrb7s8b4piygdiii7p7jpv068-gcc-6.4.0/lib/gcc/x86_64-unknown-linux-gnu/6.4.0/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object | |
/nix/store/drcl6z8jqwkqkbwspilyk017biyfd969-binutils-2.28.1/bin/ld: final link failed: Nonrepresentable section on output | |
collect2: error: ld returned 1 exit status | |
`cc' failed in phase `Linker'. (Exit code: 1) |
I did it! I got a pull request vaibhavsagar/experiments#3 that clarified a few things. Here's a working derivation:
{ nixpkgs ? import <nixpkgs> {}, compiler ? "ghc822" }:
let
inherit (nixpkgs) pkgs;
f = { mkDerivation, base, hedgehog, optparse-generic, stdenv
, tasty, tasty-hedgehog, text, these
}: let
these' = pkgs.haskell.lib.doJailbreak these;
in
mkDerivation {
pname = "columnate";
version = "0.1.0.0";
src = ./.;
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [ base optparse-generic text these' ];
executableHaskellDepends = [ base ];
testHaskellDepends = [ base hedgehog tasty tasty-hedgehog text ];
homepage = "http://github.com/bts/columnate";
description = "Columnate data sets while preserving color codes";
license = pkgs.stdenv.lib.licenses.bsd3;
enableSharedExecutables = false;
enableSharedLibraries = false;
configureFlags = [
"--ghc-option=-optl=-static"
"--ghc-option=-optl=-L${pkgs.gmp5.static}/lib"
"--ghc-option=-optl=-L${pkgs.glibc.static}/lib"
"--ghc-option=-fPIC"
];
};
haskellPackages = if compiler == "default"
then pkgs.haskellPackages
else pkgs.haskell.packages.${compiler};
drv = haskellPackages.callPackage f {};
in
if pkgs.lib.inNixShell then drv.env else drv
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't think that made a difference either. For posterity:
And the error seems to be related to https://stackoverflow.com/questions/44429253/building-a-shared-library-created-a-static-library-instead