Subject: pkg/28575: fixing build error of mail/evolution-data-server in amd64
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <yui@yui.pe.kr>
List: pkgsrc-bugs
Date: 12/07/2004 16:24:00
>Number:         28575
>Category:       pkg
>Synopsis:       fixing build error of mail/evolution-data-server in amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 07 16:24:00 +0000 2004
>Originator:     Kibum Han
>Release:        NetBSD 2.99.11
>Organization:
n/a
>Environment:
NetBSD caspar.wowdns.com 2.99.11 NetBSD 2.99.11 (YUIKERNEL) #2: Mon Dec  6 15:33:45 KST 2004  root@caspar.wowdns.com:/usr/obj/sys/arch/amd64/compile/YUIKERNEL amd64
>Description:
Currunt mail/evolution-data-server has a simple mistake.
There is duplicated declarations like followings:

-----------
#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
typedef unsigned char tsl_t;
...
#endif

#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
typedef unsigned char tsl_t;
...
#endif
------------

Simply getting rid of one declaration will be fine.
Patch attached.

>How-To-Repeat:
cd /usr/pkgsrc/mail/evolution-data-server; make
>Fix:
$NetBSD$

--- libdb/dbinc/mutex.h.orig    2004-12-08 00:51:53.000000000 +0900
+++ libdb/dbinc/mutex.h
@@ -729,31 +729,6 @@ typedef unsigned char tsl_t;
 #endif

 /*********************************************************************
- * amd64/gcc assembly.
- *********************************************************************/
-#ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY
-typedef unsigned char tsl_t;
-
-#ifdef LOAD_ACTUAL_MUTEX_CODE
-/*
- * For gcc/amd64, 0 is clear, 1 is set.
- */
-#define  MUTEX_SET(tsl) ({           \
-       register tsl_t *__l = (tsl);          \
-       int __r;              \
-       asm volatile("mov $1,%%rax; lock; xchgb %1,%%al; xor $1,%%rax"\
-               : "=&a" (__r), "=m" (*__l)          \
-               : "1" (*__l)            \
-               );                \
-       __r & 1;              \
-})
-
-#define  MUTEX_UNSET(tsl)  (*(tsl) = 0)
-#define  MUTEX_INIT(tsl)   MUTEX_UNSET(tsl)
-#endif
-#endif
-
-/*********************************************************************
  * x86_64/gcc assembly.
  *********************************************************************/
 #ifdef HAVE_MUTEX_X86_64_GCC_ASSEMBLY