Ok, it took me quite a while and I'm still surprised how complicated it is to correctly compile binaries for the Odroid/LE9.
For the record and possibly others, trying to achieve something similar, here is what I did:
• Installed Oracle Virtualbox on a PC (any other VM should do, too)
• Set up a Ubuntu VM
• Downloaded the LE source and built it for the Odroid (with "PROJECT=Amlogic DEVICE=Odroid_C2 ARCH=arm" like described here) – this took serveral hours!
• Downloaded Hardkernel's WiringPi from Github. There I adjusted the makefiles to use /path/to/toolchain/arm-something-libreelec-linux-gnueabi-gcc instead of the default gcc, install to a temporary folder instead of /usr/local/... , and adjusted the library and LD paths to this temporary directory.
e.g. Makefile for ./wiringPi/gpio:
#…Leading annotations yadda yadda
#################################################################################
CFLAGS = $(DEBUG) -Wall -Wextra $(INCLUDE) -Winline -pipe
DESTDIR?=/home/username/build/compiled/usr
PREFIX?=/local
ifneq ($V,1)
Q ?= @
endif
#DEBUG = -g -O0
DEBUG = -O2
CC = /home/username/build/libreelec/build.LibreELEC-Odroid_C2.arm-9.0-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-gcc
INCLUDE = -I$(DESTDIR)$(PREFIX)/include
LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
# May not need to alter anything below this line
…
In the end I got working files for WiringPi. Hooray!!
This whole cross compiling thing is still quite new to me, and I'm struggling with compiling raspberry remote (raspberry-remote) though. It gives me an error make: *** No rule to make target 'RCSwitch.o', needed by 'send'. Stop., which I don't understand. I tried adjusting the compiler, library and LD paths like with WiringPi, but the compiler just won't digest my makefile. Any advice is greatly appreciated.
Makefile for raspberry-remote
DESCRIPTION = "RCSwitch on Raspberry Pi"
LICENSE = "GPL"
VERSION = 1.0
CXX = "/home/username/build/libreelec/build.LibreELEC-Odroid_C2.arm-9.0-devel/toolchain/bin/armv8a-libreelec-linux-gnueabi-cpp"
DESTDIR?=/home/username/build/compiled/usr
PREFIX?=/local
INCLUDE = -I$(DESTDIR)$(PREFIX)/include
CXXFLAGS += -Wall $(INCLUDE)
LDFLAGS = -L$(DESTDIR)$(PREFIX)/lib
LIBS = -lwiringPi -lwiringPiDev
default: send
send: RCSwitch.o send.o
$(CXX) $+ -o $@ $(CXXFLAGS) $(LDFLAGS) $(LIBS)