This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

mingw64-*-gcc-g++-4.9.2-1: Missing libatomic.a ?


The MinGW w64 g++ packages lack runtime support for std::atomic.

Testcase:

$ cat testatomic.cc
#include <atomic>

struct S { char a[10]; };

std::atomic<S> x;

int main()
{
  S y = {""};
  x = y;
  return 0;
}

$ cygcheck -f /usr/bin/x86_64-w64-mingw32-g++
mingw64-x86_64-gcc-g++-4.9.2-1

$ x86_64-w64-mingw32-g++ -std=c++11 -c testatomic.cc

$ x86_64-w64-mingw32-g++ -std=c++11 testatomic.o
testatomic.o:testatomic.cc:....: undefined reference to `__atomic_store'
collect2: error: ld returned 1 exit status

$ x86_64-w64-mingw32-g++ -std=c++11 testatomic.o -latomic
/usr/lib/gcc/x86_64-w64-mingw32/4.9.2/../../../../x86_64-w64-mingw32/bin/ld: cannot find -latomic
collect2: error: ld returned 1 exit status

$ x86_64-w64-mingw32-nm /usr/lib/gcc/x86_64-w64-mingw32/4.9.2/*.a | grep atomic_store
[not found]

The above works with Cygwin g++.

Christian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]