[OpenWrt-Devel] MIPS32 cross-compile problem - unknown symbol

Andrew LaCroix andrew at alacrity-ats.com
Fri Jul 27 11:54:09 EDT 2018

Hello -

I'm new to OpenWRT development and I'm in the process of porting an
application from Ubuntu x86 to OpenWRT.

The target platform is MIPS32 (GL-AR150):


I have my package compiling and the desired .ko file is produced, but when
I flash the image and attempt to insmod on the target device, I get the
following error:

   Unknown symbol __sync_val_compare_and_swap_4 (err 0)

This makes sense given the warning I see in the compile log:

WARNING: "__sync_val_compare_and_swap_4" [...] undefined!

I've done a fair bit of googling on this, and I can see that this is a
problem with the atomic builtins as described here:


"Not all operations are supported by all target processors. If a particular
operation cannot be implemented on the target processor, a warning will be
generated and a call an external function will be generated. The external
function will carry the same name as the builtin, with an additional suffix
`_n' where n is the size of the data type."

Can anyone suggest a solution?  I have tried adding "-latomic" and "-lgcc"
to my linker flags, but that is not helping (first option doesn't change
anything, latter option fails).

Thank you,

- Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/openwrt-devel/attachments/20180727/b9c06e16/attachment.htm>
-------------- next part --------------
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list