summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorEric Sandall2018-09-13 09:44:16 -0700
committerEric Sandall2018-09-13 09:44:16 -0700
commit79b62480dbb5c15ce3da5fd603006d459b0d2a63 (patch)
tree1e758bd7a6fa87e5ce1477eb1fb59cc8d065ad2b /database
parent43fd9847591ab691a61b86f6b4bfecf4018166ac (diff)
db: Fix compiling against GCC 8.x with Clang
See https://patchwork.ozlabs.org/patch/909328/
Diffstat (limited to 'database')
-rw-r--r--database/db/0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch53
-rwxr-xr-xdatabase/db/BUILD3
-rw-r--r--database/db/HISTORY8
-rwxr-xr-xdatabase/db/PRE_BUILD10
4 files changed, 71 insertions, 3 deletions
diff --git a/database/db/0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch b/database/db/0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
new file mode 100644
index 0000000000..7b3bc049f7
--- /dev/null
+++ b/database/db/0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
@@ -0,0 +1,53 @@
+# From https://patchwork.ozlabs.org/patch/909328/
+From 29621d637e30982489693f2e207ce6a1790e3337 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Wed, 22 Mar 2017 15:32:26 +0000
+Subject: [PATCH] atomic: Rename local __atomic_compare_exchange to avoid clash
+ with builtins
+
+Helps building with clang
+
+Fixes
+
+../db-5.3.28/src/dbinc/atomic.h:179:19: error: definition of builtin function '__atomic_compare_exchange'
+static inline int __atomic_compare_exchange(
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Downloaded from
+http://git.yoctoproject.org/cgit.cgi/poky/plain/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
+
+Fixes gcc-8 build error.
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ src/dbinc/atomic.h | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 6a858f7..1b49de5 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;
+--
+1.8.3.1
+
diff --git a/database/db/BUILD b/database/db/BUILD
index caad726424..980912747f 100755
--- a/database/db/BUILD
+++ b/database/db/BUILD
@@ -1,6 +1,3 @@
-patch -p1 < $SCRIPT_DIRECTORY/javafix.diff &&
-sedit 's|\(docdir\w*=\w*[^/]*\)/docs|\1/share/doc/db|' dist/Makefile.in &&
-
OPTS="$OPTS $DB_JSUP $DB_TESTS" &&
if [ "$DB_JSUP" == "--enable-java" ]; then
diff --git a/database/db/HISTORY b/database/db/HISTORY
index 650f5eff73..e9035a34ac 100644
--- a/database/db/HISTORY
+++ b/database/db/HISTORY
@@ -1,3 +1,11 @@
+2018-09-13 Eric Sandall <sandalle@sourcemage.org>
+ * BUILD: Move javafix.diff to PRE_BUILD
+ * PRE_BUILD: Apply javafix.diff
+ Apply 0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch
+ * 0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch: Fix
+ compiling against GCC 8.x with Clang
+ See https://patchwork.ozlabs.org/patch/909328/
+
2014-12-26 Ismael Luceno <ismael@sourcemage.org>
* DETAILS: updated spell to 5.3.28
* BUILD: $TESTS -> $DB_TESTS
diff --git a/database/db/PRE_BUILD b/database/db/PRE_BUILD
new file mode 100755
index 0000000000..4068dcca83
--- /dev/null
+++ b/database/db/PRE_BUILD
@@ -0,0 +1,10 @@
+default_pre_build &&
+cd "${SOURCE_DIRECTORY}" &&
+
+message "${MESSAGE_COLOR}Applying Java compiler fix...${DEFAULT_COLOR}" &&
+patch -p1 < "${SPELL_DIRECTORY}"/javafix.diff &&
+
+message "${MESSAGE_COLOR}Applying GCC 8.x Clang fix...${DEFAULT_COLOR}" &&
+patch -p1 < "${SPELL_DIRECTORY}"/0002-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch &&
+
+sedit 's|\(docdir\w*=\w*[^/]*\)/docs|\1/share/doc/db|' dist/Makefile.in