haskell.nix
haskell.nix copied to clipboard
[GHC 8.10.1] ld warnings when compiling
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenCountryCode_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenDomesticAccountNumber_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenFullName_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypesziCurrency_zdfHasGenCurrency_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenRoutingNumber_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenRecurrenceNumber_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenRemittanceInfo_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenUserData_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenKRN_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_ILTXNziTransactionziShared_zdfHasGenCallbackFormat_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenMonetaryAmount_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_ILTXNziTransactionziShared_zdfHasGenTransactionStatus_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenCallbackTopic_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenSettlementToken_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenVerifier_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `hedgehogzmextraszm0zi0zi1zminplace_HedgehogziGenziClass_zdfHasGenUTCTime_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `hedgehogzmextraszm0zi0zi1zminplace_HedgehogziGenziClass_zdfHasGenDay_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenSwedishAccountNumber_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenIBAN_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenAmount_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenFlatAddress_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `basiczmtypeszm0zi0zi1zminplace_DataziTypes_zdfHasGenBIC_closure' are not defined
/nix/store/7wy2mifb0igrp9hzf9dzwddadbs7ai7d-binutils-2.31.1/bin/ld: warning: type and size of dynamic symbol `hedgehogzmextraszm0zi0zi1zminplace_HedgehogziGenziClass_zdfHasGenBool_closure' are not defined
I'm getting a bunch of these warnings when compiling now on 8.10.1, is this expected or am I doing something wrong?
It's been over 2 years, but did you figure out what was wrong with this?
Did not investigate further 😅
Using the gold linker by passing --ghc-options=-optl-fuse-ld=gold
to cabal in the command line fixed this for me. I don't have it anymore, but at some point I remember I also had to configure .cabal files to use the gold linker for very strange reasons (I remember the appearance of ghc only using the gold linker if that argument was the last one, or something along those lines).
These messages still occur with a recent haskell.nix. I have managed to obtain a small reproducer, but have not investigated further than that.
With the below flake on x86_64, running nix develop -c bash -c 'cabal clean && cabal build -O0 pkg-b'
gives the warning /nix/store/f0rrfmf8kh5bsiql5bbq7m4h3xgihpnx-binutils-2.38/bin/ld: warning: type and size of dynamic symbol `pkgzmazm0zi0zi0zi1zminplace_Lib_defaultFoo_closure' are not defined
. However, building via nix build
does not exhibit this message.
flake.nix
{
description = "ld-message";
inputs.haskellNix.url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { self, nixpkgs, flake-utils, haskellNix }:
flake-utils.lib.eachSystem [ "x86_64-linux" ] (system:
let
overlays = [ haskellNix.overlay
(final: prev: {
# This overlay adds our project to pkgs
ldMessageProject =
final.haskell-nix.cabalProject {
src = ./.;
compiler-nix-name = "ghc924";
# This is used by `nix develop .` to open a shell for use with
# `cabal`, `hlint` and `haskell-language-server`
shell.tools = {
cabal = {};
};
# Non-Haskell shell tools go here
# shell.buildInputs = with pkgs; [ ];
# This adds `js-unknown-ghcjs-cabal` to the shell.
# shell.crossPlatforms = p: [p.ghcjs];
};
})
];
pkgs = import nixpkgs { inherit system overlays; inherit (haskellNix) config; };
flake = pkgs.ldMessageProject.flake {
# This adds support for `nix build .#js-unknown-ghcjs:hello:exe:hello`
# crossPlatforms = p: [p.ghcjs];
};
in flake // {
# Built by `nix build .`
defaultPackage = flake.packages."pkg-b:lib:pkg-b";
});
}
cabal.project
index-state: 2022-08-04T00:00:00Z
packages:
pkg-a
pkg-b
pkg-a/pkg-a.cabal
cabal-version: 3.0
name: pkg-a
version: 0.0.0.1
library
exposed-modules: Lib
other-modules:
default-language: Haskell98
build-depends:
, base
pkg-a/Lib.hs
module Lib (
defaultFoo,
Foo,
) where
newtype Foo = Foo ()
defaultFoo :: Foo
defaultFoo = Foo mempty
pkg-b/pkg-b.cabal
cabal-version: 3.0
name: pkg-b
version: 0.0.0.1
library
exposed-modules: M
other-modules:
default-language: Haskell98
build-depends:
, base
, pkg-a
pkg-b/M.hs
module M (
bar,
) where
import Lib (Foo,defaultFoo)
bar :: Foo
bar = defaultFoo
flake.lock
{
"nodes": {
"HTTP": {
"flake": false,
"locked": {
"lastModified": 1451647621,
"narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=",
"owner": "phadej",
"repo": "HTTP",
"rev": "9bc0996d412fef1787449d841277ef663ad9a915",
"type": "github"
},
"original": {
"owner": "phadej",
"repo": "HTTP",
"type": "github"
}
},
"cabal-32": {
"flake": false,
"locked": {
"lastModified": 1603716527,
"narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=",
"owner": "haskell",
"repo": "cabal",
"rev": "48bf10787e27364730dd37a42b603cee8d6af7ee",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.2",
"repo": "cabal",
"type": "github"
}
},
"cabal-34": {
"flake": false,
"locked": {
"lastModified": 1640353650,
"narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=",
"owner": "haskell",
"repo": "cabal",
"rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.4",
"repo": "cabal",
"type": "github"
}
},
"cabal-36": {
"flake": false,
"locked": {
"lastModified": 1641652457,
"narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=",
"owner": "haskell",
"repo": "cabal",
"rev": "f27667f8ec360c475027dcaee0138c937477b070",
"type": "github"
},
"original": {
"owner": "haskell",
"ref": "3.6",
"repo": "cabal",
"type": "github"
}
},
"cardano-shell": {
"flake": false,
"locked": {
"lastModified": 1608537748,
"narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=",
"owner": "input-output-hk",
"repo": "cardano-shell",
"rev": "9392c75087cb9a3d453998f4230930dea3a95725",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "cardano-shell",
"type": "github"
}
},
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"locked": {
"lastModified": 1644229661,
"narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghc-8.6.5-iohk": {
"flake": false,
"locked": {
"lastModified": 1600920045,
"narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=",
"owner": "input-output-hk",
"repo": "ghc",
"rev": "95713a6ecce4551240da7c96b6176f980af75cae",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"ref": "release/8.6.5-iohk",
"repo": "ghc",
"type": "github"
}
},
"hackage": {
"flake": false,
"locked": {
"lastModified": 1660266823,
"narHash": "sha256-XrhgxsM2IRQzt88kE3u+VshU9/YN89U1grgbvxSPjYM=",
"owner": "input-output-hk",
"repo": "hackage.nix",
"rev": "acd81051a535540b69cf16d72e25cc9a92f7ded6",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "hackage.nix",
"type": "github"
}
},
"haskellNix": {
"inputs": {
"HTTP": "HTTP",
"cabal-32": "cabal-32",
"cabal-34": "cabal-34",
"cabal-36": "cabal-36",
"cardano-shell": "cardano-shell",
"flake-utils": "flake-utils_2",
"ghc-8.6.5-iohk": "ghc-8.6.5-iohk",
"hackage": "hackage",
"hpc-coveralls": "hpc-coveralls",
"hydra": "hydra",
"nix-tools": "nix-tools",
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
],
"nixpkgs-2003": "nixpkgs-2003",
"nixpkgs-2105": "nixpkgs-2105",
"nixpkgs-2111": "nixpkgs-2111",
"nixpkgs-2205": "nixpkgs-2205",
"nixpkgs-unstable": "nixpkgs-unstable",
"old-ghc-nix": "old-ghc-nix",
"stackage": "stackage"
},
"locked": {
"lastModified": 1660267240,
"narHash": "sha256-JDnEowUedth1jq2g/xbQJ7OEgcK1ps/uGgl7l6C8RPs=",
"owner": "input-output-hk",
"repo": "haskell.nix",
"rev": "748098668b64520fb2f67b790e03448e2c8b9f69",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "haskell.nix",
"type": "github"
}
},
"hpc-coveralls": {
"flake": false,
"locked": {
"lastModified": 1607498076,
"narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=",
"owner": "sevanspowell",
"repo": "hpc-coveralls",
"rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430",
"type": "github"
},
"original": {
"owner": "sevanspowell",
"repo": "hpc-coveralls",
"type": "github"
}
},
"hydra": {
"inputs": {
"nix": "nix",
"nixpkgs": [
"haskellNix",
"hydra",
"nix",
"nixpkgs"
]
},
"locked": {
"lastModified": 1646878427,
"narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=",
"owner": "NixOS",
"repo": "hydra",
"rev": "28b682b85b7efc5cf7974065792a1f22203a5927",
"type": "github"
},
"original": {
"id": "hydra",
"type": "indirect"
}
},
"lowdown-src": {
"flake": false,
"locked": {
"lastModified": 1633514407,
"narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=",
"owner": "kristapsdz",
"repo": "lowdown",
"rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8",
"type": "github"
},
"original": {
"owner": "kristapsdz",
"repo": "lowdown",
"type": "github"
}
},
"nix": {
"inputs": {
"lowdown-src": "lowdown-src",
"nixpkgs": "nixpkgs",
"nixpkgs-regression": "nixpkgs-regression"
},
"locked": {
"lastModified": 1643066034,
"narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=",
"owner": "NixOS",
"repo": "nix",
"rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "2.6.0",
"repo": "nix",
"type": "github"
}
},
"nix-tools": {
"flake": false,
"locked": {
"lastModified": 1659569011,
"narHash": "sha256-wHS0H5+TERmDnPCfzH4A+rSR5TvjYMWus9BNeNAMyUM=",
"owner": "input-output-hk",
"repo": "nix-tools",
"rev": "555d57e1ea81b79945f2608aa261df20f6b602a5",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "nix-tools",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1632864508,
"narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "82891b5e2c2359d7e58d08849e4c89511ab94234",
"type": "github"
},
"original": {
"id": "nixpkgs",
"ref": "nixos-21.05-small",
"type": "indirect"
}
},
"nixpkgs-2003": {
"locked": {
"lastModified": 1620055814,
"narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-20.03-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2105": {
"locked": {
"lastModified": 1655034179,
"narHash": "sha256-rf1/7AbzuYDw6+8Xvvf3PtEOygymLBrFsFxvext5ZjI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "046ee4af7a9f016a364f8f78eeaa356ba524ac31",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-21.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2111": {
"locked": {
"lastModified": 1656782578,
"narHash": "sha256-1eMCBEqJplPotTo/SZ/t5HU6Sf2I8qKlZi9MX7jv9fw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "573603b7fdb9feb0eb8efc16ee18a015c667ab1b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-21.11-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-2205": {
"locked": {
"lastModified": 1657876628,
"narHash": "sha256-URmf0O2cQ/3heg2DJOeLyU/JmfVMqG4X5t9crQXMaeY=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "549d82bdd40f760a438c3c3497c1c61160f3de55",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-22.05-darwin",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-regression": {
"locked": {
"lastModified": 1643052045,
"narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "github"
},
"original": {
"id": "nixpkgs",
"rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2",
"type": "indirect"
}
},
"nixpkgs-unstable": {
"locked": {
"lastModified": 1657888067,
"narHash": "sha256-GnwJoFBTPfW3+mz7QEeJEEQ9OMHZOiIJ/qDhZxrlKh8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "65fae659e31098ca4ac825a6fef26d890aaf3f4e",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"old-ghc-nix": {
"flake": false,
"locked": {
"lastModified": 1631092763,
"narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=",
"owner": "angerman",
"repo": "old-ghc-nix",
"rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8",
"type": "github"
},
"original": {
"owner": "angerman",
"ref": "master",
"repo": "old-ghc-nix",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"haskellNix": "haskellNix",
"nixpkgs": [
"haskellNix",
"nixpkgs-unstable"
]
}
},
"stackage": {
"flake": false,
"locked": {
"lastModified": 1659921295,
"narHash": "sha256-7+4ywHfEXT9BW2YCTuVmRe/874U8DecPO8FmG1IDzzk=",
"owner": "input-output-hk",
"repo": "stackage.nix",
"rev": "c0d746c9b8d1b0125a25cebbec577a78997d4c2a",
"type": "github"
},
"original": {
"owner": "input-output-hk",
"repo": "stackage.nix",
"type": "github"
}
}
},
"root": "root",
"version": 7
}