Tech Memorandums

Cross compiling for the Asus RT-AC3200

Debian multi-arch

This is the AC3200 running Asus-Merlin.

{% highlight shell %} $ sudo dpkg –add-architecture armel $ sudo apt-get update $ inst crossbuild-essential-armel {% endhighlight %}

Try building a hello world program:

{% highlight shell %} $ arm-linux-gnueabi-gcc -o hello hello.c $ file hello hello: ELF 32-bit LSB pie executable ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=c0a6f1e6a507d14337f1594657f795971706ef39, not stripped {% endhighlight %}

Try it on the router:

{% highlight shell %} $ ./hello -sh: ./hello: not found {% endhighlight %}

Damn! Back to the drawing board. Revert with:

{% highlight shell %} $ purge crossbuild-essential-armel $ sudo apt-get autoremove $ sudo dpkg –remove-architecture armel {% endhighlight %}

By hand

Get kvic-z/brcm-arm-toolchains.

Build the hello world as:

{% highlight shell %} $ LD_LIBRARY_PATH=/home/alok/src/brcm-arm-toolchains-master/hndtools-arm-linux-2.6.36-uclibc-4.5.3/lib
arm-brcm-linux-uclibcgnueabi-gcc -o hello hello.c {% endhighlight %}

It does not understand the -L directive. An issue was filed.