Bug 10081

Summary: Can not found atomic dynamic shared library
Product: uClibc Reporter: smartfrog <wheretogo0815>
Component: Shared Library SupportAssignee: unassigned
Status: NEW ---    
Severity: normal CC: uclibc-cvs
Priority: P5    
Version: 0.9.33   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description smartfrog 2017-07-17 08:51:43 UTC
I get a source code which can be compiled  successfully by arm-linux-gcc ,its lib is glibc.Then I need to  transplant it to mips architecture.

My toolchain is msdk-4.9.4-mips-EL-3.10-u0.9.33-m32ut-161121.
My build system is Ubuntu 14.04 64 Bit 
My device is a wifi audio based mips architectrue。

I use mips-linux-uclibc-g++ to compile a c++ source code which invoked a function called __atomic_load_8 , so I specified -latomic,because I compiled successfully by other compiler, but mips-linux-uclibc-g++ can not find the library.I search libatomic.so in toolchain.It really does not exist. The error :


-------------------------------------------------------------------------------------
controller.o: In function `Controller::worker()':
controller.cpp:(.text+0x18f8): undefined reference to `__atomic_load_8'
stream.o: In function `Stream::getPlayerChunk(void*, std::chrono::duration<long long, std::ratio<1ll, 1000000ll> > const&, unsigned long)':
stream.cpp:(.text+0x2a0c): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x2d34): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x41c0): undefined reference to `__atomic_load_8'
stream.cpp:(.text+0x47b8): undefined reference to `__atomic_load_8'
timeProvider.o: In function `TimeProvider::setDiffToServer(double)':
timeProvider.cpp:(.text+0x474): undefined reference to `__atomic_store_8'
timeProvider.cpp:(.text+0x538): undefined reference to `__atomic_store_8'
-------------------------------------------------------------------------------------

This is my link flag : LDFLAGS  = -L$(COMMON_DIR)/lib  -latomic.


I searched function  __atomic_load_8 ,which is only defined in 
msdk-4.9.4-mips-EL-3.10-u0.9.33-m32ut-161121/lib/gcc/mips-linux-uclibc/4.9.4/plugin/include/sync-builtins.def

306 DEF_SYNC_BUILTIN (BUILT_IN_ATOMIC_LOAD_8,
307                   "__atomic_load_8",
308                   BT_FN_I8_CONST_VPTR_INT, ATTR_NOTHROWCALL_LEAF_LIST)


So what can I do ?