<div dir="ltr">Hello -<div><br></div><div>I'm new to OpenWRT development and I'm in the process of porting an application from Ubuntu x86 to OpenWRT.</div><div><br></div><div>The target platform is MIPS32 (GL-AR150):</div><div><br></div><div>   CONFIG_TARGET_ar71xx_generic_Default=y</div><div><br></div><div>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:</div><div><br></div><div>   Unknown symbol __sync_val_compare_and_swap_4 (err 0)</div><div> </div><div>This makes sense given the warning I see in the compile log:</div><div><br></div><div>WARNING: "__sync_val_compare_and_swap_4" [...] undefined!<br></div><div><br></div><div>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:</div><div><br></div><div>  <a href="https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html">https://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html</a></div><div><br></div><div>"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."</div><div><br></div><div>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). </div><div><br></div><div>Thank you,</div><div><br></div><div>- Andrew</div><div><br></div><div><br></div><div><br></div></div>