NetBSD Problem Report #48767
From www@NetBSD.org Mon Apr 28 15:58:03 2014
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
by mollari.NetBSD.org (Postfix) with ESMTPS id 5A879A583D
for <gnats-bugs@gnats.NetBSD.org>; Mon, 28 Apr 2014 15:58:03 +0000 (UTC)
Message-Id: <20140428155801.D706CA5849@mollari.NetBSD.org>
Date: Mon, 28 Apr 2014 15:58:01 +0000 (UTC)
From: jdbaker@mylinuxisp.com
Reply-To: jdbaker@consolidated.net
To: gnats-bugs@NetBSD.org
Subject: nearbyint() and friends missing on macppc (others?)
X-Send-Pr-Version: www-1.0
>Number: 48767
>Notify-List: jdbaker@consolidated.net
>Category: lib
>Synopsis: nearbyint() and friends missing on macppc (others?)
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: lib-bug-people
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Apr 28 16:00:00 +0000 2014
>Closed-Date: Mon Sep 09 14:02:49 +0000 2019
>Last-Modified: Mon Sep 09 14:02:49 +0000 2019
>Originator: John D. Baker
>Release: NetBSD/macppc-6.99.40, pkgsrc-2014Q1
>Organization:
>Environment:
NetBSD sawtooth.technoskunk.fur 6.99.40 NetBSD 6.99.40 (GENERIC) #2: Wed Apr 23 13:15:38 CDT 2014 sysop@verthandi.technoskunk.fur:/d0/build/current/obj/macppc/sys/arch/macppc/compile/GENERIC macppc
>Description:
macppc lacks implementation of "nearbyint{,f,l}()" functions in "-lm"
so x11/gtk3 defines its own in "${WRKSRC}/gtk/fallback-c89.c". As the
local function is declared to be "static", gcc (4.5.4) complains about
the conflict with the prior non-static prototype in <math.h>. As a
result, building x11/gtk3 on macppc fails.
The naive patch, removing the "static" storage class, is insufficient
as it creates multiple definitions of the function when linking the
intermediate object files.
>How-To-Repeat:
Observed while attempting to build x11/gtk3 on macppc-6.99.40 (other
ports/versions?).
Also, on macppc:
$ nm /lib/libm.so | grep nearby
$
Compare from i386:
$ nm /lib/libm.so | grep nearby
000135b8 T nearbyint
000135fc T nearbyintf
0001363a T nearbyintl
&
>Fix:
Ports that lack them should grow implementations of missing, yet
prototyped, functions.
>Release-Note:
>Audit-Trail:
From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48767: nearbyint() and friends missing on macppc (others?)
Date: Mon, 28 Apr 2014 20:24:18 +0200
On Mon, Apr 28, 2014 at 04:00:01PM +0000, jdbaker@mylinuxisp.com wrote:
> >Fix:
> Ports that lack them should grow implementations of missing, yet
> prototyped, functions.
The easy way to ensure this is to have a test case for these functions -
this will break the build for architectures not implementing them.
Martin
From: Joerg Sonnenberger <joerg@britannica.bec.de>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48767: nearbyint() and friends missing on macppc (others?)
Date: Mon, 28 Apr 2014 20:59:14 +0200
On Mon, Apr 28, 2014 at 04:00:01PM +0000, jdbaker@mylinuxisp.com wrote:
> >Fix:
> Ports that lack them should grow implementations of missing, yet
> prototyped, functions.
Add s_nearbyint.c or so to the correct line in the maze of
architecture ifs?
Joerg
From: "John D. Baker" <jdbaker@mylinuxisp.com>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48767: nearbyint() and friends missing on macppc (others?)
Date: Tue, 29 Apr 2014 16:53:14 -0500 (CDT)
On Mon, 28 Apr 2014, Joerg Sonnenberger wrote:
> Add s_nearbyint.c or so to the correct line in the maze of
> architecture ifs?
Apparently, it's more involved than that. While the implementation is
essentially a wrapper arount "rint()", the use of "f{g,s}etenv()" entails
incuding "fenv.h" (and presumedly a corresponding architecture-specific
"fenv.c" file) which is not (yet) implemented for powerpc (among others).
For my immediate needs w.r.t building "x11/gtk3" on macppc, I replaced
their static function with a macro that simply defined "nearbyint" as
"rint". It built. I have not yet tried running the applications which
depended on gtk3.
--
|/"\ 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: coypu@sdf.org
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48767: nearbyint() and friends missing on macppc (others?)
Date: Sat, 2 Dec 2017 01:21:22 +0000
This has been recently fixed and we have a test case for it (it checks
if fenv exists, but I think only vax is left without one).
From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: lib/48767: nearbyint() and friends missing on macppc (others?)
Date: Wed, 6 Dec 2017 01:20:43 +0000
On Sat, Dec 02, 2017 at 01:25:01AM +0000, coypu@sdf.org wrote:
> This has been recently fixed and we have a test case for it (it checks
> if fenv exists, but I think only vax is left without one).
Does that mean the PR can be closed?
--
David A. Holland
dholland@netbsd.org
State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 09 Sep 2019 14:02:49 +0000
State-Changed-Why:
A test now checks that nearbyint is available on most architectures, so it should be available.
>Unformatted:
(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.