Cross compiling application to arm - I need some hints

I need some hints on cross-compiling to arm in leap 42.3 on x64

My eventual objective is to compile audacious media player for a headless banana pi (armv7) running armbian (like debian). (The published packages contain lots of GUI stuff but there are compile-time options to exclude both GTK and Qt: https://audacious-media-player.org/download.) I am completely new to cross-compiling.

I installed these:
cross-arm-binutils
cross-armv7hl-gcc48-icecream-backend (I’m puzzled by ‘icecream’)

I assumed, naïvely, that these added arm to gcc and that I could merely specify the target, something like
gcc helloworld.c -o helloworld-arm -march=armv7
helloworld.c:1:0: error: bad value (armv7) for -march= switch

I discovered in /usr/share/icecream-envs/ another gcc, and if I run that in isolation it accepts -march=armv7 but unsurprisingly fails for other reasons, presumably because it’s not installed properly. So maybe I should be running that, or pointing some environment variable at it.

I’ve read many forum threads, mostly out of date, and often advising some completely different method. Ubuntu seems to use a separate compiler: arm-linux-gnueabi-gcc. I’ve even watched a presentation by Andreas Färber, which I think describes the correct system but not how to use it.

Is there a howto somewhere?
What do I do next?

You may not be searching in the proper Forum.

For a question like this, you’d probably have better luck searching for info, and posting in one of the Developer Forums

https://forums.opensuse.org/forumdisplay.php/797-Development

For for your situation, you should consult documentation for whatever you’re doing.
From what you’ve posted, I’m guessing that you may be building to an Android target (ice cream is a friendly codename for a version of Android).
If that is really what you’re doing, then I’d also guess that you may have an Android NDK installed, and maybe even Android Studio which is the recommended coding tool.

If that is your setup,
Then you should look for Quickstarts and tutorials related to what you have installed.

TSU

I think you’re right that the development forum would have been better. I hadn’t spotted it.

Icecream is a distributed compile system - https://en.opensuse.org/Icecream.
I was aware of that, and knew I didn’t want it, but since cross-armv7hl-gcc48-icecream-backend appeared to be the only cross-compiler in the standard repos I thought maybe it optionally interfaced with icecream in some way. The problem was it didn’t actually install a cross-compiler!

Anyway, knowing the magic prefix “cross-arm-linux-gnueabi” I found another one
https://software.opensuse.org/package/cross-arm-linux-gnueabi-gcc
which does install utilities, libraries, and the compiler: arm-linux-gnueabi-gcc
and doesn’t object to -march=armv7

So now I get
helloworld.c:1:18: error: no include path in which to search for stdio.h

Which I understand - I now need to sort out the paths to the libraries etc.

So I’m one step along this long journey :slight_smile:

Edited to add: how do I mark this SOLVED in the title that appears on the index?