NetBSD Problem Report #48980

From www@NetBSD.org  Wed Jul  9 20:11:52 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 84AA5A5672
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  9 Jul 2014 20:11:52 +0000 (UTC)
Message-Id: <20140709201151.53083A6541@mollari.NetBSD.org>
Date: Wed,  9 Jul 2014 20:11:51 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@mylinuxisp.com
To: gnats-bugs@NetBSD.org
Subject: cad/kicad needs newer GCC, build fails on netbsd-5/i386
X-Send-Pr-Version: www-1.0

>Number:         48980
>Category:       pkg
>Synopsis:       cad/kicad needs newer GCC, build fails on netbsd-5/i386
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 09 20:15:00 +0000 2014
>Closed-Date:    Sat Dec 27 02:39:19 +0000 2014
>Last-Modified:  Sat Dec 27 02:39:19 +0000 2014
>Originator:     John D. Baker
>Release:        NetBSD/i386-5.2_STABLE, pkgsrc-2014Q2
>Organization:
>Environment:
NetBSD verthandi.technoskunk.fur 5.2_STABLE NetBSD 5.2_STABLE (VERTHANDI) #17: Wed May 21 19:01:55 CDT 2014  sysop@verthandi.technoskunk.fur:/d0/build/netbsd-5/obj/i386/sys/arch/i386/compile/VERTHANDI i386

>Description:
Building "cad/kicad" from pkgsrc-2014Q2 (also in pkgsrc-2014Q1) with
native gcc 4.1.3 in netbsd-5 fails as follows:

[...]
[ 48%] Built target common
[ 48%] Building CXX object common/CMakeFiles/pcbcommon.dir/__/pcbnew/legacy_plugin.cpp.o
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/common.h: In member function 'int PAGE_INFO::GetWidthIU() const':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/common.h:295: warning: converting to 'int' from 'double'
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/common.h: In member function 'int PAGE_INFO::GetHeightIU() const':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/common.h:296: warning: converting to 'int' from 'double'
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/plot_common.h: In member function 'virtual void HPGL_PLOTTER::SetCurrentLineWidth(int)':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/include/plot_common.h:364: warning: converting to 'int' from 'double'
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp: In member function 'void LEGACY_PLUGIN::loadZONE_CONTAINER()':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp:2282: warning: operation on 'data' may be undefined
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp: In member function 'int LEGACY_PLUGIN::biuSprintf(char*, int) const':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp:2659: error: 'fabsl' was not declared in this scope
*** Error code 1

Stop.
make: stopped in /d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214


Prior to this, there were very many warnings of the type
"warning: converting from 'int' to 'double'" or
"warning: passing 'double' for argument N to "rtype func(arg1, ..., argN, ...)"

Adding "cad/kicad" to packages for which "GCC_REQD+=4.6" is used
eliminated the other warnings, but the build still fails with:

[...]
[ 51%] Building CXX object common/CMakeFiles/pcbcommon.dir/__/pcbnew/legacy_plugin.cpp.o
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp: In member function 'int LEGACY_PLUGIN::biuSprintf(char*, LEGACY_PLUGIN::BIU) const':
/d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214/pcbnew/legacy_plugin.cpp:2659:44: error: 'fabsl' was not declared in this scope
*** Error code 1

Stop.
make: stopped in /d0/build/pkgsrc/cad/kicad/work/kicad-stable-20140214

It seems netbsd-5 "libm" doesn't provide "fabsl()", nor is there a
prototype in "/usr/include/math.h".

As a side note, netbsd-6 does provide "fabsl()", but its synopsis is
missing from "FABS(3)".

I'm certain I'd successfully compiled kicad on netbsd-5/i386 when it
was first imported to pkgsrc-HEAD (pre-pkgsrc-2014Q1?) but I might have
been mistaken (built the version out of "pkgsrc-wip" successfully before
boost-libs problems on netbsd-5).
>How-To-Repeat:
Attempt to build "cad/kicad" from pkgsrc-2014Q2 on netbsd-5/i386 with
native gcc.

Add something like:

  .if "${PKGPATH}" == "cad/kicad"
    GCC_REQD+=4.5   # or later
  .endif

to "/etc/mk.conf", make clean and retry the build.
>Fix:
Hack a local "fabsl()"?

>Release-Note:

>Audit-Trail:
From: "OBATA Akio" <obache@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48980 CVS commit: pkgsrc/devel/boost-libs
Date: Thu, 17 Jul 2014 09:37:26 +0000

 Module Name:	pkgsrc
 Committed By:	obache
 Date:		Thu Jul 17 09:37:26 UTC 2014

 Modified Files:
 	pkgsrc/devel/boost-libs: buildlink3.mk

 Log Message:
 Sync GCC_REQD with meta-pkgs/boost/Makefile.common.

 PR pkg/49000, PR pkg/48981, PR pkg/48980.


 To generate a diff of this commit:
 cvs rdiff -u -r1.32 -r1.33 pkgsrc/devel/boost-libs/buildlink3.mk

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

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48980: cad/kicad needs newer GCC, build fails on netbsd-5/i386
Date: Fri, 18 Jul 2014 07:15:28 -0500 (CDT)

 The recent changes to "devel/boost-libs" cause "cad/kicad" to attempt
 to build "lang/gcc45", so that aspect of this PR has been addressed.

 There remains the issue of missing "fabsl()" in netbsd-5.

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: David Holland <dholland-pbugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48980: cad/kicad needs newer GCC, build fails on
 netbsd-5/i386
