NetBSD Problem Report #56892
From he@smistad.uninett.no Sun Jun 19 17:21:51 2022
Return-Path: <he@smistad.uninett.no>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
by mollari.NetBSD.org (Postfix) with ESMTPS id 674BA1A921F
for <gnats-bugs@gnats.NetBSD.org>; Sun, 19 Jun 2022 17:21:51 +0000 (UTC)
Message-Id: <20220619172147.0A87943F4E0@smistad.uninett.no>
Date: Sun, 19 Jun 2022 19:21:47 +0200 (CEST)
From: he@NetBSD.org
Reply-To: he@NetBSD.org
To: gnats-bugs@NetBSD.org
Subject: powerpc ieeefp.h fails if _ISOC99_SOURCE is defined
X-Send-Pr-Version: 3.95
>Number: 56892
>Category: port-powerpc
>Synopsis: powerpc ieeefp.h fails if _ISOC99_SOURCE is defined
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: port-powerpc-maintainer
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun Jun 19 17:25:00 +0000 2022
>Last-Modified: Sat Jul 30 16:15:01 +0000 2022
>Originator: Havard Eidnes
>Release: NetBSD 9.99.97
>Organization:
I try...
>Environment:
System: NetBSD malus.urc.uninett.no 9.99.97 NetBSD 9.99.97 (MALUS) #22: Wed Jun 8 19:40:53 CEST 2022 he@malus.urc.uninett.no:/usr/obj/sys/arch/macppc/compile/MALUS macppc
Architecture: powerpc
Machine: macppc
>Description:
>How-To-Repeat:
Try to build mach/py-scipy from pkgsrc, watch it fail with
/usr/include/ieeefp.h:15:9: error: unknown type name 'fp_rnd'
15 | typedef fp_rnd fp_rnd_t;
| ^~~~~~
/usr/include/ieeefp.h:19:9: error: unknown type name 'fp_except'
19 | typedef fp_except fp_except_t;
| ^~~~~~~~~
For some reason, the build is done with -D_ISOC99_SOURCE.
However, some folks told me that these parts of the float
implementation is supposed to be part of ISO C99. However,
/usr/include/powerpc/ieeefp.h contains
#if !defined(_ISOC99_SOURCE)
typedef int fp_except;
and the fp_rnd define is similarly protected.
The amd64 version of that file does not have this ifdef around
these definitions.
Not entirely sure who is right or wrong...
>Fix:
Perhaps move those definitions outside of the ifdef, or remove
the ifdef entirely?
>Audit-Trail:
From: Taylor R Campbell <riastradh@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: Havard Eidnes <he@NetBSD.org>
Subject: Re: port-powerpc/56892: powerpc ieeefp.h fails if _ISOC99_SOURCE is defined
Date: Sun, 19 Jun 2022 19:15:58 +0000
I gather that _ISOC99_SOURCE is supposed to mean `please expose only
C99 declarations and nothing else' (not sure how widely supported this
is or whether it's supposed to be different from -std=c99). But
ieeefp.h, fp_except, and fp_rnd are not part of C99.
How does scipy come to include ieeefp.h? If it's trying to use strict
C99, it shouldn't touch ieeefp.h -- if anything, it should use fenv.h.
From: Havard Eidnes <he@NetBSD.org>
To: gnats-bugs@netbsd.org
Cc:
Subject: Re: port-powerpc/56892: powerpc ieeefp.h fails if _ISOC99_SOURCE
is defined
Date: Mon, 20 Jun 2022 16:00:14 +0200 (CEST)
So,
a bit more information about where the include of <ieeefp.h>
comes from:
In file included from /usr/pkgsrc/math/py-scipy/work/.buildlink/include=
/python3.9/pyport.h:202,
from /usr/pkgsrc/math/py-scipy/work/.buildlink/include=
/python3.9/Python.h:50,
from scipy/stats/_unuran/unuran_wrapper.c:6:
/usr/include/ieeefp.h:15:9: error: unknown type name 'fp_rnd'
15 | typedef fp_rnd fp_rnd_t;
| ^~~~~~
/usr/include/ieeefp.h:19:9: error: unknown type name 'fp_except'
19 | typedef fp_except fp_except_t;
| ^~~~~~~~~
unuran_wrapper.c line 6:
#include "Python.h"
Python.h line 50:
#include "pyport.h"
and around line 202 of pyport.h:
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h> /* needed for 'finite' declaration on some platfor=
ms */
#endif
and that file will fail to build on NetBSD/powerpc with the above
errors if _ISOC99_SOURCE is defined at that point, causing those
types to not be defined.
I'm currently building py-scipy with python 3.9 with this patch added:
------------------------------ snip
$NetBSD$
On NetBSD/powerpc, you can't build with _ISOC99_SOURCE defined,
the include of <ieeefp.h> in the python headers will fail with
undefined types.
--- ./scipy/stats/_unuran/setup.py.orig 2022-05-16 12:36:53.864307900 +=
0000
+++ ./scipy/stats/_unuran/setup.py
@@ -95,7 +95,6 @@ def configuration(parent_package=3D"", top
("UNUR_ENABLE_INFO", "1"),
("VERSION", '"%s"' % UNURAN_VERSION),
("HAVE_CONFIG_H", "1"),
- ("_ISOC99_SOURCE", "1"),
]
=
UNURAN_DIRS =3D [
------------------------------ snip
...and with that the build of py-scipy completes.
Regards,
- H=E5vard
From: "Havard Eidnes" <he@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:
Subject: PR/56892 CVS commit: pkgsrc/math/py-scipy
Date: Sat, 30 Jul 2022 16:13:48 +0000
Module Name: pkgsrc
Committed By: he
Date: Sat Jul 30 16:13:48 UTC 2022
Modified Files:
pkgsrc/math/py-scipy: Makefile distinfo
Added Files:
pkgsrc/math/py-scipy/patches: patch-scipy_stats__unuran_setup.py
Log Message:
math/py-scipy: fix build on NetBSD/powerpc (at least!)
In the unuran part, omit defining _ISOC99_SOURCE. I am told that
the ieeefp.h header should not be used with _ISOC99_SOURCE. (Its
use comes from pyport.h.) Lately I've seen this package fail to
build also for aarch64, have not verified that this fixes it, though
it's not entirely impossible.
Fixes what triggered PR#56892.
Bump PKGREVISION.
To generate a diff of this commit:
cvs rdiff -u -r1.59 -r1.60 pkgsrc/math/py-scipy/Makefile
cvs rdiff -u -r1.36 -r1.37 pkgsrc/math/py-scipy/distinfo
cvs rdiff -u -r0 -r1.1 \
pkgsrc/math/py-scipy/patches/patch-scipy_stats__unuran_setup.py
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
(Contact us)
$NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.