NetBSD Problem Report #28373

From www@netbsd.org  Sun Nov 21 02:36:09 2004
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id C8C302525DB; Sun, 21 Nov 2004 02:36:09 +0000 (UTC)
Message-Id: <20041121023609.C8C302525DB@narn.netbsd.org>
Date: Sun, 21 Nov 2004 02:36:09 +0000 (UTC)
From: georg.schwarz@freenet.de
Reply-To: georg.schwarz@freenet.de
To: gnats-bugs@netbsd.org
Subject: several problems compiling lang/python23 on IRIX 5.3
X-Send-Pr-Version: www-1.0

>Number:         28373
>Category:       pkg
>Synopsis:       several problems compiling lang/python23 on IRIX 5.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    irix-pkg-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Nov 21 02:37:00 +0000 2004
>Closed-Date:    Mon Nov 02 13:27:38 +0000 2009
>Last-Modified:  Mon Nov 02 13:27:38 +0000 2009
>Originator:     Georg Schwarz
>Release:        current pkgsrc
>Organization:
>Environment:
IRIX lorenz 5.3 08031225 IP20 mips
>Description:
There are several issues with compiling on23 on IRIX 5.3:

- Python 2.3.4 bug ID #1070140: endianness not detected correctly (seems to be fixed with python2.4)
- corresponding issue to pkg/26507
- On IRIX 5.3 /usr/include/sys/types.h contains:

#if ( !defined(_XOPEN_SOURCE) && !defined(_POSIX_SOURCE) ) ||
defined(_BSD_TYPES) || defined(_BSD_COMPAT)
/*
 * Nested include for BSD/sockets source compatibility.
 * (The select macros used to be defined here).
 */
#include <sys/bsd_types.h>
#endif

sys/bsd_types.h however defines u_int.
If _XOPEN_SOURCE is defined (in pyconfig.h) this results in u_int not
being known and the compilation to fail.  

>How-To-Repeat:

>Fix:
The first two issues are fixed by the following patch:

--- Makefile.common.orig        Sat Nov 20 21:00:28 2004
+++ Makefile.common     Sat Nov 20 21:32:28 2004
@@ -29,8 +29,10 @@
 .endif
 PLIST_SRC+=    ${.CURDIR}/../../lang/python23/PLIST.common_end

-.if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix" || ${OPSYS} == "IRIX"
+.if ${OPSYS} == "Darwin" || ${OPSYS} == "Interix"
 PY_PLATNAME=   ${LOWER_OPSYS}