Date: Sun, 27 Jul 2014 05:37:31 +0000

 On Fri, Jul 18, 2014 at 12:20:05PM +0000, John D. Baker wrote:
  >  The recent changes to "devel/boost-libs" cause "cad/kicad" to attempt
  >  to build "lang/gcc45", so that aspect of this PR has been addressed.
  >  
  >  There remains the issue of missing "fabsl()" in netbsd-5.

 Unless it's someplace where the extra precision is critical, stuffing
 in #define fabsl fabs should make it build. In cad/ it might be
 something where it's critical, though. (Most of the time, people just
 stuff in long double because they think more precision must be good.)

 -- 
 David A. Holland
 dholland@netbsd.org

From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: pkg/48980: cad/kicad needs newer GCC, build fails on netbsd-5/i386
Date: Sun, 27 Jul 2014 08:16:23 -0500 (CDT)

 On Sun, 27 Jul 2014, David Holland wrote:

 >  Unless it's someplace where the extra precision is critical, stuffing
 >  in #define fabsl fabs should make it build. In cad/ it might be
 >  something where it's critical, though. (Most of the time, people just
 >  stuff in long double because they think more precision must be good.)

 There's only two uses in the entire kicad source tree and both are used
 on variable of type "double" (not "long double"), so it's probably
 not necessary.  The first instance also includes an explanation in a
 comment block in the "else" clause of the comparison in which it's found.

 So changing "fabsl" to "fabs" will likely not hurt anything.  I limited
 the change to "NetBSD-5.*" with:

 +Index: cad/kicad/Makefile
 +===================================================================
 +RCS file: /cvsroot/pkgsrc/cad/kicad/Makefile,v
 +retrieving revision 1.2
 +diff -u -p -r1.2 Makefile
 +--- cad/kicad/Makefile	5 May 2014 00:47:40 -0000	1.2
 ++++ cad/kicad/Makefile	27 Jul 2014 13:14:37 -0000
 +@@ -13,6 +13,7 @@ HOMEPAGE=	http://www.kicad-pcb.org/
 + COMMENT=	Schematic and PCB CAD software (stable branch)
 + LICENSE=	gnu-gpl-v2
 + 
 ++.include "../../mk/bsd.prefs.mk"
 + USE_PKGLOCALEDIR=	yes
 + USE_LANGUAGES=		c c++
 + USE_CMAKE=		yes
 +@@ -37,6 +38,15 @@ SUBST_FILES.macosx=	bitmap2component/CMa
 + 			pcbnew/CMakeLists.txt
 + SUBST_SED.macosx=	-e 's/[[:<:]]MACOSX_BUNDLE[[:>:]]//'
 + 
 ++.if !empty(MACHINE_PLATFORM:MNetBSD-5.*)
 ++SUBST_CLASSES+=		netbsd5
 ++SUBST_STAGE.netbsd5=	post-patch
 ++SUBST_MESSAGE.netbsd5=	Substituting fabs() for fabsl() for NetBSD-5
 ++SUBST_FILES.netbsd5=	pcbnew/legacy_plugin.cpp	\
 ++			tools/test-nm-biu-to-ascii-mm-round-tripping.cpp
 ++SUBST_SED.netbsd5=	-e 's/fabsl/fabs/g'
 ++.endif
 ++
 + .include "../../devel/boost-libs/buildlink3.mk"
 + .include "../../devel/cmake/buildlink3.mk"
 + .include "../../devel/zlib/buildlink3.mk"

 -- 
 |/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
 |\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
 | X  No HTML/proprietary data in email.   BSD just sits there and works!
 |/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645

From: "David A. Holland" <dholland@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/48980 CVS commit: pkgsrc/cad/kicad
Date: Sat, 27 Dec 2014 02:03:19 +0000

 Module Name:	pkgsrc
 Committed By:	dholland
 Date:		Sat Dec 27 02:03:19 UTC 2014

 Modified Files:
 	pkgsrc/cad/kicad: Makefile

 Log Message:
 Fix netbsd-5 build by SUBSTing out fabsl(). From John D. Baker in PR 48980.


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 pkgsrc/cad/kicad/Makefile

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

State-Changed-From-To: open->closed
State-Changed-By: dholland@NetBSD.org
State-Changed-When: Sat, 27 Dec 2014 02:39:19 +0000
State-Changed-Why:
Committed. I changed the STAGE to pre-patch to avoid colliding with
patches (there's a patch for legacy_plugin.cpp) but that shouldn't
make any difference.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.