pkgsrc-Bugs archive

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

Re: pkg/43444: databases/db4 configure failure on netbsd-4@sparc



The following reply was made to PR pkg/43444; it has been noted by GNATS.

From: "John D. Baker" <jdbaker%mylinuxisp.com@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: pkg/43444: databases/db4 configure failure on netbsd-4@sparc
Date: Sun, 2 Oct 2016 22:19:56 -0500 (CDT)

 The original submitter of this PR sent me some patches for "db4" he used
 locally for NetBSD/sparc.  I adapted them to "db5" as well and have been
 using them for quite some time.
 
 For db4:
 
 +--- dbinc/mutex_int.h.orig2	2014-09-07 16:35:52.000000000 -0500
 ++++ dbinc/mutex_int.h	2014-09-07 16:46:39.000000000 -0500
 +@@ -714,14 +714,24 @@ typedef unsigned char tsl_t;
 + 	!__r;								\
 + })
 + 
 ++#if defined (__sparc_v9__)
 + #define	MUTEX_UNSET(tsl)	(*(tsl) = 0, MUTEX_MEMBAR(tsl))
 +-#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
 + #define	MUTEX_MEMBAR(x)	\
 + 	({ __asm__ volatile ("membar #StoreStore|#StoreLoad|#LoadStore"); })
 + #define	MEMBAR_ENTER() \
 + 	({ __asm__ volatile ("membar #StoreStore|#StoreLoad"); })
 + #define	MEMBAR_EXIT() \
 + 	({ __asm__ volatile ("membar #StoreStore|#LoadStore"); })
 ++#else
 ++#define	MUTEX_UNSET(tsl) ({						\
 ++	__asm__ volatile ("stbar");					\
 ++	*(tsl) = 0; })
 ++#define	MUTEX_MEMBAR(x) \
 ++	({ __asm__ volatile ("stbar"); })
 ++#define	MEMBAR_ENTER()
 ++#define	MEMBAR_EXIT()
 ++#endif
 ++#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
 + #endif
 + #endif
 + 
 +--- dist/configure.orig2	2014-09-07 16:35:50.000000000 -0500
 ++++ dist/configure	2014-09-07 16:57:35.000000000 -0500
 +@@ -19257,7 +19257,11 @@ main ()
 + {
 + 
 + 	#if defined(__sparc__) && defined(__GNUC__)
 ++	#if defined(__sparc_v9__)
 + 		asm volatile ("membar #StoreStore|#StoreLoad|#LoadStore");
 ++	#else
 ++		asm volatile ("stbar");
 ++	#endif
 + 		exit(0);
 + 	#else
 + 		FAIL TO COMPILE/LINK
 
 
 For db5:
 
 +--- dist/configure.orig2	2014-09-07 17:21:35.000000000 -0500
 ++++ dist/configure	2014-09-07 17:30:24.000000000 -0500
 +@@ -21444,7 +21444,11 @@ main ()
 + {
 + 
 + 	#if defined(__sparc__) && defined(__GNUC__)
 ++	#if defined(__sparc_v9__)
 + 		asm volatile ("membar #StoreStore|#StoreLoad|#LoadStore");
 ++	#else
 ++		asm volatile ("stbar");
 ++	#endif
 + 		exit(0);
 + 	#else
 + 		FAIL TO COMPILE/LINK
 +--- src/dbinc/mutex_int.h.orig2	2014-09-07 16:35:52.000000000 -0500
 ++++ src/dbinc/mutex_int.h	2014-09-07 16:46:39.000000000 -0500
 +@@ -714,14 +714,24 @@ typedef unsigned char tsl_t;
 + 	!__r;								\
 + })
 + 
 ++#if defined (__sparc_v9__)
 + #define	MUTEX_UNSET(tsl)	(*(tsl) = 0, MUTEX_MEMBAR(tsl))
 +-#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
 + #define	MUTEX_MEMBAR(x)	\
 + 	({ __asm__ volatile ("membar #StoreStore|#StoreLoad|#LoadStore"); })
 + #define	MEMBAR_ENTER() \
 + 	({ __asm__ volatile ("membar #StoreStore|#StoreLoad"); })
 + #define	MEMBAR_EXIT() \
 + 	({ __asm__ volatile ("membar #StoreStore|#LoadStore"); })
 ++#else
 ++#define	MUTEX_UNSET(tsl) ({						\
 ++	__asm__ volatile ("stbar");					\
 ++	*(tsl) = 0; })
 ++#define	MUTEX_MEMBAR(x) \
 ++	({ __asm__ volatile ("stbar"); })
 ++#define	MEMBAR_ENTER()
 ++#define	MEMBAR_EXIT()
 ++#endif
 ++#define	MUTEX_INIT(tsl)         (MUTEX_UNSET(tsl), 0)
 + #endif
 + #endif
 + 
 
 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645
 


Home | Main Index | Thread Index | Old Index