Opened 3 years ago

Closed 3 years ago

#6127 closed bug (fixed)

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

Reported by: mtjm Owned by: pcapriotti
Priority: normal Milestone: 7.6.1
Component: Runtime System Version: 7.5
Keywords: Cc:
Operating System: Linux Architecture: mips
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

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.

Attachments (1)

0001-Don-t-use-64-bit-support-functions-on-MIPS-N32.patch (904 bytes) - added by mtjm 3 years ago.
patch fixing the issue

Download all attachments as: .zip

Change History (4)

Changed 3 years ago by mtjm

patch fixing the issue

comment:1 Changed 3 years ago by mtjm

  • Status changed from new to patch

comment:2 Changed 3 years ago by simonmar

  • difficulty set to Unknown
  • Milestone set to 7.6.1
  • Owner set to pcapriotti

I know nothing about MIPS N32, but the patch shouldn't do any harm.

comment:3 Changed 3 years ago by pcapriotti

  • Resolution set to fixed
  • Status changed from patch to closed

Pushed:

commit b3dd20721470d5f2e0b5fec795dbe31e01d2cdcd
Author: Michał Masłowski <[email protected]>
Date:   Sun May 27 15:35:03 2012 +0200

    Don't use 64-bit support functions on MIPS N32.
    
    It uses native 64-bit instructions instead of these, despite having
    32-bit pointers.
Note: See TracTickets for help on using tickets.