Cross-compile from Ubuntu

Hello, I need to compile a simple custom C program (linked with libusb) for my router (MIPS 24kc, ar71xx target) from an Ubuntu machine. Do I need a special GCC toolchain or the standard GCC will do (then what compiler options to use)?

Also I guess I'll have to link it against the libc library version used on the router, so what is the right way of doing it? Or maybe there is a wiki page describing how to set up a development environment for cross-compiling for the ar71xx target which I haven't found?

Thank you.

You need a LEDE toolchain with tailored gcc and necessary libraries etc. so that you get the compilation options just right.

Either install the full build environment or use the SDK that enables compiling just single packages.

But I think that you need to form a real "package" out of your file, especially as you want libusb.

You might also read these old examples
(query: )

1 Like

Thanks, this seems to be exactly what I needed!