[Pkg-db-devel] Bug#291901: marked as done (db3: mutexes for mips, arm and amd64.)

Debian Bug Tracking System owner@bugs.debian.org
Sun, 30 Jan 2005 04:03:23 -0800


Your message dated Sun, 30 Jan 2005 06:47:18 -0500
with message-id <E1CvDXy-0004jq-00@newraff.debian.org>
and subject line Bug#291901: fixed in db3 3.2.9-21
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 23 Jan 2005 21:27:30 +0000
>From kurt@roeckx.be Sun Jan 23 13:27:30 2005
Return-path: <kurt@roeckx.be>
Received: from adicia.telenet-ops.be [195.130.132.56] 
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CspGc-0004P7-00; Sun, 23 Jan 2005 13:27:30 -0800
Received: from localhost (localhost.localdomain [127.0.0.1])
	by adicia.telenet-ops.be (Postfix) with SMTP id 7507D44847
	for <submit@bugs.debian.org>; Sun, 23 Jan 2005 22:27:29 +0100 (MET)
Received: from Q.roeckx.be (dD5775FD9.access.telenet.be [213.119.95.217])
	by adicia.telenet-ops.be (Postfix) with ESMTP id 2D4CE44A8B
	for <submit@bugs.debian.org>; Sun, 23 Jan 2005 22:27:29 +0100 (MET)
Received: by Q.roeckx.be (Postfix, from userid 501)
	id C669226137; Sun, 23 Jan 2005 22:27:28 +0100 (CET)
Date: Sun, 23 Jan 2005 22:27:28 +0100
From: Kurt Roeckx <kurt@roeckx.be>
To: submit@bugs.debian.org
Subject: db3: mutexes for mips, arm and amd64.
Message-ID: <20050123212728.GA9211@roeckx.be>
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="IJpNTDwzlM2Ie8A6"
Content-Disposition: inline
User-Agent: Mutt/1.4.2.1i
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.4 required=4.0 tests=BAYES_00,HAS_PACKAGE,
	UPPERCASE_25_50 autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 


--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Package: db3
Version: 3.2.9-20
Tags: patch

Hi,

I've made a patch that adds mutexes for mips, arm and amd64.
Just put the patch in the debian/patches dir and it should
work.

You shoud additional remove the the LD_ASSUME_KERNEL from
debian/rules to make it build on amd64.


Kurt


--IJpNTDwzlM2Ie8A6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="024_mips+arm+amd64_mutex.diff"

diff -urN db-3.2.9/dist/acconfig.h db-3.2.9+mutex/dist/acconfig.h
--- db-3.2.9/dist/acconfig.h	2005-01-23 22:08:56.157411026 +0100
+++ db-3.2.9+mutex/dist/acconfig.h	2005-01-23 22:11:23.795966554 +0100
@@ -53,6 +53,8 @@
 #undef HAVE_MUTEX_VXWORKS
 #undef HAVE_MUTEX_WIN16
 #undef HAVE_MUTEX_WIN32
+#undef HAVE_MUTEX_ARM_GCC_ASSEMBLY
+#undef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
 #undef HAVE_MUTEX_X86_GCC_ASSEMBLY
 
 /* Define if building on QNX. */
diff -urN db-3.2.9/dist/aclocal/mutex.m4 db-3.2.9+mutex/dist/aclocal/mutex.m4
--- db-3.2.9/dist/aclocal/mutex.m4	2005-01-23 22:08:56.157411026 +0100
+++ db-3.2.9+mutex/dist/aclocal/mutex.m4	2005-01-23 22:09:19.893802546 +0100
@@ -91,6 +91,7 @@
 dnl POSIX.1 pthreads: pthread_XXX
 dnl
 dnl Try with and without the -lpthread library.
