# Cross-Compiling LibSDL for mips platform

**URL:** <https://discourse.libsdl.org/t/cross-compiling-libsdl-for-mips-platform/17737>\
**Category:** SDL Development\
**Created:** [November 19, 2010, 3:27pm UTC](https://discourse.libsdl.org/t/cross-compiling-libsdl-for-mips-platform/17737 "2010-11-19T15:27:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sen](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sen/32/2284_2.png) [@sen](https://discourse.libsdl.org/u/sen)\
**Post date:** [November 19, 2010, 3:27pm UTC](https://discourse.libsdl.org/t/cross-compiling-libsdl-for-mips-platform/17737/1 "2010-11-19T15:27:00Z")

</div>

Hi All,

I was trying to compile libSDL-1.2.14 for my mips platform.  
But it was not successful.

These were the steps that I tried out :

1. export PATH=/opt/mips-4.3/bin:$PATH
2. Went inside the libSDL-1.2.14 source folder.
3. Gave a “./configure --prefix=/usr/local/SDL\_Lib --host=mips-linux-gnu”
4. Executed the “make” command

This was the error received :

cc1: warning: include location “/usr/include” is unsafe for cross-compilation  
./src/audio/dma/SDL\_dmaaudio.c: In function ‘DMA\_WaitAudio’:  
./src/audio/dma/SDL\_dmaaudio.c:167: error: can’t find a register in class ‘COP3\_REGS’ while reloading ‘asm’  
./src/audio/dma/SDL\_dmaaudio.c:167: error: ‘asm’ operand has impossible constraints  
make: \*\*\* [build/SDL\_dmaaudio.lo] Error 1

But then i reconfigured the make file by giving the following commands :

1. make clean
2. ./configure --prefix=/usr/local/SDL\_Lib --host=mips-linux-gnu CPPFLAGS=-I/opt/mips-4.3/mips-linux-gnu/libc/usr/include/
3. make

NOTE : /opt/mips-4.3/mips-linux-gnu/libc/usr/include/ - This is the path where you can locate the select.h file for the mips Platform.  
It contains the definitions of the macros FD\_ZERO and FD\_SET.

Still I am getting the same error.

cc1: warning: include location “/usr/include” is unsafe for cross-compilation  
./src/audio/dma/SDL\_dmaaudio.c: In function ‘DMA\_WaitAudio’:  
./src/audio/dma/SDL\_dmaaudio.c:167: error: can’t find a register in class ‘COP3\_REGS’ while reloading ‘asm’  
./src/audio/dma/SDL\_dmaaudio.c:167: error: ‘asm’ operand has impossible constraints  
make: \*\*\* [build/SDL\_dmaaudio.lo] Error 1

Please help me with some valuable pointers.

Thanks,  
Sen
