For building a cross compiling system for my router Newifi D1(2nd Generation), I tried crosstools-ng.
Ubuntu 18.04, because of the version of perl, the environment cannot be built correctly with
ct-ng build after the configuration.
I will not talk about the error here. In fact, the error has been fixed in the pull request Pull 1043.As the latest version is
crosstool-ng-1.23.0 released at Apr 20, 2017. We can do nothing except waiting (although we can build the tool manually, it’s better to wait for an officiel release).
We come back for the theme.
The CPU of my router is
mt7621a, and the system is based on
openwrt Barrier Breaker. The architecture of this CPU is
We can download openwrt toolchain for mipsel and decompress it.
The compiler is based on
To test, we create a simple hello world:
toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin/mipsel-openwrt-linux-gcc helloworld.c -o helloworld
scp helloworld firstname.lastname@example.org:/
We connect to the router with
ssh and test it:
There will be a tutorial more advanced in some days.