Bug 215138 - devel/libc++ + lang/gcc: #error <atomic> is not implemented
Summary: devel/libc++ + lang/gcc: #error <atomic> is not implemented
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dimitry Andric
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2016-12-08 07:03 UTC by Jan Beich
Modified: 2017-01-03 11:50 UTC (History)
2 users (show)

See Also:
jbeich: maintainer-feedback? (dim)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Beich freebsd_committer freebsd_triage 2016-12-08 07:03:21 UTC
Until OpenMP situation improves C++ ports have to resort to USES=compiler:gcc-c++11-lib. However, libc++ from ports appears to be too old to know about GCC atomic support.

$ pkg install -y gcc

$ cat >a.cc
#include <atomic>

int main() { return 0; }

$ g++49 -std=c++11 -nostdinc++ -isystem /usr/local/include/c++/v1 a.cc
In file included from a.cc:1:0:
/usr/local/include/c++/v1/atomic:539:2: error: #error <atomic> is not implemented
 #error <atomic> is not implemented
  ^

$ find /usr/local/lib/gcc49 -name '*atomic*'
/usr/local/lib/gcc49/include/c++/ext/atomicity.h
/usr/local/lib/gcc49/include/c++/atomic
/usr/local/lib/gcc49/include/c++/i386-portbld-freebsd11.0/bits/atomic_word.h
/usr/local/lib/gcc49/include/c++/bits/atomic_lockfree_defines.h
/usr/local/lib/gcc49/include/c++/bits/atomic_base.h
/usr/local/lib/gcc49/libatomic.so
/usr/local/lib/gcc49/libatomic.so.1.1.0
/usr/local/lib/gcc49/libatomic.a
/usr/local/lib/gcc49/libatomic.so.1
/usr/local/lib/gcc49/gcc/i386-portbld-freebsd11.0/4.9.4/include/stdatomic.h

https://github.com/llvm-mirror/libcxx/commit/e8b4232e3
https://github.com/llvm-mirror/libcxx/commit/00f4a49b0
Comment 1 Jan Beich freebsd_committer freebsd_triage 2016-12-08 08:36:27 UTC
libc++ in 10.x base fails like comment 0 but also has the following bug:

$ cat >a.cc
#include <algorithm>

int main() { return 0; }

$ g++49 -nostdinc++ -isystem /usr/include/c++/v1 a.cc
In file included from /usr/include/c++/v1/algorithm:627:0,
                 from a.cc:1:
/usr/include/c++/v1/memory:3768:37: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
         explicit shared_ptr(_Yp* __p);
                                     ^
/usr/include/c++/v1/memory:3775:37: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
         shared_ptr(_Yp* __p, _Dp __d);
                                     ^
/usr/include/c++/v1/memory:3782:49: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
         shared_ptr(_Yp* __p, _Dp __d, _Alloc __a);
                                                 ^
/usr/include/c++/v1/memory:3814:37: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
         shared_ptr(auto_ptr<_Yp> __r);
                                     ^
/usr/include/c++/v1/memory:3843:83: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
        typename enable_if<!is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
                                                                                   ^
/usr/include/c++/v1/memory:3852:82: error: default template arguments may not be used in function templates without -std=c++11 or -std=gnu++11
        typename enable_if<is_lvalue_reference<_Dp>::value, __nat>::type = __nat());
                                                                                  ^
Comment 2 Jan Beich freebsd_committer freebsd_triage 2016-12-08 08:38:38 UTC
Ah, -std=c++11 is no longer required on FreeBSD 10.3 which is going to be the new oldest supported release since 2017-01-01.