Skip to content

Build for MIPS N32 host fails due to references to 64-bit support code

Linking gives these errors:

/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xd7c): undefined reference to `__divdi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xd84): undefined reference to `__udivdi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xd8c): undefined reference to `__moddi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xd94): undefined reference to `__umoddi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xd9c): undefined reference to `__muldi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xda4): undefined reference to `__ashldi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xdac): undefined reference to `__ashrdi3'
/home/mtjm/git/ghc-cross/rts/dist/build/libHSrts.a(Linker.o):(.data+0xdb4): undefined reference to `__lshrdi3'
collect2: error: ld returned 1 exit status

The patch changes the code to not use these functions, as it does on 64-bit architectures. I don't know a more portable solution which wouldn't require changing when porting to every new 64-bit architecture with 32-bit pointers.

Trac metadata
Trac field Value
Version 7.5
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Runtime System
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information