atomic<aligned_storage<16, 16>::type>.is_lock_free() on 3570K with -march=native

Jim Hill gjthill@gmail.com
Tue Dec 22 06:17:32 GMT 2020


`g++ -march=native` on my 3570k compiles the below code but fails to
link, showing

    atomic.cc:(.text.startup+0x24): undefined reference to
`__atomic_is_lock_free'

    #include <iostream>
    #include <atomic>
    int main(int c, char **v, char **e)
    {
      using namespace std;
      cout<<boolalpha<< atomic<aligned_storage<16,16>::type>().is_lock_free();
    }

where the code (and the program it's condensed from) work fine with `<8,8>`.

But the 3570K shows CMPXCHG16B support everywhere I can find.

Is this an oversight? A packaging/build error in my distro? I can work around
it for my current use, and if it's been missing this long I expect I'm in a
small handful of users who care at all, but if it's broken and fixable that'd
be great.


More information about the Libstdc++ mailing list