Use https://github.com/arduino/openwrt-yun compile OpenWrt-SDK for Yun.

I enclosed pre-compile OpenWrt-SDK for Yun here.

At Debian 32 bits box:

cd ~
wget -O OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2 https://www.dropbox.com/s/a0yc8oy4vcvmf7q/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2?dl=0
md5sum OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
0e5706c72e433c362cf384c462b86f86
tar -vxjf OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2.tar.bz2
nano ~/setup.sh
#!/bin/bash
BACKPATH=$PATH
export BACKPATH
PWD=~/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/toolchain-mips_r2_gcc-4.6-linaro_uClibc-0.9.33.2
PWD2=~/OpenWrt-SDK-ar71xx-for-linux-i486-gcc-4.6-linaro_uClibc-0.9.33.2/staging_dir/target-mips_r2_uClibc-0.9.33.2
PATH=$PWD/bin:$PATH
export PATH
STAGING_DIR=$PWD
export STAGING_DIR
CFLAGS=$PWD2/usr/include
export CFLAGS
LDFLAGS=$PWD2/usr/lib
export LDFLAGS
source ~/setup.sh