NetBSD Problem Report #56892

From  Sun Jun 19 17:21:51 2022
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 674BA1A921F
	for <>; Sun, 19 Jun 2022 17:21:51 +0000 (UTC)
Message-Id: <>
Date: Sun, 19 Jun 2022 19:21:47 +0200 (CEST)
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
	I try...
System: NetBSD 9.99.97 NetBSD 9.99.97 (MALUS) #22: Wed Jun  8 19:40:53 CEST 2022 macppc
Architecture: powerpc
Machine: macppc

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

	Perhaps move those definitions outside of the ifdef, or remove
	the ifdef entirely?

From: Taylor R Campbell <>
Cc: Havard Eidnes <>
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 <>
Subject: Re: port-powerpc/56892: powerpc ieeefp.h fails if _ISOC99_SOURCE
 is defined
Date: Mon, 20 Jun 2022 16:00:14 +0200 (CEST)


 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=
                  from /usr/pkgsrc/math/py-scipy/work/.buildlink/include=
                  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:

 #include <ieeefp.h>  /* needed for 'finite' declaration on some platfor=
 ms */

 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

 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/ 2022-05-16 12:36:53.864307900 +=
 +++ ./scipy/stats/_unuran/
 @@ -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.


 - H=E5vard

From: "Havard Eidnes" <>
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:

 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.


 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 \

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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.