Talk:Building for Android

From Gnash Project Wiki

Jump to: navigation, search

jgarvin: undefined reference to `__sync_add_and_fetch_4' collect2: ld returned 1 I know exactly what this problem is, I had to deal with it working on my job's internal build system. Boost makes use of atomic increment and decrement functions provided by GCC in order to make shared_ptr and probably other things threadsafe. The GCC docs on them are here: http://gcc.gnu.org/onlinedocs/gcc-4.1.2/gcc/Atomic-Builtins.html It's possible that due to a bug which I've commented on (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34115 see my explanation of how to trigger / workaround at the bottom) that GCC actually supports the builtin for the target architecture but doesn't use it. Either way, if you look through the boost headers for shared_ptr, several levels deep you can eventually find where they define how to increment and decrement shared_ptr's internal count, and if I remember right there's a #define you'll see you can use in there to tell it to use locking pthread mutexes just like in older boost versions.