Subject: pkg/26815: libgcrypt does not compile on Solaris 9
To: None <>
From: None <>
List: pkgsrc-bugs
Date: 08/31/2004 15:17:45
>Number:         26815
>Category:       pkg
>Synopsis:       libgcrypt does not compile on Solaris 9
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 31 15:18:00 UTC 2004
>Originator:     Simon Kuhn
>Release:        pkgsrc HEAD / Solaris 9
SunOS mentok 5.9 Generic_117171-02 sun4u sparc SUNW,Sun-Fire-V240

libgcrypt does not compile due to a missing definition of __udiv_qrnnd. This is defined in mpi/longlong.h, and should in theory be present in libgcc. Upon further research, it seems that this same problem was fixed in gmp in 2001, and the fix seems appropriate here as well.
Attempt to compile on Solaris 9 using GCC 3.3.4.
Apply patch:

--- mpi/longlong.h.orig 2004-08-31 11:08:09.263488000 -0400
+++ mpi/longlong.h
@@ -1133,7 +1133,7 @@ extern USItype __udiv_qrnnd ();
             "rJ" ((USItype)(al)),                                      \
             "rI" ((USItype)(bl))                                       \
-#if defined (__sparc_v8__)
+#if defined (__sparc_v8__) || defined (__sparcv8)
 /* Don't match immediate range because, 1) it is not often useful,
    2) the 'I' flag thinks of the range as a 13 bit signed interval,
    while we want to match a 13 bit interval, sign extended to 32 bits,

as documented at