Skip to content

Hadrian build of rts is broken due to missing assembler file(s) compilation.

While trying to debug hadrian build failure on ppc64le-linux platform I've found out that for whatever reason happening between hadrian and cabal, the rts build does not build/include assembler files specified in rts.cabal:

    403     if arch(i386) || arch(powerpc) || arch(powerpc64)
    404        asm-sources: AdjustorAsm.S
    405     if arch(powerpc) || arch(powerpc64) || arch(powerpc64le) || arch(s390x)
    406        asm-sources: StgCRunAsm.S

due to this omission GHC can't be build with hadrian on all the platforms mentioned above (my claim!). At least shared rts library fails on ppc64le-linux for me with this:

Warning: -rtsopts and -with-rtsopts have no effect with -shared.
    Call hs_init_ghc() from your main() function to set these options.

rts/Schedule.c:481:0: error:
     error: undefined reference to 'StgRun'
    |
481 |         r = StgRun((StgFunPtr) stg_returnToStackTop, &cap->r);
    | ^
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)

and that's due to fact that StgRun is defined solely in rts/StgCRunAsm.S for ppc64le and the file is not included in the build hence linkage failure.

When I switch hadrian verbose mode on, I see cabal steps there listing all the cmm files and all the c files, but asm files are completely missing.

Depending on what exactly platforms above implements in assembler files, either native or cross-compile build with hadrian would probably fail.

I'm going to test cross-compilation and native build of i386 and will report.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information