Compile on other system with yun-gcc

Hey!

Is there a way to compile c programs for openWRT on the yun on another system (also linux), in order to copy the binary to the yun afterwards?

Yes, that is the "normal" way to compile programs for the yun.

Download and compile your buildroot from here openwrt-yun then you can compile programs. I like the setup here eclipse and openwrt but you can use the command line with the instructions here: crosscompile

FYI:

OpenWRT is embedded linux.

Debian, Ubuntu, Redhat is desktop linux.

OpenWRT' s default C standard library is uClibc.

Debian' s default C standard library is glibc.

uClibc and glibc are only source but not binary compatible, that means you can not compile at Debian and run at OpenWRT directly.

Next thing is hardware CPU architecture:

To make compile working, We also need at same hardware CPU architecture. Yun's AR9331 is mips based.
to make it working we need Debian is running at mips CPU machine. It is available but not popular.

Now C library work around:

  1. OpenWRT support eglibc which both source and binary compatible with glibc. compile OpenWRT with eglibc then it accept glibc binary from Debian.

  2. Compile at Debian with static link.

  3. Compile at Debian with uClibc.

Now Hardware work around:

Qemu, make it Virtual MIPS Linux environment for Yun, load gcc ready to go.

I got it working, since I bought MIPS base laptop. I lost interest.