pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/databases/db5/patches
Module Name: pkgsrc
Committed By: hauke
Date: Tue Feb 19 15:18:19 UTC 2019
Modified Files:
pkgsrc/databases/db5/patches: patch-ab
Added Files:
pkgsrc/databases/db5/patches: patch-dist_config.bin
patch-src_dbinc_mutex_int.h
Log Message:
Add support for mutexes on aarch64 with GCC via databases/db4.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 pkgsrc/databases/db5/patches/patch-ab
cvs rdiff -u -r0 -r1.1 pkgsrc/databases/db5/patches/patch-dist_config.bin \
pkgsrc/databases/db5/patches/patch-src_dbinc_mutex_int.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: pkgsrc/databases/db5/patches/patch-ab
diff -u pkgsrc/databases/db5/patches/patch-ab:1.7 pkgsrc/databases/db5/patches/patch-ab:1.8
--- pkgsrc/databases/db5/patches/patch-ab:1.7 Fri Aug 26 12:40:25 2016
+++ pkgsrc/databases/db5/patches/patch-ab Tue Feb 19 15:18:19 2019
@@ -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 $
---- dist/configure.orig 2012-05-11 17:57:48.000000000 +0000
+Fix bashisms.
+
+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 @@ $NetBSD: patch-ab,v 1.7 2016/08/26 12:40
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
+
Added files:
Index: pkgsrc/databases/db5/patches/patch-dist_config.bin
diff -u /dev/null pkgsrc/databases/db5/patches/patch-dist_config.bin:1.1
--- /dev/null Tue Feb 19 15:18:19 2019
+++ pkgsrc/databases/db5/patches/patch-dist_config.bin Tue Feb 19 15:18:19 2019
@@ -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
+
Index: pkgsrc/databases/db5/patches/patch-src_dbinc_mutex_int.h
diff -u /dev/null pkgsrc/databases/db5/patches/patch-src_dbinc_mutex_int.h:1.1
--- /dev/null Tue Feb 19 15:18:19 2019
+++ pkgsrc/databases/db5/patches/patch-src_dbinc_mutex_int.h Tue Feb 19 15:18:19 2019
@@ -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