
On Thu, 2019-10-17 at 01:41 +0200, Niklas Hambüchen wrote:
On 16/10/2019 16:22, Neil Mayhew wrote:
On 2019-10-16 7:57 a.m., Olaf Klinke wrote:
pandoc > collect2: error: ld returned 1 exit status pandoc > `gcc' failed in phase `Linker'. (Exit code: 1)
[...] Can you get more info about what the linker error is?
Indeed, the linker exiting with status 1 without any stderr message sounds like your linker is crashing.
Consider `stack build --cabal-verbose`, and if that doesn't provide the necessary level of detail yet, take the last `ghc` invocation it makes, run that directly and add `-v` to that to get GHC's verbose output, which will show you the full linker invocation (which you may then, again, run directly, thus drilling down to the tool that exits with an error unexpectedly).
Alternatively, you may use `strace -fy` on the top-level to get a full understanding of all IO that any process involved does, but it will be verbose.
I just updated the resolver in my stack.yaml from lts-12.26 to lts- 13.11 and suddenly pandoc broke again, on the very same machine that happily builds pandoc when using lts-12.26. While fiddling with the various ways of keep-tmp-files as suggested above, ghc and stack filled my disk, so I went and cleaned some cache. And suddenly the build worked! Could it be that the linker error, too, is simply due to lack of disk space? The machine I first encountered the error on has an SSD of only 20GB with 2GB for /tmp. I had to temporarily re-locate /tmp to another partition to get ghc installed at all. Occasionally stack build --cabal-verbose gave me explicit errors about no space left on device, only the linker error does not mention it. That said, the stack FAQ [1] mentions changing the temporary directory but then says nothing about the build dir on non-NIX systems. Doesanyone know more? Olaf [1] https://docs.haskellstack.org/en/stable/faq/#can-i-change-stacks-default-tem...