NetBSD Problem Report #30308

From www@netbsd.org  Sun May 22 15:50:52 2005
Return-Path: <www@netbsd.org>
Received: by narn.netbsd.org (Postfix, from userid 31301)
	id AA26763B104; Sun, 22 May 2005 15:50:52 +0000 (UTC)
Message-Id: <20050522155052.AA26763B104@narn.netbsd.org>
Date: Sun, 22 May 2005 15:50:52 +0000 (UTC)
From: joerg@leaf.dragonflybsd.org
Reply-To: joerg@leaf.dragonflybsd.org
To: gnats-bugs@netbsd.org
Subject: conflicting local errno in lang/perl5.8
X-Send-Pr-Version: www-1.0

>Number:         30308
>Category:       pkg
>Synopsis:       conflicting local errno in lang/perl5.8
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jlam
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 22 15:51:00 +0000 2005
>Closed-Date:    Wed Jun 08 19:13:36 +0000 2005
>Last-Modified:  Wed Jun 08 19:13:36 +0000 2005
>Originator:     Jörg Sonnenberger
>Release:        pkgsrc-HEAD
>Organization:
>Environment:
DragonFly britannica.bec.de 1.3.1-DEVELOPMENT DragonFly 1.3.1-DEVELOPMENT #15: Tue May 17 13:31:47 2005     joerg@britannica.bec.de:/home/joerg/wd/DragonFly/world/src/sys/compile/TURTLE  i386

>Description:
The Perl 5.8 source defines errno locally, which conflicts with the definition in errno.h.
>How-To-Repeat:
build in DragonFly HEAD
>Fix:
Add the following patch:

--- ext/SDBM_File/sdbm/sdbm.c.orig      2003-08-27 12:30:22.000000000 +0200
+++ ext/SDBM_File/sdbm/sdbm.c   2005-05-03 10:18:19.000000000 +0200
@@ -36,9 +36,11 @@
  */
 #ifndef WIN32
 #ifndef sun
+#ifndef __STDC__
 extern int errno;
 #endif
 #endif
+#endif

 extern Malloc_t malloc proto((MEM_SIZE));
 extern Free_t free proto((Malloc_t));

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->jlam
Responsible-Changed-By: reed@netbsd.org
Responsible-Changed-When: Wed, 25 May 2005 02:29:29 +0000
Responsible-Changed-Why:
Assigned to maintainer.


From: "Johnny C. Lam" <jlam@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc: joerg@leaf.dragonflybsd.org, pkgsrc-bugs@netbsd.org
Subject: Re: pkg/30308: conflicting local errno in lang/perl5.8
Date: Wed, 8 Jun 2005 07:43:14 +0000

 On Sun, May 22, 2005 at 03:51:00PM +0000, joerg@leaf.dragonflybsd.org wrote:
 > 
 > >Description:
 > The Perl 5.8 source defines errno locally, which conflicts with the definition in errno.h.
 > >How-To-Repeat:
 > build in DragonFly HEAD
 > >Fix:
 > Add the following patch:
 > 
 > --- ext/SDBM_File/sdbm/sdbm.c.orig      2003-08-27 12:30:22.000000000 +0200
 > +++ ext/SDBM_File/sdbm/sdbm.c   2005-05-03 10:18:19.000000000 +0200
 > @@ -36,9 +36,11 @@
 >   */
 >  #ifndef WIN32
 >  #ifndef sun
 > +#ifndef __STDC__
 >  extern int errno;
 >  #endif
 >  #endif
 > +#endif

 I took a closer look at this.  I think the best thing to do in this
 case is to use the same test that's in perl.h, which does:

 	#include <errno.h>
 	#ifndef errno
 	extern int errno;
 	#endif

 While this may not be necessarily correct either, at least it would
 consistent within the Perl sources, and we can wait for something
 better to appear in future Perl versions.  The Configure script implies
 that the Perl maintainers are aware of this problem, and will fix it
 in the future.

 From looking at the CVS logs for src/sys/sys/errno.h for DragonFly,
 it appears that the "errno" is always defined if <errno.h> is included,
 so this test will also work on DragonFly (actually, I notice that your
 commit of revision 1.6 of that file shows awareness of this issue).

 	Cheers,

 	-- Johnny Lam <jlam@NetBSD.org>

From: "Johnny C. Lam" <jlam@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/30308 CVS commit: pkgsrc/lang/perl58
Date: Wed,  8 Jun 2005 08:42:33 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	jlam
 Date:		Wed Jun  8 08:42:33 UTC 2005

 Modified Files:
 	pkgsrc/lang/perl58: distinfo
 Added Files:
 	pkgsrc/lang/perl58/patches: patch-cl

 Log Message:
 SDBM_File/sdbm/sdbm.h explicitly doesn't include perl.h, but fails to
 handle errno in the same way that perl.h does.  The workaround in
 sdbm.c for the mishandling of errno that redeclares errno if WIN32
 and sun are not defined is not correct, as it ends up redeclaring
 errno on just about every platform.  Modify sdbm.c so that it uses
 the same method of handling errno as perl.h for the sake of consistency.
 This fixes PR pkg/30308.


 To generate a diff of this commit:
 cvs rdiff -r1.32 -r1.33 pkgsrc/lang/perl58/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/lang/perl58/patches/patch-cl

 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: jlam@netbsd.org
State-Changed-When: Wed, 08 Jun 2005 18:00:49 +0000
State-Changed-Why:
Please let me know if lang/perl58/patches/patch-cl fixes the build
problem on DragonFly.  Thanks!


From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: "Johnny C. Lam" <jlam@netbsd.org>
Cc: gnats-bugs@netbsd.org, joerg@leaf.dragonflybsd.org,
	pkgsrc-bugs@netbsd.org
Subject: Re: pkg/30308: conflicting local errno in lang/perl5.8
Date: Wed, 8 Jun 2005 20:06:10 +0200

 On Wed, Jun 08, 2005 at 07:43:14AM +0000, Johnny C. Lam wrote:
 > 	#include <errno.h>
 > 	#ifndef errno
 > 	extern int errno;
 > 	#endif
 > 
 > While this may not be necessarily correct either, at least it would
 > consistent within the Perl sources, and we can wait for something
 > better to appear in future Perl versions.  The Configure script implies
 > that the Perl maintainers are aware of this problem, and will fix it
 > in the future.

 That's the same fix as I suggested alternatively to Perl. It's fine
 with me.

 Joerg

State-Changed-From-To: feedback->closed
State-Changed-By: jlam@netbsd.org
State-Changed-When: Wed, 08 Jun 2005 19:13:36 +0000
State-Changed-Why:
PR author confirms fix is appropriate.  Thanks for the PR!


>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.