pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/databases/db5 Add support for mutexes on aarch64 with ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/ab8eb1a1e2d3
branches:  trunk
changeset: 329951:ab8eb1a1e2d3
user:      hauke <hauke%pkgsrc.org@localhost>
date:      Tue Feb 19 15:18:19 2019 +0000

description:
Add support for mutexes on aarch64 with GCC via databases/db4.

diffstat:

 databases/db5/Makefile                            |   4 +-
 databases/db5/distinfo                            |   6 +-
 databases/db5/patches/patch-ab                    |  53 +++++++++++++++++-
 databases/db5/patches/patch-dist_config.bin       |  16 +++++
 databases/db5/patches/patch-src_dbinc_mutex_int.h |  66 +++++++++++++++++++++++
 5 files changed, 139 insertions(+), 6 deletions(-)

diffs (196 lines):

diff -r 054a06f14d59 -r ab8eb1a1e2d3 databases/db5/Makefile
--- a/databases/db5/Makefile    Tue Feb 19 14:22:58 2019 +0000
+++ b/databases/db5/Makefile    Tue Feb 19 15:18:19 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.20 2017/09/03 08:36:51 wiz Exp $
+# $NetBSD: Makefile,v 1.21 2019/02/19 15:18:38 hauke Exp $
 #
 # NOTE:
 # When updating this package, a change in the minor (5.n -> 5.(n+1))
@@ -8,7 +8,7 @@
 
 DISTNAME=      db-5.3.28
 PKGNAME=       ${DISTNAME:S/db/db5/}
-PKGREVISION=   1
+PKGREVISION=   2
 CATEGORIES=    databases
 MASTER_SITES=  http://download.oracle.com/berkeley-db/
 MASTER_SITES+= http://download-uk.oracle.com/berkeley-db/
diff -r 054a06f14d59 -r ab8eb1a1e2d3 databases/db5/distinfo
--- a/databases/db5/distinfo    Tue Feb 19 14:22:58 2019 +0000
+++ b/databases/db5/distinfo    Tue Feb 19 15:18:19 2019 +0000
@@ -1,15 +1,17 @@
-$NetBSD: distinfo,v 1.15 2016/08/26 17:23:16 joerg Exp $
+$NetBSD: distinfo,v 1.16 2019/02/19 15:18:38 hauke Exp $
 
 SHA1 (db-5.3.28.tar.gz) = fa3f8a41ad5101f43d08bc0efb6241c9b6fc1ae9
 RMD160 (db-5.3.28.tar.gz) = a4898908ef6dccb137df02e43843f7d3cfab6a3c
 SHA512 (db-5.3.28.tar.gz) = e91bbe550fc147a8be7e69ade86fdb7066453814971b2b0223f7d17712bd029a8eff5b2b6b238042ff6ec1ffa6879d44cb95c5645a922fee305c26c3eeaee090
 Size (db-5.3.28.tar.gz) = 35090431 bytes
 SHA1 (patch-aa) = 9450e95f46787ddc1d661beaa239ea0ff4673f20
-SHA1 (patch-ab) = b09fac68d7d847c5660078de90a16f27268e9858
+SHA1 (patch-ab) = 0bf2bb3270b6fa334f0d4b93e4a28c44e254b935
 SHA1 (patch-ac) = 0a243583ae2b66290fb83b112c539001bf3feef2
 SHA1 (patch-dist_aclocal_libtool.m4) = 2d56b318b4f0d14a9352f6c1eb14a4c2b8315fc0
+SHA1 (patch-dist_config.bin) = e58a4637c079a8e2e7334100b9096dba5f0d6600
 SHA1 (patch-src_dbinc_atomic.h) = c4fbe421d2c8ba68dc81aeeda1cad09a2c68fbe5
 SHA1 (patch-src_dbinc_db.in) = d20a8c474485811b2e28d54fa5cf2d340d417992
+SHA1 (patch-src_dbinc_mutex_int.h) = 36f7fd31f5f79fe2c121e8f835c342ec24bda89b
 SHA1 (patch-src_mp_mp__fget.c) = c5050193279db979d51d47f5e2c8d7c5cace0fa7
 SHA1 (patch-src_mp_mp__mvcc.c) = 2e8b4e5ff7a7534681597261ba82ca08e9231567
 SHA1 (patch-src_mp_mp__region.c) = 1c33dc783660515ff24ba018d1ef99cedf9eb3f8
diff -r 054a06f14d59 -r ab8eb1a1e2d3 databases/db5/patches/patch-ab
--- a/databases/db5/patches/patch-ab    Tue Feb 19 14:22:58 2019 +0000
+++ b/databases/db5/patches/patch-ab    Tue Feb 19 15:18:19 2019 +0000
@@ -1,6 +1,12 @@
-$NetBSD: patch-ab,v 1.7 2016/08/26 12:40:25 richard Exp $
+$NetBSD: patch-ab,v 1.8 2019/02/19 15:18:19 hauke Exp $
+
+Fix bashisms.
 
---- dist/configure.orig        2012-05-11 17:57:48.000000000 +0000
+FreeBSD 10 is not FreeBSD 1.
+
+Add support for mutexes on aarch64 with GCC.
+
+--- dist/configure.orig        2013-09-09 15:35:02.000000000 +0000
 +++ dist/configure
 @@ -5112,7 +5112,7 @@ bsdi3*)  CC=${CC-"shlicc2"}
        LIBSO_LIBS="$LIBSO_LIBS -lipc";;
