sys-libs/db: fix compiling with clang
authorAustin English <wizardedit@gentoo.org>
Fri, 3 Jun 2016 08:21:55 +0000 (03:21 -0500)
committerAustin English <wizardedit@gentoo.org>
Fri, 3 Jun 2016 08:23:17 +0000 (03:23 -0500)
Gentoo-Bug: https://bugs.gentoo.org/417547

sys-libs/db/db-5.1.29-r1.ebuild
sys-libs/db/db-5.3.28-r2.ebuild
sys-libs/db/files/db-5.1.29-rename-atomic-compare-exchange.patch [new file with mode: 0644]

index cac26457da2bef83a921b791f537673c4628baab..07152689e8a56e5cfb9a38ce4e2e7cf80d33a5d6 100644 (file)
@@ -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 \
index 937d045c4164f4d7dbae26758f14d4ebc057e293..1354991687bbc329114b8834937f746b3a94623c 100644 (file)
@@ -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 (file)
index 0000000..ad3da27
--- /dev/null
@@ -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;