pkgsrc-Bugs archive

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

pkg/38364: Patches to allow gmp to build on IRIX

>Number:         38364
>Category:       pkg
>Synopsis:       Patches to allow gmp to build on IRIX
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 04 17:05:01 +0000 2008
>Originator:     Stuart Shelton
>Release:        pkgsrc latest from CVS
IRIX64 octane 6.5 07202013 IP30; IRIX 6.5.30; MIPSpro Compilers Version 7.4.4m

The following patches allow gmp to build and test successfully on IRIX:

---        2007-12-17 11:49:07.703764040 +0000
+++        2007-12-17 11:53:25.932823000 +0000
@@ -1542,6 +1542,7 @@
 # $abilist is restricted to just that choice.
 if test -n "$ABI"; then
+  if test "$ABI" = "32"; then ABI=n32; fi
   for abi in $abilist; do
     if test $abi = "$ABI"; then found=yes; break; fi

--- gmp-impl.h  2007-08-30 19:31:40.000000000 +0100
+++ gmp-impl.h        2007-12-17 18:42:57.675916520 +0000
@@ -189,6 +189,9 @@
 /* gmp_uint_least32_t is an unsigned integer type with at least 32 bits. */
+#ifdef __sgi
+typedef unsigned int            uint_least32_t;
 typedef uint_least32_t      gmp_uint_least32_t;

--- gmp.h       2007-12-17 18:57:17.066264600 +0000
+++ gmp.h     2007-12-17 18:42:57.674573960 +0000
@@ -348,6 +348,9 @@
    application uses for gmp_vprintf etc will almost certainly require the
    whole <stdarg.h> or <varargs.h> anyway.  */
+#ifdef __sgi
+typedef char *va_list;
 #ifdef va_start
 #define _GMP_H_HAVE_VA_LIST 1
@@ -516,9 +519,11 @@
 #if defined (__cplusplus)
 extern "C" {
+#ifndef __sgi
 #ifdef _GMP_H_HAVE_FILE
 using std::FILE;
 #define mp_set_memory_functions __gmp_set_memory_functions


uint_least32_t is defined in <stdint.h> (which is C(99) only) but not any C++ 
headers.  However, 'configure' runs it's tests against $CC rather than $CXX 
(presumably assuming that they are front-ends to identical compilers) and so 
the build thinks that HAVE_UINT_LEAST32_T is defined.  <stdint.h> does defined 
uint_least32_t as above.

I have no idea at all why va_list has to be defined: If you don't define it, 
the build fails saying that va_list is an unknown identifier... but if you do 
define it (as above) you get a warning that you're redefining an existing value!


(This is almost always the case for C++ builds - va_list issues such as this 
seem to occur whenever it is used)

Home | Main Index | Thread Index | Old Index