Cross compiling Chipmunk for Mips (CI20)

Discuss new features and future development.
Post Reply
User avatar
riq
Posts: 37
Joined: Mon Jun 23, 2008 1:16 pm
Location: California, USA
Contact:

Cross compiling Chipmunk for Mips (CI20)

Post by riq »

Hi,

I'm trying to compile Chipmunk v6.2.2 for Linux Mips (CI20)
http://www.elinux.org/MIPS_Creator_CI20

and I'm doing the following:

Code: Select all

$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/riq/tmp/linux-mips/mips-linux-gnu.cmake .
My mips-linux-gnu.cmake file looks like this:

Code: Select all

# this one is important
SET(CMAKE_SYSTEM_NAME Linux)
#this one not so much
#SET(CMAKE_SYSTEM_VERSION 1)

set(CMAKE_SYSROOT /home/riq/tmp/linux-mips)
set(CMAKE_STAGING_PREFIX /home/riq/linux-mips/stage)

# specify the cross compiler
SET(CMAKE_C_COMPILER   /home/riq/MentorGraphics/Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux/bin/mips-linux-gnu-gcc)
SET(CMAKE_CXX_COMPILER   /home/riq/MentorGraphics/Sourcery_CodeBench_Lite_for_MIPS_GNU_Linux/bin/mips-linux-gnu-g++)

# where is the target environment 
SET(CMAKE_FIND_ROOT_PATH  /home/riq/tmp/linux-mips)

# search for programs in the build host directories
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
But if fails with this error:

Code: Select all

  mips-linux-gnu-gcc: error: unrecognized command line option '-m32'
So, I guess that somewhere in the cmake rules, there is an option that is forcing to add '-m32' when compiling for 32 bits... but mips-32 doesn't support it.

I guess I should be able to find the source of the bug, but if someone already knows where to loop, I would appreciate it. Thanks!
User avatar
riq
Posts: 37
Joined: Mon Jun 23, 2008 1:16 pm
Location: California, USA
Contact:

Re: Cross compiling Chipmunk for Mips (CI20)

Post by riq »

disregard my previous message.

I was able to make it compile with this command line:

Code: Select all

$ cmake -DCMAKE_TOOLCHAIN_FILE=/home/riq/tmp/linux-mips/mips-linux-gnu.cmake -DCMAKE_INSTALL_PREFIX=/home/riq/tmp/linux-mips -DBUILD_DEMOS=OFF ..
Post Reply

Who is online

Users browsing this forum: No registered users and 7 guests