Created attachment 12362
Minimal reproducer, courtesy of Aleksandr Drozd
When using std::atomic, this works:
$ g++ -std=c++11 -o atomics atomics.cpp
This doesn't:
$ g++ -fplugin=/usr/local/lib/dragonegg.so -std=c++11 -o atomics atomics.cpp
/tmp/ccYWBxLQ.o: In function `std::__atomic_base<int>::store(int, std::memory_order)':
atomics.cpp:(.text._ZNSt13__atomic_baseIiE5storeEiSt12memory_order[_ZNSt13__atomic_baseIiE5storeEiSt12memory_order]+0x44): undefined reference to `__atomic_store_4'
/tmp/ccYWBxLQ.o: In function `std::__atomic_base<int>::load(std::memory_order) const':
atomics.cpp:(.text._ZNKSt13__atomic_baseIiE4loadESt12memory_order[_ZNKSt13__atomic_baseIiE4loadESt12memory_order]+0x38): undefined reference to `__atomic_load_4'
collect2: error: ld returned 1 exit status
Here's what I'm running:
$ g++ --version | head -1
g++ (Ubuntu/Linaro 4.8.1-10ubuntu9) 4.8.1
$ svn info | grep Revision
Revision: 205933
$ uname -a
Linux morbo 3.11.0-18-generic #32-Ubuntu SMP Tue Feb 18 21:11:14 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
I've attached a minimal reproducer.
Thanks in advance for your attention,
-- Scott
atomics.cpp
(170 bytes, text/x-c++src)