Can't build HEAD with the old build system

Niklas Hambüchen mail at nh2.me
Mon Apr 1 13:30:32 UTC 2019


That sounds good. A few more questions:

What's the exact version of your OS, and of gold?

After getting to the error, can you run the failing ghc invocation directly, and see if the error remains? The one starting with

    "/home/omer/ghc_bins/ghc-8.6.4-bin/bin/ghc" -o
utils/hsc2hs/dist/build/tmp/hsc2hs ...

If yes, can you add a `-v` to it, so we can see the invocations to the programs it calls?

Then, it should show a gcc invocation (which eventually calls gold).
Can you then manually run and add a `-v` to to the gcc invocation as well, so we can see the linker command it runs (see also https://stackoverflow.com/questions/1170809/how-to-get-gcc-linker-command)?
You may have to run ghc with `-keep-tmp-files` if it invokes the gcc on temporary files.

Finally, can you run the printed ld.gold invocation manually, and add a `-v` to that, so we get more detail about what gold is doing?

If you are on Linux (and also in some other cases), you can also run ghc under `strace -fy -e execve` to see all programs started recursively by any subprogram; this may also easily provide the linker invocation.

Thank you!

On 01/04/2019 7:35 AM, Ömer Sinan Ağacan wrote:
> Yeah I can reproduce it reliably. I tried a few `git clean -xfd`s, and tried
> with no build.mk and with a debug build.mk, it happened with all configurations,
> when building the same file (the hsc2hs executable).
> 
> The repro is simple: clone the GHC repo, build at 6f7115dfd4. If this doesn't
> reproduce the bug then I don't know what else to try.
> 
>> so perhaps you also have a corrupt ELF file somewhere
> 
> How do I check this? Maybe gold.ld produces a corrupt ELF file during the build,
> and then tries to read it to link an executable.


More information about the ghc-devs mailing list