# Cross compiling SDL issue 1.2.15

**URL:** <https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765>\
**Category:** SDL Development\
**Created:** [February 10, 2012, 1:41pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765 "2012-02-10T13:41:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karel\_Chaloupka](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@Karel\_Chaloupka](https://discourse.libsdl.org/u/Karel_Chaloupka)\
**Post date:** [February 10, 2012, 1:41pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/1 "2012-02-10T13:41:51Z")

</div>

I am trying to compile SDL-1.2.15 on a UBUNTU desktop for an ARM compiler.  
My cross compiler is call armv5l-linux. I have been specifying it on the  
configure command line as shown below. However, the script does not  
recognize the compiler. What is the proper way to cross compile SDL?

./configure --host=armv5l-linux  
–prefix=/opt/timesys/toolchains/armv5l-linux

output:

configure: WARNING: If you wanted to set the --build type, don’t use --host.  
If a cross compiler is detected then cross compile mode will be used.  
checking build system type… i686-pc-linux-gnu  
checking host system type…  
armv5l-unknown-linux-gnu \<\<\<============  
checking for armv5l-linux-gcc… no  
checking for gcc… gcc  
checking for C compiler default output file name… a.out  
.  
.  
.  
checking whether gcc accepts -g… (cached) yes  
checking for gcc option to accept ISO C89… (cached) none needed  
checking for armv5l-linux-g++… no  
checking for armv5l-linux-c++… no  
checking for armv5l-linux-gpp… no  
checking for armv5l-linux-aCC… no  
checking for armv5l-linux-CC… no  
checking for armv5l-linux-cxx… no  
checking for armv5l-linux-cc++… no  
checking for armv5l-linux-cl.exe… no  
checking for armv5l-linux-FCC… no  
checking for armv5l-linux-KCC… no  
checking for armv5l-linux-RCC… no  
checking for armv5l-linux-xlC\_r… no  
checking for armv5l-linux-xlC… no  
checking for g++… g++  
checking whether we are using the GNU C++ compiler… yes

---

<div class="post-metadata">

**Author:** ![Alberto\_Luaces\_Ferna](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Alberto\_Luaces\_Ferna](https://discourse.libsdl.org/u/Alberto_Luaces_Ferna)\
**Post date:** [February 10, 2012, 3:01pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/2 "2012-02-10T15:01:41Z")

</div>

Karel Chaloupka writes:

> checking for armv5l-linux-gcc… no

You have the test and results in config.log. configure is probably  
looking for “armv5l-linux-gcc” executable instead of just  
“armv5l-linux”. Maybe you can create a symbolic link.–  
Alberto

---

<div class="post-metadata">

**Author:** ![Karel\_Chaloupka](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@Karel\_Chaloupka](https://discourse.libsdl.org/u/Karel_Chaloupka)\
**Post date:** [February 10, 2012, 4:56pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/3 "2012-02-10T16:56:56Z")

</div>

I don’t see where/how it checks for the host Could it be that the paths are  
not included? I’ve provide part of the log file below. I can email the  
whole if you would like to see it.

configure:2191: result: armv5l-unknown-linux-gnu  
configure:2221: checking for armv5l-linux-gcc  
configure:2251: result: no

This file contains any messages produced by compilers while  
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was  
generated by GNU Autoconf 2.61. Invocation command line was

$ ./configure --host=armv5l-linux  
–prefix=/opt/timesys/toolchains/armv5l-linux

## ---------

## Platform.

## ---------

hostname = ubuntu  
uname -m = i686  
uname -r = 2.6.32-38-generic  
uname -s = Linux  
uname -v = #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012

/usr/bin/uname -p = unknown  
/bin/uname -X = unknown

/bin/arch = unknown  
/usr/bin/arch -k = unknown  
/usr/convex/getsysinfo = unknown  
/usr/bin/hostinfo = unknown  
/bin/machine = unknown  
/usr/bin/oslevel = unknown  
/bin/universe = unknown

PATH: /usr/local/sbin  
PATH: /usr/local/bin  
PATH: /usr/sbin  
PATH: /usr/bin  
PATH: /sbin  
PATH: /bin  
PATH: /usr/X11R6/bin

## -----------

## Core tests.

## -----------

configure:2136: checking build system type  
configure:2154: result: i686-pc-linux-gnu  
configure:2176: checking host system type  
configure:2191: result: armv5l-unknown-linux-gnu  
configure:2221: checking for armv5l-linux-gcc  
configure:2251: result: no  
configure:2261: checking for gcc  
configure:2277: found /usr/bin/gcc  
configure:2288: result: gcc  
configure:2526: checking for C compiler version  
configure:2533: gcc --version \>&5  
gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3  
Copyright (C) 2009 Free Software Foundation, Inc.  
This is free software; see the source for copying conditions. There is NO  
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.On Fri, Feb 10, 2012 at 9:01 AM, Alberto Luaces wrote:

> Karel Chaloupka writes:
> 
> > checking for armv5l-linux-gcc… no
> 
> You have the test and results in config.log. configure is probably  
> looking for “armv5l-linux-gcc” executable instead of just  
> “armv5l-linux”. Maybe you can create a symbolic link.
> 
> –  
> Alberto
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Gabriel\_Jacobo](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/gabriel_jacobo/32/1968_2.png) [@Gabriel\_Jacobo](https://discourse.libsdl.org/u/Gabriel_Jacobo)\
**Post date:** [February 10, 2012, 5:05pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/4 "2012-02-10T17:05:11Z")

</div>

2012/2/10 Karel Chaloupka

> I don’t see where/how it checks for the host Could it be that the paths  
> are not included? I’ve provide part of the log file below. I can email the  
> whole if you would like to see it.
> 
> configure:2191: result: armv5l-unknown-linux-gnu  
> configure:2221: checking for armv5l-linux-gcc  
> configure:2251: result: no

Have you searched the forums? There’s a few tips on cross compilation, see  
here for example: [SDL :: View topic - Building libsdl with Android standalone toolchain](http://forums.libsdl.org/viewtopic.php?t=7885--)  
Gabriel.

---

<div class="post-metadata">

**Author:** ![Karel\_Chaloupka](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@Karel\_Chaloupka](https://discourse.libsdl.org/u/Karel_Chaloupka)\
**Post date:** [February 10, 2012, 5:08pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/5 "2012-02-10T17:08:59Z")

</div>

I believe that I figured out my problem.

I was executing the configure script using the sudo command since UBUNTU  
doesn’t have root which wiped out my path arguments therefore the script  
could not find the tools.

Now I’m seeing a compile issue:

./src/audio/dma/SDL\_dmaaudio.c: In function `DMA_WaitAudio': ./src/audio/dma/SDL_dmaaudio.c:166: error: impossible constraint in `asm’  
make: \*\*\* [build/SDL\_dmaaudio.lo] Error 1

How do I exclude audio which I don’t need from my build?On Fri, Feb 10, 2012 at 10:56 AM, Karel Chaloupka \< @Karel\_Chaloupka\> wrote:

> I don’t see where/how it checks for the host Could it be that the paths  
> are not included? I’ve provide part of the log file below. I can email the  
> whole if you would like to see it.
> 
> configure:2191: result: armv5l-unknown-linux-gnu  
> configure:2221: checking for armv5l-linux-gcc  
> configure:2251: result: no
> 
> This file contains any messages produced by compilers while  
> running configure, to aid debugging if configure makes a mistake.
> 
> It was created by configure, which was  
> generated by GNU Autoconf 2.61. Invocation command line was
> 
> $ ./configure --host=armv5l-linux  
> –prefix=/opt/timesys/toolchains/armv5l-linux
> 
> ## ---------
> 
> ## Platform.
> 
> ## ---------
> 
> hostname = ubuntu  
> uname -m = i686  
> uname -r = 2.6.32-38-generic  
> uname -s = Linux  
> uname -v = #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012
> 
> /usr/bin/uname -p = unknown  
> /bin/uname -X = unknown
> 
> /bin/arch = unknown  
> /usr/bin/arch -k = unknown  
> /usr/convex/getsysinfo = unknown  
> /usr/bin/hostinfo = unknown  
> /bin/machine = unknown  
> /usr/bin/oslevel = unknown  
> /bin/universe = unknown
> 
> PATH: /usr/local/sbin  
> PATH: /usr/local/bin  
> PATH: /usr/sbin  
> PATH: /usr/bin  
> PATH: /sbin  
> PATH: /bin  
> PATH: /usr/X11R6/bin
> 
> ## -----------
> 
> ## Core tests.
> 
> ## -----------
> 
> configure:2136: checking build system type  
> configure:2154: result: i686-pc-linux-gnu
> 
> configure:2176: checking host system type  
> configure:2191: result: armv5l-unknown-linux-gnu  
> configure:2221: checking for armv5l-linux-gcc  
> configure:2251: result: no  
> configure:2261: checking for gcc  
> configure:2277: found /usr/bin/gcc  
> configure:2288: result: gcc  
> configure:2526: checking for C compiler version  
> configure:2533: gcc --version \>&5  
> gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3  
> Copyright (C) 2009 Free Software Foundation, Inc.  
> This is free software; see the source for copying conditions. There is NO  
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> On Fri, Feb 10, 2012 at 9:01 AM, Alberto Luaces wrote:
> 
> > Karel Chaloupka writes:
> > 
> > > checking for armv5l-linux-gcc… no
> > 
> > You have the test and results in config.log. configure is probably  
> > looking for “armv5l-linux-gcc” executable instead of just  
> > “armv5l-linux”. Maybe you can create a symbolic link.
> > 
> > –  
> > Alberto
> > 
> > * * *
> > 
> > SDL mailing list  
> > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![JonnyD](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/jonnyd/32/1604_2.png) [@JonnyD](https://discourse.libsdl.org/u/JonnyD)\
**Post date:** [February 10, 2012, 6:14pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/6 "2012-02-10T18:14:13Z")

</div>

Ubuntu does have a root account (it must). You shouldn’t use sudo or root  
unless you know you have to.

If you really want to be root, try `sudo su`.

Jonny DOn Fri, Feb 10, 2012 at 12:08 PM, Karel Chaloupka \< karel at [electricarmadillo.com](http://electricarmadillo.com)\> wrote:

> I believe that I figured out my problem.
> 
> I was executing the configure script using the sudo command since UBUNTU  
> doesn’t have root which wiped out my path arguments therefore the script  
> could not find the tools.
> 
> Now I’m seeing a compile issue:
> 
> ./src/audio/dma/SDL\_dmaaudio.c: In function `DMA_WaitAudio': ./src/audio/dma/SDL_dmaaudio.c:166: error: impossible constraint in `asm’  
> make: \*\*\* [build/SDL\_dmaaudio.lo] Error 1
> 
> How do I exclude audio which I don’t need from my build?
> 
> On Fri, Feb 10, 2012 at 10:56 AM, Karel Chaloupka \< karel at [electricarmadillo.com](http://electricarmadillo.com)\> wrote:
> 
> > I don’t see where/how it checks for the host Could it be that the paths  
> > are not included? I’ve provide part of the log file below. I can email the  
> > whole if you would like to see it.
> > 
> > configure:2191: result: armv5l-unknown-linux-gnu  
> > configure:2221: checking for armv5l-linux-gcc  
> > configure:2251: result: no
> > 
> > This file contains any messages produced by compilers while  
> > running configure, to aid debugging if configure makes a mistake.
> > 
> > It was created by configure, which was  
> > generated by GNU Autoconf 2.61. Invocation command line was
> > 
> > $ ./configure --host=armv5l-linux  
> > –prefix=/opt/timesys/toolchains/armv5l-linux
> > 
> > ## ---------
> > 
> > ## Platform.
> > 
> > ## ---------
> > 
> > hostname = ubuntu  
> > uname -m = i686  
> > uname -r = 2.6.32-38-generic  
> > uname -s = Linux  
> > uname -v = #83-Ubuntu SMP Wed Jan 4 11:13:04 UTC 2012
> > 
> > /usr/bin/uname -p = unknown  
> > /bin/uname -X = unknown
> > 
> > /bin/arch = unknown  
> > /usr/bin/arch -k = unknown  
> > /usr/convex/getsysinfo = unknown  
> > /usr/bin/hostinfo = unknown  
> > /bin/machine = unknown  
> > /usr/bin/oslevel = unknown  
> > /bin/universe = unknown
> > 
> > PATH: /usr/local/sbin  
> > PATH: /usr/local/bin  
> > PATH: /usr/sbin  
> > PATH: /usr/bin  
> > PATH: /sbin  
> > PATH: /bin  
> > PATH: /usr/X11R6/bin
> > 
> > ## -----------
> > 
> > ## Core tests.
> > 
> > ## -----------
> > 
> > configure:2136: checking build system type  
> > configure:2154: result: i686-pc-linux-gnu
> > 
> > configure:2176: checking host system type  
> > configure:2191: result: armv5l-unknown-linux-gnu  
> > configure:2221: checking for armv5l-linux-gcc  
> > configure:2251: result: no  
> > configure:2261: checking for gcc  
> > configure:2277: found /usr/bin/gcc  
> > configure:2288: result: gcc  
> > configure:2526: checking for C compiler version  
> > configure:2533: gcc --version \>&5  
> > gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3  
> > Copyright (C) 2009 Free Software Foundation, Inc.  
> > This is free software; see the source for copying conditions. There is NO  
> > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR  
> > PURPOSE.
> > 
> > On Fri, Feb 10, 2012 at 9:01 AM, Alberto Luaces wrote:
> > 
> > > Karel Chaloupka writes:
> > > 
> > > > checking for armv5l-linux-gcc… no
> > > 
> > > You have the test and results in config.log. configure is probably  
> > > looking for “armv5l-linux-gcc” executable instead of just  
> > > “armv5l-linux”. Maybe you can create a symbolic link.
> > > 
> > > –  
> > > Alberto
> > > 
> > > * * *
> > > 
> > > SDL mailing list  
> > > SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> > > [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

---

<div class="post-metadata">

**Author:** ![Karel\_Chaloupka](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/k/58956e/32.png) [@Karel\_Chaloupka](https://discourse.libsdl.org/u/Karel_Chaloupka)\
**Post date:** [February 10, 2012, 4:51pm UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/7 "2012-02-10T16:51:16Z")

</div>

I’ve attached my log file.

I don’t see where/how it checks for the host

configure:2176: checking host system type  
configure:2191: result: armv5l-unknown-linux-gnuOn Fri, Feb 10, 2012 at 9:01 AM, Alberto Luaces wrote:

> Karel Chaloupka writes:
> 
> > checking for armv5l-linux-gcc… no
> 
> You have the test and results in config.log. configure is probably  
> looking for “armv5l-linux-gcc” executable instead of just  
> “armv5l-linux”. Maybe you can create a symbolic link.
> 
> –  
> Alberto
> 
> * * *
> 
> SDL mailing list  
> SDL at [lists.libsdl.org](http://lists.libsdl.org)  
> [http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org](http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

-------------- next part --------------  
A non-text attachment was scrubbed…  
Name: config.log  
Type: application/octet-stream  
Size: 180644 bytes  
Desc: not available  
URL: [http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120210/dc07fc88/attachment.obj](http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20120210/dc07fc88/attachment.obj)

---

<div class="post-metadata">

**Author:** ![Alberto\_Luaces\_Ferna](https://discourse.libsdl.org/letter_avatar_proxy/v4/letter/a/74df32/32.png) [@Alberto\_Luaces\_Ferna](https://discourse.libsdl.org/u/Alberto_Luaces_Ferna)\
**Post date:** [February 13, 2012, 8:47am UTC](https://discourse.libsdl.org/t/cross-compiling-sdl-issue-1-2-15/18765/8 "2012-02-13T08:47:33Z")

</div>

Karel Chaloupka writes:

> I’ve attached my log file.
> 
> I don’t see where/how it checks for the host
> 
> configure:2176: checking host system type  
> configure:2191: result: armv5l-unknown-linux-gnu
> 
> ```
> Karel Chaloupka writes:
> 
> > checking for armv5l-linux-gcc... no
> 
> You have the test and results in config.log. ?configure is probably
> looking for "armv5l-linux-gcc" executable instead of just
> "armv5l-linux". ?Maybe you can create a symbolic link.
> 
> ```

> From line 52:

configure:2221: checking for armv5l-linux-gcc  
configure:2251: result: no  
configure:2261: checking for gcc  
configure:2277: found /usr/bin/gcc  
configure:2288: result: gcc

Looks for armv5l-linux-gcc but it doesn’t found it. Then it tries with  
gcc.\> On Fri, Feb 10, 2012 at 9:01 AM, Alberto Luaces \<@Alberto\_Luaces\_Ferna\> wrote:

–  
Alberto
