Bug 8902 - MIPS Compilation fails on MIPS64
Summary: MIPS Compilation fails on MIPS64
Status: RESOLVED NOT_ON_ROADMAP
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2012-12-12 09:19 UTC by Shawn Lewis
Modified: 2012-12-17 14:53 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_ON_ROADMAP

Description Shawn Lewis 2012-12-12 09:19:57 UTC
Hello, 

I have seen some news dating back to March that MONO has been ported for MIPS 64bit. 

http://tirania.org/blog/archive/2012/Mar-22.html 

Couple questions if I may ask: 

1. Is their a special fork/branch for this port, or is it inclusive in the standard source download for MONO? 

2. What compile flags/options need to be set for proper compilation? 

Any assistance/guidance would be greatly appreciated. 


Board/Chipset: CAVIUM OCTEON II (Mips 64bit)      http://www.caviumnetworks.com/OCTEON_II_MIPS64.html

We have attempted multiple GIT versions, and tried compiling, but not having any luck.  I see references (mailing lists) to the MIPS 64 patches being integrated in 2.11.x, but not having any luck in getting MONO to compile.

Snippet from one of our devs:

"        Under mips it is expecting the SIZEOF_REGISTER == 4, for SIZEOF_REGISTER == 8 and target
        architecture  is mips  then the build fails with an error "Not imeplemented"
  
       In mono/io-layer/atomic.h encountered an error "error: #error "Not implemented."". I just tried
       to proceed commenting out #error check, but I got error "#error "Implement mono-context for the current arch""
       in the file "mono/utils/mono-context.h".  There wasn't any context defined for MIPS64.

      mono/io-layer/atomic.h
      #elif ((defined(__mips__) && !defined(MONO_CROSS_COMPILE)) || (defined(TARGET_MIPS))) && SIZEOF_REGISTER == 4"

Also tried compiling as MIPS32:

"And could not able to  compile for 32-bit using WRL 64bit compiler with compiler flags -mgp32, -mabi=32 or -mabi=n32.  I got the below error.     " error: '-mgp32' used with a 64-bit ABI"

Is their anyone who can provide any insight getting MIPS64 compiling?

Is their anyone who is familiar enough with this, that could in fact provide some paid consulting services if that be the case to get it to a point of compiling.  This based on an assumption that most of the work/patches already exist, and may need to just be applied, or limited modification?

Thanks for your time and reviewing this and hope some progress/insight can be made.

Shawn
Comment 1 Shawn Lewis 2012-12-12 10:25:46 UTC
Some additional information:

   Please find below the compiler configuration used and attached the config.log for your reference.

./configure --host=mips64-target-linux-gnu --target=mips64-target-linux-gnu --build=x86_64-crosscompile-linux-gnu mono_cv_uscore=no --with-tls=pthread --with-sigaltstack=no

export SYSROOT_BASE=/home/wrluser/windriver_4.3-octeon-kernel_2.6.34.10_cgl-sysroot/
export COMPILER_DIR=$SYSROOT_BASE/export/sysroot/benu_octeon-glibc_cgl/x86-linux2
export COMPILER_PREFIX=mips64_octeon2-target-linux-gnu-
export CROSS_COMPILE=$COMPILER_PREFIX
export KERNEL_SOURCE=$SYSROOT_BASE/build/linux
export KERNEL_OUT=$SYSROOT_BASE/build/linux-benu_octeon-cgl-build/
export CROSSOPTS="--host=mips64-target-linux-gnu --target=mips64-target-linux-gnu --build=x86_64-crosscompile-linux-gnu"
export ARCH=mips64_octeon2
export PATH=$SYSROOT_BASE/host-cross/mips-wrs-linux-gnu/bin:$PATH
export CC=${CROSS_COMPILE}gcc
export CXX=${CROSS_COMPILE}g++
export LD=${CROSS_COMPILE}g++

It is Big endian.

Please find ELF details

ELF Header:
  Magic:   7f 45 4c 46 02 02 01 00 00 00 00 00 00 00 00 00
  Class:                             ELF64
  Data:                              2's complement, big endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              REL (Relocatable file)
  Machine:                           MIPS R3000
Comment 2 Zoltan Varga 2012-12-12 10:50:59 UTC
Only MIPS32 support was completed, and due to the large variety between MIPS chips, mono might only work on a subset of chips.
Comment 3 Zoltan Varga 2012-12-17 14:53:17 UTC
-> WONTFIX for now.