Can someone distill from the Github issue a concise set of instructions to reproduce this issue? I have installed nix but it's totally unclear to me how to reproduce this. At the moment I have,
$ cd ~/ghc/ghc$ nix-shell -Ahaskell.packages.ghcHEAD.ghc '<nixpkgs>'error: Package ‘VisualBoyAdvance-1.7.2’ in ‘/nix/store/p1jp78n8mmk5sj9wpz5hf5jk8x8zqcdy-nixpkgs-16.03pre71923.3087ef3/nixpkgs/pkgs/misc/emulators/VisualBoyAdvance/default.nix:18’ is marked as broken, refusing to evaluate.For `nixos-rebuild` you can set { nixpkgs.config.allowBroken = true; }in configuration.nix to override this.For `nix-env` you can add { allowBroken = true; }to ~/.nixpkgs/config.nix.
It seems like ./configure detects the presence of librt, so features that depend on it are enabled, but the library is never actually linked. This issue is rather serious for us, because it prevents us from updating to GHC 7.10.3 on NixOS, i.e. we can no longer support upcoming versions of LTS Haskell without a fix for this problem. Any suggestions how to fix or work aroung this phenomenon are very welcome.
On my working system, utils/hsc2hs/dist-install/build/tmp/hsc2hs is built with the option -optl-lpthread also, which is missing from the above command line.
This flag comes from the extra-libraries field of the unix package, which is populated from the configure variable EXTRA_LIBS via libraries/unix/unix.buildinfo.in. On my system pthread is added to that variable by this from configure.ac:
checking for library containing sem_close... none required
so that explains why later -optl-pthread is not provided when building utils/hsc2hs/dist-install/build/tmp/hsc2hs.
I don't understand why on your Nix system configure apparently detected that -lpthread is not needed for the symbol sem_close. Apparently it was wrong about that. I also have no idea what this has to do with the commit that apparently broke things for you. (I am building the tip of the ghc-7.10 branch, so I also have that commit.)
A NixOS user has indicated that master works fine and the issue has been patch. Apparently the problem was due to an interaction with NixOS's GCC wrapper,
<bgamari> well, there's a bug filed against 7.10.3<bgamari> #11147<phaskell> #11147: GHC 7.10.3 does not compile on NixOS - https://ghc.haskell.org/trac/ghc/ticket/11147<pikajude> that was fixed<pikajude> well, it was patched<bgamari> ahh, the root cause was identified?<pikajude> bgamari: the response file support in SysTools apparently doesn't cooperate with the nix GCC wrapper