+.elif ${OPSYS} == "IRIX"
+PY_PLATNAME=   ${LOWER_OPSYS:C/\..*//}
 .elif ${OPSYS} == "SunOS"
 PY_PLATNAME=   sunos${OS_VERSION:C/\..*//}
 .else
@@ -37,6 +39,11 @@
 PY_PLATNAME=   ${LOWER_OPSYS}${OS_VERSION:C/\..*//}
 .endif
 PLIST_SUBST+=  PY_PLATNAME=${PY_PLATNAME}
+
+# work around missing sys/endian.h support for IRIX 5.3
+.if ${MACHINE_ARCH} == "mipseb"
+CONFIGURE_ENV+=        ac_cv_c_bigendian="yes"
+.endif

 # the dl module isn't built for 64 bit archs and Darwin
 .if ${MACHINE_ARCH} == "alpha" || ${MACHINE_ARCH} == "amd64" \


The third issue is solved by patching configure as follows:

--- configure.orig      2004-08-08 00:18:33.000000000 +0200
+++ configure   2004-08-08 00:18:59.000000000 +0200
@@ -1466,6 +1466,8 @@
   # has another value. By not (re)defining it, the defaults come in
place.
   AIX/4)
     define_xopen_source=no;;
+  IRIX/5.*)
+    define_xopen_source=no;;
 esac

 if test $define_xopen_source = yes

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->irix-pkg-people
Responsible-Changed-By: ben@netbsd.org
Responsible-Changed-When: Sun, 21 Nov 2004 13:48:42 +0000
Responsible-Changed-Why:
Assigned to irix-pkg-people.


From: Jan Schaumann <jschauma@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/28373 CVS commit: pkgsrc/lang/python23
Date: Wed, 24 Nov 2004 20:45:10 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jschauma
 Date:		Wed Nov 24 20:45:10 UTC 2004

 Modified Files:
 	pkgsrc/lang/python23: Makefile.common PLIST.common distinfo
 Added Files:
 	pkgsrc/lang/python23: PLIST.IRIX
 	pkgsrc/lang/python23/patches: patch-cc patch-cd patch-ce

 Log Message:
 Make this compile, install and deinstall cleanly under IRIX and IRIX64
 version 6.5 by backporting some patches from Python 2.4 and leaving out
 some broken modules.

 This partially addresses PR pkg/28373, too, though fixes particular to
 older Irix versions still need to be tested and added.


 To generate a diff of this commit:
 cvs rdiff -r1.20 -r1.21 pkgsrc/lang/python23/Makefile.common
 cvs rdiff -r0 -r1.1 pkgsrc/lang/python23/PLIST.IRIX
 cvs rdiff -r1.6 -r1.7 pkgsrc/lang/python23/PLIST.common
 cvs rdiff -r1.19 -r1.20 pkgsrc/lang/python23/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/lang/python23/patches/patch-cc \
     pkgsrc/lang/python23/patches/patch-cd \
     pkgsrc/lang/python23/patches/patch-ce

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->feedback
State-Changed-By: jschauma@netbsd.org
State-Changed-When: Wed, 19 Jan 2005 04:23:05 +0000
State-Changed-Why:

Some patches were applied a while ago.
Please update your pkgsrc tree and test again, then let us know.
Thanks.



From: georg.schwarz@freenet.de (Georg Schwarz)
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/28373
Date: Mon, 31 Jan 2005 12:13:53 +0100

 Indeed for python23 the three mentioned issues are no longer present.
 However, there are some other newly-appeared issues, probably related to
 the use of threads:

 As with pkg/27009 on systems with no native socklen_t the pthread header
 typedefs socklen_t. python's configure does not know about this, so it
 detects a missing socklen_t definition and adds its own, which later
 leads to a conflict. The same issue occurs with lang/python24.
 In both cases a fix is to uncoditionally add

 CONFIGURE_ENV+= ac_cv_type_socklen_t="yes"

 On systems where it exists it is true anyway (so it does not hurt), on
 others it is provided by the pthread header.

 Then there's a problem with python23's Python/thread.c: the header files
 which prototype some functions are included only after the actual
 function definition code in Python/thread.c. My cc at least does not
 like this. As a fix (?) I reversed things a bit:

 --- Python/thread.c.orig1       2005-01-30 23:16:23.000000000 +0100
 +++ Python/thread.c     2005-01-30 23:17:58.000000000 +0100
 @@ -35,6 +35,7 @@

  #ifdef __sgi
  #define SGI_THREADS
 +#undef HAVE_PTH
  #endif

  #ifdef HAVE_THREAD_H
 @@ -63,27 +64,6 @@

  static int initialized;

 -static void PyThread__init_thread(void); /* Forward */
 -
 -void PyThread_init_thread(void)
 -{
 -#ifdef Py_DEBUG
 -       char *p = getenv("THREADDEBUG");
 -
 -       if (p) {
 -               if (*p)
 -                       thread_debug = atoi(p);
 -               else
 -                       thread_debug = 1;
 -       }
 -#endif /* Py_DEBUG */
 -       if (initialized)
 -               return;
 -       initialized = 1;
 -       dprintf(("PyThread_init_thread called\n"));
 -       PyThread__init_thread();
 -}
 -
  #ifdef SGI_THREADS
  #include "thread_sgi.h"
  #endif
 @@ -139,6 +119,27 @@
  #endif
  */

 +static void PyThread__init_thread(void); /* Forward */
 +
 +void PyThread_init_thread(void)
 +{
 +#ifdef Py_DEBUG
 +        char *p = getenv("THREADDEBUG");
 +
 +        if (p) {
 +                if (*p)
 +                        thread_debug = atoi(p);
 +                else
 +                        thread_debug = 1;
 +        }
 +#endif /* Py_DEBUG */
 +        if (initialized)
 +                return;
 +        initialized = 1;
 +        dprintf(("PyThread_init_thread called\n"));
 +        PyThread__init_thread();
 +}
 +
  #ifndef Py_HAVE_NATIVE_TLS
  /* If the platform has not supplied a platform specific
     TLS implementation, provide our own.


 As you can see, I in addition undef'd HAVE_PTH, since including both
 pth.h and pthread.h lead e.g. to a duplicate typedef for socklen_t.
 Probably however this should be better solved by other means.

 With python24 I similarly get:

 cc -c  -DNDEBUG -O2 -I/usr/local/pkg/include -I/usr/include
 -I/usr/local/pkg/include -I/usr/include -I/usr/local/pkg/include
 -I/usr/include -I. -I./Include  -DPy_BUILD_CORE -o Python/thread.o
 Python/thread.c
 cfe: Warning 728: ./Include/objimpl.h, line 255: Long double not
 supported; double assumed.
         long double dummy;   
         ^
 cfe: Error:
 /usr/people/schwarz/pkgsrc/lang/python24/work/.buildlink/include/pthread
 .h, line 194: redeclaration of 'socklen_t'; previous declaration at line
 55 in file
 '/usr/people/schwarz/pkgsrc/lang/python24/work/.buildlink/include/pth.h'
  typedef int socklen_t;
  ------------^
 cfe: Error:
 /usr/people/schwarz/pkgsrc/lang/python24/work/.buildlink/include/pthread
 .h, line 196: redeclaration of 'nfds_t'; previous declaration at line 58
 in file
 '/usr/people/schwarz/pkgsrc/lang/python24/work/.buildlink/include/pth.h'
  typedef unsigned long nfds_t;
  ----------------------^


 Last, the endiness detection issue is still present with python24, with
 the originally proposed extra code to Makefile working around it.    


 -- 
 Georg Schwarz    http://home.pages.de/~schwarz/
  georg.schwarz@freenet.de   +49 177 8811442

State-Changed-From-To: feedback->open
State-Changed-By: wiz@netbsd.org
State-Changed-When: Mon, 14 Mar 2005 14:02:44 +0000
State-Changed-Why:
Feedback supplied.


State-Changed-From-To: open->feedback
State-Changed-By: asau@NetBSD.org
State-Changed-When: Tue, 19 May 2009 16:53:08 +0000
State-Changed-Why:
Package was updated, does the problem persist?
Python 2.3 is almost desupported, convert to newer Python, if possible.


State-Changed-From-To: feedback->closed
State-Changed-By: asau@NetBSD.org
State-Changed-When: Mon, 02 Nov 2009 13:27:38 +0000
State-Changed-Why:
No feedback, package was removed from pkgsrc.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.