+if test "$db_cv_pthreadsmutexes" = yes; then
 if test "$db_cv_mutex" = no -o "$db_cv_mutex" = "posix_only"; then
 AC_TRY_RUN([
 #include <pthread.h>
@@ -142,6 +143,7 @@
 if test "$db_cv_mutex" = "posix_only"; then
 	AC_MSG_ERROR([unable to find POSIX mutex interfaces])
 fi
+fi
 
 dnl msemaphore: HPPA only
 dnl Try HPPA before general msem test, it needs special alignment.
@@ -252,6 +254,28 @@
 [db_cv_mutex="ALPHA/gcc-assembly"])
 fi
 
+# ARM/gcc: Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if defined(__arm__) && defined(__GNUC__)
+	exit(0);
+#else
+	FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="ARM/gcc-assembly"])
+fi
+
+# MIPS/gcc: Linux
+if test "$db_cv_mutex" = no; then
+AC_TRY_COMPILE(,[
+#if (defined(__mips) || defined(__mips__)) && defined(__GNUC__)
+	exit(0);
+#else
+       FAIL TO COMPILE/LINK
+#endif
+], [db_cv_mutex="MIPS/gcc-assembly"])
+fi
+
 dnl PaRisc/gcc: HP/UX
 if test "$db_cv_mutex" = no; then
 AC_TRY_RUN([main(){
@@ -329,7 +353,7 @@
 dnl x86/gcc: FreeBSD, NetBSD, BSD/OS, Linux
 if test "$db_cv_mutex" = no; then
 AC_TRY_RUN([main(){
-#if defined(i386) || defined(__i386__)
+#if defined(i386) || defined(__i386__) || defined(__x86_64__)
 #if defined(__GNUC__)
 	exit(0);
 #endif
@@ -338,7 +362,7 @@
 }], [db_cv_mutex="x86/gcc-assembly"])
 fi
 
-dnl ia86/gcc: Linux
+dnl ia64/gcc: Linux
 if test "$db_cv_mutex" = no; then
 AC_TRY_RUN([main(){
 #if defined(__ia64)
@@ -417,6 +441,10 @@
 			AC_DEFINE(HAVE_MUTEX_SEMA_INIT);;
 UTS/cc-assembly)	ADDITIONAL_OBJS="$ADDITIONAL_OBJS uts4.cc${o}"
 			AC_DEFINE(HAVE_MUTEX_UTS_CC_ASSEMBLY);;
+ARM/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			AC_DEFINE(HAVE_MUTEX_ARM_GCC_ASSEMBLY);;
+MIPS/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
+			AC_DEFINE(HAVE_MUTEX_MIPS_GCC_ASSEMBLY);;
 x86/gcc-assembly)	ADDITIONAL_OBJS="mut_tas${o} $ADDITIONAL_OBJS"
 			AC_DEFINE(HAVE_MUTEX_X86_GCC_ASSEMBLY);;
 esac
diff -urN db-3.2.9/dist/aclocal/options.m4 db-3.2.9+mutex/dist/aclocal/options.m4
--- db-3.2.9/dist/aclocal/options.m4	2000-07-09 16:52:15.000000000 +0200
+++ db-3.2.9+mutex/dist/aclocal/options.m4	2005-01-23 22:09:19.893802546 +0100
@@ -63,6 +63,16 @@
 	[db_cv_java="$enable_java"], [db_cv_java="no"])
 AC_MSG_RESULT($db_cv_java)
 
+AC_MSG_CHECKING(if --enable-pthreadsmutexes option specified)
+AC_ARG_ENABLE(pthreadsmutexes,
+	AC_HELP_STRING([--enable-pthreadsmutexes],
+	    [Use POSIX pthreads mutexes.]),, enableval="no")
+db_cv_pthreadsmutexes="$enableval"
+case "$enableval" in
+ no) AC_MSG_RESULT(yes);;
+yes) AC_MSG_RESULT(no);;
+esac
+
 AC_MSG_CHECKING(if --enable-posixmutexes option specified)
 AC_ARG_ENABLE(posixmutexes,
 	[  --enable-posixmutexes   Force use of POSIX standard mutexes.],
diff -urN db-3.2.9/include/mutex.h db-3.2.9+mutex/include/mutex.h
--- db-3.2.9/include/mutex.h	2005-01-23 22:08:56.158410874 +0100
+++ db-3.2.9+mutex/include/mutex.h	2005-01-23 22:09:19.893802546 +0100
@@ -413,7 +413,7 @@
 	__r & 1;							\
 })
 
