commit:     acd2e08ad90551840324fe20d3f3981bc3b8836b
Author:     Austin English <wizardedit <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  3 08:21:55 2016 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Fri Jun  3 08:23:17 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=acd2e08a

sys-libs/db: fix compiling with clang

Gentoo-Bug: https://bugs.gentoo.org/417547

 sys-libs/db/db-5.1.29-r1.ebuild                    |  3 +++
 sys-libs/db/db-5.3.28-r2.ebuild                    |  3 +++
 .../db-5.1.29-rename-atomic-compare-exchange.patch | 22 ++++++++++++++++++++++
 3 files changed, 28 insertions(+)

diff --git a/sys-libs/db/db-5.1.29-r1.ebuild b/sys-libs/db/db-5.1.29-r1.ebuild
index cac2645..0715268 100644
--- a/sys-libs/db/db-5.1.29-r1.ebuild
+++ b/sys-libs/db/db-5.1.29-r1.ebuild
@@ -58,6 +58,9 @@ src_prepare() {
        # merged upstream in 5.0.26
        #epatch "${FILESDIR}"/${PN}-5.0.21-enable-dbm-autoconf.patch
 
+       # Needed when compiling with clang
+       epatch "${FILESDIR}"/${P}-rename-atomic-compare-exchange.patch
+
        # Upstream release script grabs the dates when the script was run, so 
lets
        # end-run them to keep the date the same.
        export REAL_DB_RELEASE_DATE="$(awk \

diff --git a/sys-libs/db/db-5.3.28-r2.ebuild b/sys-libs/db/db-5.3.28-r2.ebuild
index 937d045..1354991 100644
--- a/sys-libs/db/db-5.3.28-r2.ebuild
+++ b/sys-libs/db/db-5.3.28-r2.ebuild
@@ -67,6 +67,9 @@ src_prepare() {
        # core, ~300MB each. This patch uses links instead, saves a lot of 
space.
        epatch "${FILESDIR}"/${PN}-6.0.20-test-link.patch
 
+       # Needed when compiling with clang
+       epatch "${FILESDIR}"/${PN}-5.1.29-rename-atomic-compare-exchange.patch
+
        # Upstream release script grabs the dates when the script was run, so 
lets
        # end-run them to keep the date the same.
        export REAL_DB_RELEASE_DATE="$(awk \

diff --git a/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch 
b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
new file mode 100644
index 0000000..ad3da27
--- /dev/null
+++ b/sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch
@@ -0,0 +1,22 @@
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 0034dcc..fa7ba93 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define       atomic_inc(env, p)      __atomic_inc(p)
+ #define       atomic_dec(env, p)      __atomic_dec(p)
+ #define       atomic_compare_exchange(env, p, o, n)   \
+-      __atomic_compare_exchange((p), (o), (n))
++      __db_atomic_compare_exchange((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+       int     temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __db_atomic_compare_exchange(
+       db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+       atomic_value_t was;

Reply via email to