NetBSD Problem Report #41350

From www@NetBSD.org  Mon May  4 23:34:19 2009
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 882CB63C221
	for <gnats-bugs@gnats.netbsd.org>; Mon,  4 May 2009 23:34:19 +0000 (UTC)
Message-Id: <20090504233419.2B2B863C131@www.NetBSD.org>
Date: Mon,  4 May 2009 23:34:19 +0000 (UTC)
From: hncaldwell@csupomona.edu
Reply-To: hncaldwell@csupomona.edu
To: gnats-bugs@NetBSD.org
Subject: sysutils/coreutils - undefined __builtin_isfinite when linking seq.o
X-Send-Pr-Version: www-1.0

>Number:         41350
>Category:       pkg
>Synopsis:       sysutils/coreutils - undefined __builtin_isfinite when linking seq.o
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 04 23:35:00 +0000 2009
>Closed-Date:    Wed Jul 08 05:35:35 +0000 2009
>Last-Modified:  Wed Jul 08 05:35:35 +0000 2009
>Originator:     Heath Caldwell
>Release:        pkgsrc-2009Q1
>Organization:
California State Polytechnic University, Pomona
>Environment:
SunOS niblet 5.10 Generic_137138-09 i86pc i386 i86pc
>Description:
...
seq.c: In function `scan_arg':
seq.c:154: warning: implicit declaration of function `__builtin_isfinite'
mv -f .deps/seq.Tpo .deps/seq.Po
gcc -std=gnu99  -O -I/usr/pkg/include  -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -Wl,-z,ignore -o seq seq.o ../lib/libco
reutils.a /usr/pkg/lib/libintl.so /usr/pkg/lib/libiconv.so -lc -R/usr/pkg/lib ../lib/libcoreutils.a -lm -lnsl -l
socket
Undefined                       first referenced
 symbol                             in file
__builtin_isfinite                  seq.o
ld: fatal: Symbol referencing errors. No output written to seq
collect2: ld returned 1 exit status
...
>How-To-Repeat:

>Fix:
seq.c has the following in it:

/* Roll our own isfinite rather than using <math.h>, so that we don't
   have to worry about linking -lm just for isfinite.  */
#ifndef isfinite
# define isfinite(x) ((x) * 0 == 0)
#endif

but for some reason they didn't remove the math.h include.  The following patch fixes the problem (it compiles fine with the include removed):

--- src/seq.c.orig  Mon May  4 16:07:31 2009
+++ src/seq.c       Mon May  4 16:08:05 2009
@@ -20,7 +20,6 @@
 #include <getopt.h>
 #include <stdio.h>
 #include <sys/types.h>
-#include <math.h>
 #include <float.h>

 #include "system.h"

>Release-Note:

>Audit-Trail:
From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: pkg/41350
Date: Fri, 8 May 2009 21:38:27 -0500 (CDT)

 Latest code doesn't have that math.h include.
 Several releases of coreutils since our old version.

 Want to try upgrading the pkgsrc to newer coreutils release versus 
 patching old version?

From: "Heath N. Caldwell" <hncaldwell@csupomona.edu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/41350
Date: Tue, 12 May 2009 14:27:05 -0700

 On 2009-05-09 02:40, Jeremy C. Reed wrote:
 > The following reply was made to PR pkg/41350; it has been noted by GNATS.
 > 
 > From: "Jeremy C. Reed" <reed@reedmedia.net>
 > To: gnats-bugs@netbsd.org
 > Cc: 
 > Subject: Re: pkg/41350
 > Date: Fri, 8 May 2009 21:38:27 -0500 (CDT)
 > 
 >  Latest code doesn't have that math.h include.
 >  Several releases of coreutils since our old version.
 >  
 >  Want to try upgrading the pkgsrc to newer coreutils release versus 
 >  patching old version?

 Do you mean that you will put the newer release into pkgsrc-2009Q1, or
 that I should try using the newer one from trunk?

 I would rather it go into pkgsrc-2009Q1, or that we just remain using a
 local patch until a new tag comes out because the way that we are using
 pkgsrc makes it difficult to use packages that aren't in the current
 tag.

 Either way, at least it sounds like it will be fixed once the new tag is
 out.

 Thanks,
 -- 
 Heath Caldwell - hncaldwell@csupomona.edu
 Operating Systems Analyst - California State Polytechnic University, Pomona

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/41350
Date: Sun, 17 May 2009 22:54:05 +0000

 On Tue, May 12, 2009 at 10:45:02PM +0000, Heath N. Caldwell wrote:
  >>  Latest code doesn't have that math.h include.
  >>  Several releases of coreutils since our old version.
  >>  
  >>  Want to try upgrading the pkgsrc to newer coreutils release versus 
  >>  patching old version?
  >  
  >  Do you mean that you will put the newer release into pkgsrc-2009Q1, or
  >  that I should try using the newer one from trunk?

 The one in HEAD isn't any different. I think what Jeremy meant was
 "Want to try to do the pkgsrc upgrade to coreutils-7.x?"

 -- 
 David A. Holland
 dholland@netbsd.org

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/41350 CVS commit: pkgsrc/sysutils/coreutils
Date: Sun, 17 May 2009 23:11:21 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sun May 17 23:11:21 UTC 2009

 Modified Files:
 	pkgsrc/sysutils/coreutils: Makefile distinfo
 Added Files:
 	pkgsrc/sysutils/coreutils/patches: patch-ac

 Log Message:
 Hack around misuse of math.h. From Heath Caldwell in PR 41350.
 Nominally a build fix, but bump PKGREVISION as a precaution.


 To generate a diff of this commit:
 cvs rdiff -u -r1.47 -r1.48 pkgsrc/sysutils/coreutils/Makefile
 cvs rdiff -u -r1.17 -r1.18 pkgsrc/sysutils/coreutils/distinfo
 cvs rdiff -u -r0 -r1.10 pkgsrc/sysutils/coreutils/patches/patch-ac

 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: dholland@NetBSD.org
State-Changed-When: Sun, 17 May 2009 23:22:52 +0000
State-Changed-Why:
Anyhow, I applied your patch - can you confirm that it works so I can
ask to have it pulled up to 2009Q1?


From: "Heath N. Caldwell" <hncaldwell@csupomona.edu>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/41350
Date: Tue, 23 Jun 2009 13:19:46 -0700

 Yes, it works.  Thanks.

 -- 
 Heath Caldwell - hncaldwell@csupomona.edu
 Operating Systems Analyst - California State Polytechnic University, Pomona

State-Changed-From-To: feedback->pending-pullups
State-Changed-By: obache@NetBSD.org
State-Changed-When: Tue, 23 Jun 2009 23:45:42 +0000
State-Changed-Why:
Confirmed fixed in HEAD.


State-Changed-From-To: pending-pullups->closed
State-Changed-By: obache@NetBSD.org
State-Changed-When: Wed, 08 Jul 2009 05:35:35 +0000
State-Changed-Why:
pkgsrc-2009Q2 out.


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