-#define	MUTEX_UNSET(tsl)	(*(tsl) = -1)
+#define	MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = -1)
 #define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
 #endif
 #endif
@@ -648,6 +648,71 @@
 #endif
 
 /*********************************************************************
+ * ARM/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_ARM_GCC_ASSEMBLY
+typedef unsigned char tsl_t;
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * For arm/gcc, 0 is clear, 1 is set.
+ */
+#define	MUTEX_SET(tsl) ({						\
+	int __r;							\
+	asm volatile("swpb %0, %1, [%2]"				\
+	    : "=r" (__r) 						\
+	    : "0" (1), "r" (tsl)					\
+	    : "memory"							\
+	    );								\
+	__r & 1;							\
+})
+
+#define	MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = 0)
+#define	MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
+ * MIPS/gcc assembly.
+ *********************************************************************/
+#ifdef HAVE_MUTEX_MIPS_GCC_ASSEMBLY
+typedef u_int32_t tsl_t;
+
+#ifndef MUTEX_ALIGN
+#define MUTEX_ALIGN sizeof(u_int32_t)
+#endif
+
+#ifdef LOAD_ACTUAL_MUTEX_CODE
+/*
+ * For gcc/MIPS.  Should return 0 if could not acquire the lock, 1 if
+ * lock was acquired properly.
+ */
+static inline int
+MUTEX_SET(tsl_t *tsl) {
+	register tsl_t *__l = tsl;
+	register tsl_t __r;
+	__asm__ __volatile__(
+		"	.set push		\n"
+		"	.set mips2		\n"
+		"	.set noreorder		\n"
+		"	.set nomacro		\n"
+		"1:	ll	%0, %1		\n"
+		"	bne	%0, $0, 1f	\n"
+		"	xori	%0, %0, 1	\n"
+		"	sc	%0, %1		\n"
+		"	beql	%0, $0, 1b	\n"
+		"	xori	%0, 1		\n"
+		"1:	.set pop		"
+		: "=&r" (__r), "+R" (*__l));
+	return __r;
+}
+
+#define		MUTEX_UNSET(tsl)	(*(volatile tsl_t *)(tsl) = 0)
+#define		MUTEX_INIT(tsl)		MUTEX_UNSET(tsl)
+#endif
+#endif
+
+/*********************************************************************
  * x86/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_X86_GCC_ASSEMBLY

--IJpNTDwzlM2Ie8A6--

---------------------------------------
Received: (at 291901-close) by bugs.debian.org; 30 Jan 2005 11:53:21 +0000
>From katie@ftp-master.debian.org Sun Jan 30 03:53:21 2005
Return-path: <katie@ftp-master.debian.org>
Received: from newraff.debian.org [208.185.25.31] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1CvDdp-0000MD-00; Sun, 30 Jan 2005 03:53:21 -0800
Received: from katie by newraff.debian.org with local (Exim 3.35 1 (Debian))
	id 1CvDXy-0004jq-00; Sun, 30 Jan 2005 06:47:18 -0500
From: Andreas Barth <aba@not.so.argh.org>
To: 291901-close@bugs.debian.org
X-Katie: $Revision: 1.55 $
Subject: Bug#291901: fixed in db3 3.2.9-21
Message-Id: <E1CvDXy-0004jq-00@newraff.debian.org>
Sender: Archive Administrator <katie@ftp-master.debian.org>
Date: Sun, 30 Jan 2005 06:47:18 -0500
Delivered-To: 291901-close@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Source: db3
Source-Version: 3.2.9-21

We believe that the bug you reported is fixed in the latest version of
db3, which is due to be installed in the Debian FTP archive:

db3-doc_3.2.9-21_all.deb
  to pool/main/d/db3/db3-doc_3.2.9-21_all.deb
db3_3.2.9-21.diff.gz
  to pool/main/d/db3/db3_3.2.9-21.diff.gz
db3_3.2.9-21.dsc
  to pool/main/d/db3/db3_3.2.9-21.dsc
libdb3++-dev_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3++-dev_3.2.9-21_powerpc.deb
libdb3++c102_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3++c102_3.2.9-21_powerpc.deb
libdb3-dev_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3-dev_3.2.9-21_powerpc.deb
libdb3-tcl_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3-tcl_3.2.9-21_powerpc.deb
libdb3-util_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3-util_3.2.9-21_powerpc.deb
libdb3_3.2.9-21_powerpc.deb
  to pool/main/d/db3/libdb3_3.2.9-21_powerpc.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 291901@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Andreas Barth <aba@not.so.argh.org> (supplier of updated db3 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sat, 29 Jan 2005 22:46:14 +0000
Source: db3
Binary: libdb3++c102 libdb3-util db3-doc libdb3++-dev libdb3-dev libdb3 libdb3-tcl
Architecture: source powerpc all
Version: 3.2.9-21
Distribution: unstable
Urgency: low
Maintainer: Debian Berkeley DB Maintainers <pkg-db-devel@lists.alioth.debian.org>
Changed-By: Andreas Barth <aba@not.so.argh.org>
Description: 
 db3-doc    - Berkeley v3 Database Documentation [html]
 libdb3     - Berkeley v3 Database Libraries [runtime]
 libdb3++-dev - Berkeley v3 Database Libraries for C++ [development]
 libdb3++c102 - Berkeley v3 Database Libraries for C++ [runtime]
 libdb3-dev - Berkeley v3 Database Libraries [development]
 libdb3-tcl - Berkeley v3 Database Libraries for TCL [module]
 libdb3-util - Berkeley v3 Database Utilities
Closes: 266685 283520 291901
Changes: 
 db3 (3.2.9-21) unstable; urgency=low
 .
   * mutexes for mips, arm and amd64, and undo the LD_ASSUME_KERNEL-kludge.
     Thanks to Kurt Roeckx. Closes: #291901, #283520.
   * fix mutexes on hppa. Thanks to Jochen Friedrich. Closes: #266685
Files: 
 d5b3f5d7fb5497f46ca2603437429b15 890 libs optional db3_3.2.9-21.dsc
 b9cedb55c0803e016b0bb95dcb16cd40 49168 libs optional db3_3.2.9-21.diff.gz
 b7a05e689d3db720997332fbd740f559 61162 utils optional libdb3-util_3.2.9-21_powerpc.deb
 32059b79cb6527cac1cac09c02211f7f 246674 libs required libdb3_3.2.9-21_powerpc.deb
 82a7e3724c546ff7dcaf4ef72e811457 326780 libdevel optional libdb3-dev_3.2.9-21_powerpc.deb
 a733f1990c20d7ce8c64aadb52be9874 27200 libs optional libdb3++c102_3.2.9-21_powerpc.deb
 c2fe4ad13c74f482786d1b136b762102 33278 libdevel optional libdb3++-dev_3.2.9-21_powerpc.deb
 18f9b187953df5539bc87d080e206234 280382 interpreters extra libdb3-tcl_3.2.9-21_powerpc.deb
 78e7e74e6425e184ca43ef9f05aeb246 722856 doc extra db3-doc_3.2.9-21_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iEYEARECAAYFAkH8wrgACgkQmdOZoew2oYVuNgCffah6MA8/sqLJQo4GLpWDQpw2
FfgAn0QZeUGpyVyZzXWYQayOoTCuefUf
=wj0t
-----END PGP SIGNATURE-----