@@ -101,3 +107,46 @@
                        LIBS="$LIBS -lpthread"
  
  if test "$cross_compiling" = yes; then :
+@@ -21796,6 +21796,31 @@ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ fi
+ 
++# AARCH64/gcc: Linux
++if test "$db_cv_mutex" = no; then
++cat confdefs.h - <<_ACEOF >conftest.$ac_ext
++/* end confdefs.h.  */
++
++int
++main ()
++{
++
++#if defined(__aarch64__) && defined(__GNUC__)
++      exit(0);
++#else
++      FAIL TO COMPILE/LINK
++#endif
++
++  ;
++  return 0;
++}
++_ACEOF
++if ac_fn_c_try_compile "$LINENO"; then :
++  db_cv_mutex=AARCH64/gcc-assembly
++fi
++rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
++fi
++
+ # MIPS/gcc: Linux
+ if test "$db_cv_mutex" = no; then
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+@@ -22124,6 +22149,10 @@ ARM/gcc-assembly)     ADDITIONAL_OBJS="mut_t
+                       $as_echo "#define HAVE_MUTEX_ARM_GCC_ASSEMBLY 1" >>confdefs.h
+ 
+                       ;;
++AARCH64/gcc-assembly) ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
++                      $as_echo "#define HAVE_MUTEX_AARCH64_GCC_ASSEMBLY 1" >>confdefs.h
++
++                      ;;
+ HP/msem_init)         ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+                       $as_echo "#define HAVE_MUTEX_HPPA_MSEM_INIT 1" >>confdefs.h
+ 
diff -r 054a06f14d59 -r ab8eb1a1e2d3 databases/db5/patches/patch-dist_config.bin
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/db5/patches/patch-dist_config.bin       Tue Feb 19 15:18:19 2019 +0000
@@ -0,0 +1,16 @@
+$NetBSD: patch-dist_config.bin,v 1.1 2019/02/19 15:18:19 hauke Exp $
+
+Add support for mutexes on aarch64 with GCC.
+
+--- dist/config.hin.orig       2010-04-12 20:25:23.000000000 +0000
++++ dist/config.hin
+@@ -212,6 +212,9 @@
+ /* Define to 1 to use the GCC compiler and ARM assembly language mutexes. */
+ #undef HAVE_MUTEX_ARM_GCC_ASSEMBLY
+ 
++/* Define to 1 to use the GCC compiler and AARCH64 assembly language mutexes. */
++#undef HAVE_MUTEX_AARCH64_GCC_ASSEMBLY
++
+ /* Define to 1 to use the Apple/Darwin _spin_lock_try mutexes. */
+ #undef HAVE_MUTEX_DARWIN_SPIN_LOCK_TRY
+ 
diff -r 054a06f14d59 -r ab8eb1a1e2d3 databases/db5/patches/patch-src_dbinc_mutex_int.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/databases/db5/patches/patch-src_dbinc_mutex_int.h Tue Feb 19 15:18:19 2019 +0000
@@ -0,0 +1,66 @@
+$NetBSD: patch-src_dbinc_mutex_int.h,v 1.1 2019/02/19 15:18:19 hauke Exp $
+
+* adds support for mutexes on aarch64
+* fixes build failure on MIPS arch with -mips1.
+
+--- src/dbinc/mutex_int.h.orig 2010-04-12 20:25:22.000000000 +0000
++++ src/dbinc/mutex_int.h
+@@ -491,6 +491,43 @@ typedef unsigned char tsl_t;
+ #endif
+ 
+ /*********************************************************************
++ * AARCH64/gcc assembly.
++ *********************************************************************/
++
++#ifdef HAVE_MUTEX_AARCH64_GCC_ASSEMBLY
++typedef unsigned int tsl_t;
++
++#ifdef LOAD_ACTUAL_MUTEX_CODE
++static inline int
++MUTEX_SET(tsl_t *tsl) {
++      register tsl_t *__l = tsl;
++      register tsl_t __r;
++      __asm__ volatile(
++              "1:     ldxr    %w0,[%1]\n"
++              "       cbnz    %w0,2f\n"
++              "       stxr    %w0,%w2,[%1]\n"
++              "       cbnz    %w0,1b\n"
++              "       dmb     st\n"
++              "2:"
++              : "=&r"(__r)
++              : "r"(__l), "r"(1)
++              : "memory");
++
++      return !__r;
++}
++
++static inline int
++MUTEX_UNSET(tsl_t *tsl) {
++      __asm__ volatile(
++              "       dsb     sy\n" ::: "memory");
++      return *tsl = 0;
++}
++
++#define       MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
++#endif
++#endif
++
++/*********************************************************************
+  * HPPA/gcc assembly.
+  *********************************************************************/
+ #ifdef HAVE_MUTEX_HPPA_GCC_ASSEMBLY
+@@ -778,10 +815,14 @@ MUTEX_SET(tsl_t *tsl) {
+ static inline void
+ MUTEX_UNSET(tsl_t *tsl) {
+       __asm__ volatile(
++             "       .set push           \n"
++             "       .set mips2          \n"
+              "       .set noreorder      \n"
++             "       .set nomacro        \n"
+              "       sync                \n"
+              "       sw      $0, %0      \n"
+              "       .set reorder        \n"
++             "       .set pop            \n"
+              : "=m" (*tsl)
+              : "m" (*tsl)
+              : "memory");



Home | Main Index | Thread Index | Old Index