SDK - Cross compile logging agent


I am trying to cross compile a third party logging agent so it can run on my Openwrt router. I am following the instructions provided on this link:

Some further details:

And the commands I issue are:

cmake ..
make CC=arm-openwrt-linux-muslgnueabi-gcc LD=arm-openwrt-linux-muslgnueabi-ld

Sadly I am getting the following error:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... arm-openwrt-linux-muslgnueabi-gcc LD=arm-openwrt-linux-muslgnueabi-ld
checking whether the C compiler works... no
configure: error: in `/home/ubuntu/fluent-bit-1.4.4/build/backtrace-prefix/src/backtrace-build':
configure: error: C compiler cannot create executables
See `config.log' for more details
CMakeFiles/backtrace.dir/build.make:105: recipe for target 'backtrace-prefix/src/backtrace-stamp/backtrace-configure' failed
make[2]: *** [backtrace-prefix/src/backtrace-stamp/backtrace-configure] Error 77
CMakeFiles/Makefile2:131: recipe for target 'CMakeFiles/backtrace.dir/all' failed
make[1]: *** [CMakeFiles/backtrace.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

I tested running the gcc compiler manually "arm-openwrt-linux-muslgnueabi-gcc --version" and it works so path seems to be correct.

Any suggestions? Thanks for your help!

You have to instruct cmake to use your toolchain and sysroot instead of providing it to the generated Makefile.

Or you create a OpenWrt package: