Created attachment 313075 [details] sys-libs/db-4.8.30 failure log `env CC=clang CXX=clang++ emerge -1v sys-libs/db` currently fails on all platforms because it redefines the built-in function __atomic_compare_exchange. According to the Clang mailing list, GCC 4.7 also implements __atomic_compare_exchange, so it should also be affected.
It's a warning, not a failure with 4.7. ../dist/../dbinc/atomic.h:179:19: warning: conflicting types for built-in function '__atomic_compare_exchange' [enabled by default]
`env EXTRA_ECONF=--disable-atomicsupport CC=clang CXX=clang++ emerge -1v sys-libs/db` builds without a problem. It looks like this can be fixed by modifying ./dist/aclocal/mutex.m4 to do a check for __atomic_compare_exchange and modifying ./dbinc/atomic.h to obey it.
(In reply to comment #1) > It's a warning, not a failure with 4.7. > > ../dist/../dbinc/atomic.h:179:19: warning: conflicting types for built-in > function '__atomic_compare_exchange' [enabled by default] In that case, we do not need the blocker on bug #390247. Thanks for testing that.
Created attachment 313479 [details, diff] Fix build failure with Clang 3.0 Clang's __atomic_compare_exchange uses 6 arguments while the sys-lib/db version uses 3 arguments. As such, the best thing to do is to just rename the function. I have attached a patch that does that.
Fix committed to CVS with Chainsaw's approval. I only committed it for sys-libs/db-4.8.30. Someone will need to review later releases, verify that the patch applies to them (it likely does) and apply the fix to them. I will try to do that later. I am marking this as in progress.
(In reply to comment #5) > Fix committed to CVS with Chainsaw's approval. > > I only committed it for sys-libs/db-4.8.30. Someone will need to review > later releases, verify that the patch applies to them (it likely does) and > apply the fix to them. I will try to do that later. I am marking this as in > progress. I verified that versions 5.0.y compiled with the patch, so I have applied it to them in CVS. It does not apply cleanly to versions 5.1.y and 5.2.y, but 5.x is masked, so I am going to put this down for now.
*** Bug 519362 has been marked as a duplicate of this bug. ***
(In reply to Richard Yao from comment #5) > Fix committed to CVS with Chainsaw's approval. > > I only committed it for sys-libs/db-4.8.30. Someone will need to review > later releases, verify that the patch applies to them (it likely does) and > apply the fix to them. I will try to do that later. I am marking this as in > progress. 4.8.30-r2, 6.0.35, 6.1.26, 6.2.23 are fine, 5.1.29, 5.3.28 fail with clang-3.5.
(In reply to Austin English from comment #8) > (In reply to Richard Yao from comment #5) > > Fix committed to CVS with Chainsaw's approval. > > > > I only committed it for sys-libs/db-4.8.30. Someone will need to review > > later releases, verify that the patch applies to them (it likely does) and > > apply the fix to them. I will try to do that later. I am marking this as in > > progress. > > 4.8.30-r2, 6.0.35, 6.1.26, 6.2.23 are fine, 5.1.29, 5.3.28 fail with > clang-3.5. https://github.com/gentoo/gentoo/pull/1591 Upstream moved the affected file to a new src/ dir in 5.x, which broke the patch. I rebased for 5.x, and now all 4.x, 5.x and 6.x versions compile with clang-3.5 on my machine.
commit ca32c42