Skip site navigation (1)Skip section navigation (2)
Date:      Sat,  9 Oct 2010 22:44:13 +0200 (CEST)
From:      Koop Mast <kwm@FreeBSD.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/151349: [Patch] security/libgcrypt Fix build with Clang
Message-ID:  <20101009204413.C0D74107BAAC@mail.rainbow-runner.nl>
Resent-Message-ID: <201010092050.o99Ko4Kb057717@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         151349
>Category:       ports
>Synopsis:       [Patch] security/libgcrypt Fix build with Clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 09 20:50:03 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Koop Mast
>Release:        FreeBSD 8.1-RELEASE-p1 amd64
>Organization:
>Environment:
System: FreeBSD hermes.rainbow-runner.nl 8.1-RELEASE-p1 FreeBSD 8.1-RELEASE-p1 #3 r212995: Wed Sep 22 14:19:30 CEST 2010 root@hermes.rainbow-runner.nl:/var/obj/usr/src/sys/Hermes amd64


	
>Description:
	libgcrypt fails to build with clang. This is due to a inline problem
	This is because Gcc defaults to the gnu89 standard and clang to the 
	gnu99 standard. In these standards the inline keyword has different 
	meanings.

	The other build issue is that Clang doesn't like some of the asm
	casts in longlong.h, this patch was adapted from the longlong.h commit
	that want in head for revision 211505 and 211537.
	Submitted by:	Dimitry Andric <dim@FreeBSD.org>
	

	<how to correct or work around the problem, if known (multiple lines)>

--- libgcrypt-clang.diff begins here ---
Index: security/libgcrypt/Makefile
===================================================================
RCS file: /home/pcvs/ports/security/libgcrypt/Makefile,v
retrieving revision 1.44
diff -a -u -r1.44 Makefile
--- security/libgcrypt/Makefile	2 Aug 2009 19:35:29 -0000	1.44
+++ security/libgcrypt/Makefile	9 Oct 2010 20:30:43 -0000
@@ -17,6 +17,7 @@
 
 USE_BZIP2=	yes
 USE_AUTOTOOLS=	libtool:22
+USE_CSTD=	gnu89
 GNU_CONFIGURE=	yes
 CONFIGURE_ENV=	MAKEINFO="makeinfo --no-split"
 USE_LDCONFIG=	yes
Index: security/libgcrypt/files/patch-mpi-longlong.h
===================================================================
RCS file: security/libgcrypt/files/patch-mpi-longlong.h
diff -N security/libgcrypt/files/patch-mpi-longlong.h
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ security/libgcrypt/files/patch-mpi-longlong.h	9 Oct 2010 20:30:43 -0000
@@ -0,0 +1,42 @@
+--- mpi/longlong.h.org	2010-02-22 11:04:43.000000000 +0100
++++ mpi/longlong.h	2010-09-23 17:34:08.000000000 +0200
+@@ -437,8 +437,8 @@ extern USItype __udiv_qrnnd ();
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   __asm__ ("addl %5,%1\n"                                               \
+ 	   "adcl %3,%0"                                                 \
+-	   : "=r" ((USItype)(sh)),                                      \
+-	     "=&r" ((USItype)(sl))                                      \
++	   : "=r" (sh),                                                 \
++	     "=&r" (sl)                                                 \
+ 	   : "%0" ((USItype)(ah)),                                      \
+ 	     "g" ((USItype)(bh)),                                       \
+ 	     "%1" ((USItype)(al)),                                      \
+@@ -446,22 +446,22 @@ extern USItype __udiv_qrnnd ();
+ #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+   __asm__ ("subl %5,%1\n"                                               \
+ 	   "sbbl %3,%0"                                                 \
+-	   : "=r" ((USItype)(sh)),                                      \
+-	     "=&r" ((USItype)(sl))                                      \
++	   : "=r" (sh),                                                 \
++	     "=&r" (sl)                                                 \
+ 	   : "0" ((USItype)(ah)),                                       \
+ 	     "g" ((USItype)(bh)),                                       \
+ 	     "1" ((USItype)(al)),                                       \
+ 	     "g" ((USItype)(bl)))
+ #define umul_ppmm(w1, w0, u, v) \
+   __asm__ ("mull %3"                                                    \
+-	   : "=a" ((USItype)(w0)),                                      \
+-	     "=d" ((USItype)(w1))                                       \
++	   : "=a" (w0),                                                 \
++	     "=d" (w1)                                                  \
+ 	   : "%0" ((USItype)(u)),                                       \
+ 	     "rm" ((USItype)(v)))
+ #define udiv_qrnnd(q, r, n1, n0, d) \
+   __asm__ ("divl %4"                                                    \
+-	   : "=a" ((USItype)(q)),                                       \
+-	     "=d" ((USItype)(r))                                        \
++	   : "=a" (q),                                                  \
++	     "=d" (r)                                                   \
+ 	   : "0" ((USItype)(n0)),                                       \
+ 	     "1" ((USItype)(n1)),                                       \
+ 	     "rm" ((USItype)(d)))
--- libgcrypt-clang.diff ends here ---


>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20101009204413.C0D74107BAAC>