NetBSD Problem Report #37564

From martin@duskware.de  Tue Dec 18 16:25:59 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 22EFD63B8A2
	for <gnats-bugs@gnats.netbsd.org>; Tue, 18 Dec 2007 16:25:59 +0000 (UTC)
Message-Id: <20071218132229.9E15E63B8A2@narn.NetBSD.org>
Date: Tue, 18 Dec 2007 13:22:29 +0000 (UTC)
From: srxshelton@gmail.com
Reply-To: srxshelton@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: devel/gmp-4.4.2 clashes with pkgsrc ABI variable
X-Send-Pr-Version: www-1.0

>Number:         37564
>Category:       pkg
>Synopsis:       devel/gmp-4.4.2 clashes with pkgsrc ABI variable
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    irix-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Dec 18 16:30:00 +0000 2007
>Closed-Date:    Sat Jul 21 21:36:41 +0000 2018
>Last-Modified:  Sat Jul 21 21:36:41 +0000 2018
>Originator:     Stuart Shelton
>Release:        n/a - pkgsrc lastest from CVS
>Organization:
>Environment:
IRIX64 octane 6.5 07202013 IP30; IRIX 6.5.30f; MIPSpro 7.4.4m
>Description:

When ABI is set to '32' in /etc/mk.conf, transform_mipspro_cc adds "-n32" to CFLAGS.

However, in the gmp-4.2.2 package's Makefile is the conditional:

.if ${OPSYS} == "IRIX" && !empty(ABI)
ABI= o32
.endif

... which results in the compiler being passed "-n32" (from my default CFLAGS) and "-o32" (from transform_mipspro_cc) - which causes the compiler to abort with an error.

Surely, the check should be for 'empty(ABI)' rather than '!empty(ABI)' - why redefine the ABI to be different to every other package on the system (something which the bootstrap README expressly forbades), but only if it *is* already set?
>How-To-Repeat:

gmp's config.log contains:

User:
ABI=o32
CC=cc
CFLAGS=-c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -o32
CPPFLAGS=-I/usr/bsd/include -D__inline__=inline
MPN_PATH=
GMP:
abilist=n32 64 o32
cclist=gcc cc
configure:4288: cc -c conftest.c >&5
cc-1020 cc: ERROR File = conftest.c, Line = 2
  The identifier "choke" is undefined.

    choke me
    ^

cc-1065 cc: ERROR at end of source
  A semicolon is expected at this point.


2 errors detected in the compilation of "conftest.c".
configure:4291: $? = 2
configure:4310: cc 2>&1 | grep xlc >/dev/null
configure:4313: $? = 1
configure:4367: checking compiler cc -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -o32 -I/usr/bsd/include -D__inline__=inline
Test compile:
configure:4381: cc -c99 -O2 -n32 -mips4 -r14000 -apo -float_const -use_readonly_const -TARG:isa=mips4:platform=ip30:processor=r14000 -TENV:zeroinit_in_bss=ON -OPT:fast_io=ON:Olimit=8192:reorg_common=ON:swp=ON -LNO:auto_dist=ON:fusion_peeling_limit=8:gather_scatter=2 -woff 1174,1183,1185,1552,3970,3968 -o32 -I/usr/bsd/include -D__inline__=inline conftest.c >&5
ERROR: [transform-mipspro-cc] Wrong ABI argument -n32 for ABI o32.
configure:4384: $? = 1
failed program was:

int main () { return 0; }
configure:5390: result: no
configure:5628: error: could not find a working compiler, see config.log for details

>Fix:

Changing the sense of the conditional actually results in:

configure: error: ABI=32 is not among the following valid choices: n32 64 o32
*** Error code 1

... so gmp's configure's use of the variable ABI is at odds with the pkgsrc convention of using '32' as the ABI value for 'n32' binaries.

This should be patched and fixed - because this package is actually impossible to compile: If the value of ABI is changed to 'n32' (as the package expects) then transform-mipspro-cc rejects it.

I have got gmp to compile successfully with the following patches:

--- configure.in        2007-12-17 11:49:07.703764040 +0000
+++ configure.in        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
   found=no
   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
+++ /usr/bsd/src/devel/gmp/irix-fixes/gmp-impl.h        2007-12-17 18:42:57.675916520 +0000
@@ -189,6 +189,7 @@

 /* gmp_uint_least32_t is an unsigned integer type with at least 32 bits. */
 #if HAVE_UINT_LEAST32_T
+typedef unsigned int            uint_least32_t;
 typedef uint_least32_t      gmp_uint_least32_t;
 #else
 #if SIZEOF_UNSIGNED_SHORT >= 4
--- gmp.h       2007-12-17 18:57:17.066264600 +0000
+++ /usr/bsd/src/devel/gmp/irix-fixes/gmp.h     2007-12-17 18:42:57.674573960 +0000
@@ -348,6 +348,7 @@
    application uses for gmp_vprintf etc will almost certainly require the
    whole <stdarg.h> or <varargs.h> anyway.  */

+typedef char *va_list;
 #ifdef va_start
 #define _GMP_H_HAVE_VA_LIST 1
 #endif
@@ -516,10 +517,12 @@

 #if defined (__cplusplus)
 extern "C" {
+#if 0
 #ifdef _GMP_H_HAVE_FILE
 using std::FILE;
 #endif
 #endif
+#endif

 #define mp_set_memory_functions __gmp_set_memory_functions
 __GMP_DECLSPEC void mp_set_memory_functions __GMP_PROTO ((void *(*) (size_t),

... I'm not sure why the last two should be required, and someone with more skill than me should probably take a look in order to fix these properly... in both cases (va_list and uint_least32_t), the code won't compile without the extra definitions but complain about them being multiply defined if included as above!

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->irix-pkg-people
Responsible-Changed-By: snj@netbsd.org
Responsible-Changed-When: Thu, 20 Dec 2007 00:23:24 +0000
Responsible-Changed-Why:
IRIXish problem.


State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Sat, 21 Jul 2018 21:36:41 +0000
State-Changed-Why:
Should be fixed by:
revision 1.50
date: 2008-03-11 20:47:40 +0200;  author: tnn;  state: Exp;  lines: +2 -2;
Put back a couple of IRIX conditionals the way they used to behave,
e.g. match IRIX 5.x but not 6.x. Some of these may indeed apply to 6.x
too, but let's be conservative. PR pkg/38224.


which means the o32 logic is only for irix 5.
Not putting very old package bugs in feedback, feel free to report new bugs if you have issues currently!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.