diff options
Diffstat (limited to 'meta/recipes-support/db')
8 files changed, 226 insertions, 85 deletions
diff --git a/meta/recipes-support/db/db/0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch b/meta/recipes-support/db/db/0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch new file mode 100644 index 0000000000..c82e7c375f --- /dev/null +++ b/meta/recipes-support/db/db/0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch @@ -0,0 +1,147 @@ +From a3569f118fd95b7ad41e1a1128e17c0b8928556d Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sun, 20 Jan 2019 18:30:23 -0800 +Subject: [PATCH] Fix libc++ compatibility by renaming atomic_init API + +db5 does not build because it is redefining a C++11 standard +library identifier, atomic_init(). Therefore prefix all +its internal defines with '__db_', to avoid collisions. + +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] + +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/dbinc/atomic.h | 4 ++-- + src/mp/mp_fget.c | 4 ++-- + src/mp/mp_mvcc.c | 4 ++-- + src/mp/mp_region.c | 4 ++-- + src/mutex/mut_method.c | 2 +- + src/mutex/mut_tas.c | 4 ++-- + 6 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h +index 1b49de5..7bf353c 100644 +--- a/src/dbinc/atomic.h ++++ b/src/dbinc/atomic.h +@@ -70,7 +70,7 @@ typedef struct { + * These have no memory barriers; the caller must include them when necessary. + */ + #define atomic_read(p) ((p)->value) +-#define atomic_init(p, val) ((p)->value = (val)) ++#define __db_atomic_init(p, val) ((p)->value = (val)) + + #ifdef HAVE_ATOMIC_SUPPORT + +@@ -206,7 +206,7 @@ static inline int __db_atomic_compare_exchange( + #define atomic_dec(env, p) (--(p)->value) + #define atomic_compare_exchange(env, p, oldval, newval) \ + (DB_ASSERT(env, atomic_read(p) == (oldval)), \ +- atomic_init(p, (newval)), 1) ++ __db_atomic_init(p, (newval)), 1) + #else + #define atomic_inc(env, p) __atomic_inc(env, p) + #define atomic_dec(env, p) __atomic_dec(env, p) +diff --git a/src/mp/mp_fget.c b/src/mp/mp_fget.c +index 16de695..5159520 100644 +--- a/src/mp/mp_fget.c ++++ b/src/mp/mp_fget.c +@@ -649,7 +649,7 @@ alloc: /* Allocate a new buffer header and data space. */ + + /* Initialize enough so we can call __memp_bhfree. */ + alloc_bhp->flags = 0; +- atomic_init(&alloc_bhp->ref, 1); ++ __db_atomic_init(&alloc_bhp->ref, 1); + #ifdef DIAGNOSTIC + if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) { + __db_errx(env, DB_STR("3025", +@@ -955,7 +955,7 @@ alloc: /* Allocate a new buffer header and data space. */ + MVCC_MPROTECT(bhp->buf, mfp->pagesize, + PROT_READ); + +- atomic_init(&alloc_bhp->ref, 1); ++ __db_atomic_init(&alloc_bhp->ref, 1); + MUTEX_LOCK(env, alloc_bhp->mtx_buf); + alloc_bhp->priority = bhp->priority; + alloc_bhp->pgno = bhp->pgno; +diff --git a/src/mp/mp_mvcc.c b/src/mp/mp_mvcc.c +index 770bad8..dbce4f3 100644 +--- a/src/mp/mp_mvcc.c ++++ b/src/mp/mp_mvcc.c +@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp) + #else + memcpy(frozen_bhp, bhp, SSZA(BH, buf)); + #endif +- atomic_init(&frozen_bhp->ref, 0); ++ __db_atomic_init(&frozen_bhp->ref, 0); + if (mutex != MUTEX_INVALID) + frozen_bhp->mtx_buf = mutex; + else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH, +@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp) + #endif + alloc_bhp->mtx_buf = mutex; + MUTEX_LOCK(env, alloc_bhp->mtx_buf); +- atomic_init(&alloc_bhp->ref, 1); ++ __db_atomic_init(&alloc_bhp->ref, 1); + F_CLR(alloc_bhp, BH_FROZEN); + } + +diff --git a/src/mp/mp_region.c b/src/mp/mp_region.c +index 4952030..084f499 100644 +--- a/src/mp/mp_region.c ++++ b/src/mp/mp_region.c +@@ -245,7 +245,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg) + MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0) + return (ret); + SH_TAILQ_INIT(&htab[i].hash_bucket); +- atomic_init(&htab[i].hash_page_dirty, 0); ++ __db_atomic_init(&htab[i].hash_page_dirty, 0); + } + + /* +@@ -302,7 +302,7 @@ no_prealloc: + } else + hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount); + SH_TAILQ_INIT(&hp->hash_bucket); +- atomic_init(&hp->hash_page_dirty, 0); ++ __db_atomic_init(&hp->hash_page_dirty, 0); + #ifdef HAVE_STATISTICS + hp->hash_io_wait = 0; + hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0; +diff --git a/src/mutex/mut_method.c b/src/mutex/mut_method.c +index 09353b0..3c954b9 100644 +--- a/src/mutex/mut_method.c ++++ b/src/mutex/mut_method.c +@@ -474,7 +474,7 @@ atomic_compare_exchange(env, v, oldval, newval) + MUTEX_LOCK(env, mtx); + ret = atomic_read(v) == oldval; + if (ret) +- atomic_init(v, newval); ++ __db_atomic_init(v, newval); + MUTEX_UNLOCK(env, mtx); + + return (ret); +diff --git a/src/mutex/mut_tas.c b/src/mutex/mut_tas.c +index 106b161..5a3b033 100644 +--- a/src/mutex/mut_tas.c ++++ b/src/mutex/mut_tas.c +@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags) + + #ifdef HAVE_SHARED_LATCHES + if (F_ISSET(mutexp, DB_MUTEX_SHARED)) +- atomic_init(&mutexp->sharecount, 0); ++ __db_atomic_init(&mutexp->sharecount, 0); + else + #endif + if (MUTEX_INIT(&mutexp->tas)) { +@@ -536,7 +536,7 @@ __db_tas_mutex_unlock(env, mutex) + F_CLR(mutexp, DB_MUTEX_LOCKED); + /* Flush flag update before zeroing count */ + MEMBAR_EXIT(); +- atomic_init(&mutexp->sharecount, 0); ++ __db_atomic_init(&mutexp->sharecount, 0); + } else { + DB_ASSERT(env, sharecount > 0); + MEMBAR_EXIT(); +-- +2.20.1 + diff --git a/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch b/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch index 571708e03e..2374885e77 100644 --- a/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch +++ b/meta/recipes-support/db/db/0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch @@ -11,7 +11,7 @@ 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 +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- diff --git a/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch new file mode 100644 index 0000000000..d238b0f063 --- /dev/null +++ b/meta/recipes-support/db/db/0001-clock-Do-not-define-own-timespec.patch @@ -0,0 +1,45 @@ +From 96b303caf70a7635953c36e5bfb9ad6e75cb7637 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Fri, 14 Feb 2020 14:12:59 -0800 +Subject: [PATCH] clock: Do not define own timespec + +timespec is provided by libc and its best left to libc +os_gettime takes a db_timespec and passed its address to clock_gettime +which assumes that db_timespec and timespec are same but actually +its 12-bytes here and libc has 16-bytes + +This can cause problems especially with 64bit time_t + +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + src/dbinc/clock.h | 17 +---------------- + 1 file changed, 1 insertion(+), 16 deletions(-) + +--- a/src/dbinc/clock.h ++++ b/src/dbinc/clock.h +@@ -44,22 +44,8 @@ + extern "C" { + #endif + +-/* +- * This declaration is POSIX-compatible. Because there are lots of different +- * time.h include file patterns out there, it's easier to declare our own name +- * in all cases than to try and discover if a system has a struct timespec. +- * For the same reason, and because we'd have to #include <sys/time.h> in db.h, +- * we don't export any timespec structures in the DB API, even in places where +- * it would make sense, like the replication statistics information. +- */ +-typedef struct { +- time_t tv_sec; /* seconds */ +-#ifdef HAVE_MIXED_SIZE_ADDRESSING +- int32_t tv_nsec; +-#else +- long tv_nsec; /* nanoseconds */ +-#endif +-} db_timespec; ++#include <time.h> ++#define db_timespec struct timespec + + /* Operations on timespecs */ + #undef timespecclear diff --git a/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch b/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch index cb28db1343..a574cf67b9 100644 --- a/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch +++ b/meta/recipes-support/db/db/0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch @@ -7,7 +7,7 @@ This helps cross compile when tag inference via heuristics fail because CC variable is having -fPIE -pie and libtool smartly removes it when building libraries -Upstream-Status: Pending +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] Signed-off-by: Khem Raj <raj.khem@gmail.com> --- diff --git a/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch b/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch deleted file mode 100644 index 6a8eada605..0000000000 --- a/meta/recipes-support/db/db/arm-thumb-mutex_db5.patch +++ /dev/null @@ -1,50 +0,0 @@ -Original patch submitted by jbowler@nslu2-linux.org on 2005-11-17: - -db: fix thumb uclibc operation in 4.3.29 - - uclibc thumb builds were using libpthread to implement mutexes, the - - uclibc version seems to be a stub (at least on thumb). This commit - - fixes the ARM/gcc-assembly mutex implementation so that it has thumb - - support and the resultant db4 works (tested on LE Thumb uclibc) - -Upstream-Status: Inappropriate [embedded specific] - -Author: jbowler@nslu2-linux.org - -Index: db-6.0.30/src/dbinc/mutex_int.h -=================================================================== ---- db-6.0.30.orig/src/dbinc/mutex_int.h -+++ db-6.0.30/src/dbinc/mutex_int.h -@@ -474,6 +474,25 @@ typedef unsigned char tsl_t; - - #ifdef LOAD_ACTUAL_MUTEX_CODE - /* gcc/arm: 0 is clear, 1 is set. */ -+#if defined __thumb__ -+#define MUTEX_SET(tsl) ({ \ -+ int __r, __p; \ -+ __asm__ volatile( \ -+ ".align 2\n\t" \ -+ "bx pc\n\t" \ -+ "nop\n\t" \ -+ ".arm\n\t" \ -+ "swpb %0, %2, [%3]\n\t" \ -+ "eor %0, %0, #1\n\t" \ -+ "orr %1, pc, #1\n\t" \ -+ "bx %1\n\t" \ -+ ".force_thumb" \ -+ : "=&r" (__r), "=r" (__p) \ -+ : "r" (1), "r" (tsl) \ -+ ); \ -+ __r & 1; \ -+}) -+#else - #define MUTEX_SET(tsl) ({ \ - int __r; \ - __asm__ volatile( \ -@@ -484,6 +503,7 @@ typedef unsigned char tsl_t; - ); \ - __r & 1; \ - }) -+#endif - - #define MUTEX_UNSET(tsl) (*(volatile tsl_t *)(tsl) = 0) - #define MUTEX_INIT(tsl) (MUTEX_UNSET(tsl), 0) diff --git a/meta/recipes-support/db/db/fix-parallel-build.patch b/meta/recipes-support/db/db/fix-parallel-build.patch index 27632e1ddb..42c2407cf2 100644 --- a/meta/recipes-support/db/db/fix-parallel-build.patch +++ b/meta/recipes-support/db/db/fix-parallel-build.patch @@ -2,7 +2,7 @@ With higher paralelism it sometimes fails with: libtool: link: `util_log.lo' is not a valid libtool object make: *** [db_replicate] Error 1 -Upstream-Status: Pending +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> diff --git a/meta/recipes-support/db/db/sequence-type.patch b/meta/recipes-support/db/db/sequence-type.patch index a6fe3d62a0..fc9f7f0113 100644 --- a/meta/recipes-support/db/db/sequence-type.patch +++ b/meta/recipes-support/db/db/sequence-type.patch @@ -6,7 +6,7 @@ in stdint.h. This then breaks the overly complicated type check but as we know that int64_t exists and works, we can just delete that. -Upstream-Status: Pending +Upstream-Status: Inappropriate [as far as open source community is concerned, upstream is dead] Signed-off-by: Ross Burton <ross.burton@intel.com> --- a/dist/aclocal/sequence.m4~ 2013-09-09 16:35:02.000000000 +0100 diff --git a/meta/recipes-support/db/db_5.3.28.bb b/meta/recipes-support/db/db_5.3.28.bb index 093ee44909..a7d061e0da 100644 --- a/meta/recipes-support/db/db_5.3.28.bb +++ b/meta/recipes-support/db/db_5.3.28.bb @@ -10,27 +10,28 @@ # same system at the same time if really necessary. SECTION = "libs" SUMMARY = "Berkeley Database v5" -HOMEPAGE = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/overview/index.html" +DESCRIPTION = "Provides the foundational storage services for your application, no matter how demanding and unique your requirements may seem to be" +HOMEPAGE = "https://www.oracle.com/database/technologies/related/berkeleydb.html" LICENSE = "Sleepycat" -RCONFLICTS_${PN} = "db3" +RCONFLICTS:${PN} = "db3" -CVE_PRODUCT = "oracle_berkeley_db" +CVE_PRODUCT = "oracle_berkeley_db berkeley_db" CVE_VERSION = "11.2.${PV}" -PR = "r1" PE = "1" -SRC_URI = "http://download.oracle.com/berkeley-db/db-${PV}.tar.gz" -SRC_URI += "file://arm-thumb-mutex_db5.patch \ - file://fix-parallel-build.patch \ +SRC_URI = "https://download.oracle.com/berkeley-db/db-${PV}.tar.gz" +SRC_URI += "file://fix-parallel-build.patch \ file://0001-atomic-Rename-local-__atomic_compare_exchange-to-avo.patch \ file://0001-configure-Add-explicit-tag-options-to-libtool-invoca.patch \ file://sequence-type.patch \ + file://0001-Fix-libc-compatibility-by-renaming-atomic_init-API.patch \ + file://0001-clock-Do-not-define-own-timespec.patch \ " # We are not interested in official latest 6.x versions; # let's track what debian is using. UPSTREAM_CHECK_URI = "${DEBIAN_MIRROR}/main/d/db5.3/" -UPSTREAM_CHECK_REGEX = "db5\.3_(?P<pver>.+)\.orig" +UPSTREAM_CHECK_REGEX = "db5\.3_(?P<pver>\d+(\.\d+)+).+\.orig" SRC_URI[md5sum] = "b99454564d5b4479750567031d66fe24" SRC_URI[sha256sum] = "e0a992d740709892e81f9d93f06daf305cf73fb81b545afe72478043172c3628" @@ -45,8 +46,7 @@ inherit autotools inherit lib_package PACKAGES =+ "${PN}-cxx" -FILES_${PN}-cxx = "${libdir}/*cxx*so" - +FILES:${PN}-cxx = "${libdir}/*cxx*so" # The dev package has the .so link (as in db3) and the .a's - # it is therefore incompatible (cannot be installed at the @@ -57,21 +57,13 @@ FILES_SOLIBSDEV = "${libdir}/libdb.so ${libdir}/libdb_cxx.so" #configuration - set in local.conf to override # All the --disable-* options replace --enable-smallbuild, which breaks a bunch of stuff (eg. postfix) -DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-verify --disable-compat185 --disable-sql" - -EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot" - -# Override the MUTEX setting here, the POSIX library is -# the default - "POSIX/pthreads/library". -# Don't ignore the nice SWP instruction on the ARM: -# These enable the ARM assembler mutex code, this won't -# work with thumb compilation... -ARM_MUTEX = "--with-mutex=ARM/gcc-assembly" -MUTEX = "" -MUTEX_arm = "${ARM_MUTEX}" -MUTEX_armeb = "${ARM_MUTEX}" -EXTRA_OECONF += "${MUTEX} STRIP=true" -EXTRA_OEMAKE += "LIBTOOL='./${HOST_SYS}-libtool'" +DB5_CONFIG ?= "--enable-o_direct --disable-cryptography --disable-queue --disable-replication --disable-compat185 --disable-sql" + +EXTRA_OECONF = "${DB5_CONFIG} --enable-shared --enable-cxx --with-sysroot STRIP=true" + +PACKAGECONFIG ??= "" +PACKAGECONFIG[verify] = "--enable-verify, --disable-verify" +PACKAGECONFIG[dbm] = "--enable-dbm,--disable-dbm," EXTRA_AUTORECONF += "--exclude=autoheader -I ${S}/dist/aclocal -I${S}/dist/aclocal_java" AUTOTOOLS_SCRIPT_PATH = "${S}/dist" @@ -80,7 +72,7 @@ AUTOTOOLS_SCRIPT_PATH = "${S}/dist" # configure. CONFIG_SITE = "" -oe_runconf_prepend() { +oe_runconf:prepend() { . ${S}/dist/RELEASE # Edit version information we couldn't pre-compute. sed -i -e "s/__EDIT_DB_VERSION_FAMILY__/$DB_VERSION_FAMILY/g" \ @@ -94,12 +86,12 @@ oe_runconf_prepend() { -e "s/__EDIT_DB_VERSION__/$DB_VERSION/g" ${S}/dist/configure } -do_compile_prepend() { +do_compile:prepend() { # Stop libtool adding RPATHs - sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/${HOST_SYS}-libtool + sed -i -e 's|hardcode_into_libs=yes|hardcode_into_libs=no|' ${B}/libtool } -do_install_append() { +do_install:append() { mkdir -p ${D}/${includedir}/db51 mv ${D}/${includedir}/db.h ${D}/${includedir}/db51/. mv ${D}/${includedir}/db_cxx.h ${D}/${includedir}/db51/. @@ -115,9 +107,16 @@ do_install_append() { fi chown -R root:root ${D} + if ${@bb.utils.contains('PACKAGECONFIG', 'verify', 'false', 'true', d)}; then + rm -f ${D}${bindir}/db_verify + fi } -INSANE_SKIP_${PN} = "dev-so" -INSANE_SKIP_${PN}-cxx = "dev-so" +INSANE_SKIP:${PN} = "dev-so" +INSANE_SKIP:${PN}-cxx = "dev-so" BBCLASSEXTEND = "native nativesdk" + +# many configure tests are failing with gcc-14 +CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration" +BUILD_CFLAGS += "-Wno-error=implicit-int -Wno-error=implicit-function-declaration" |