Debian Bug report logs - #686402
kfreebsd-kernel-headers: several headers assume _BSD_SOURCE

version graph

Package: kfreebsd-kernel-headers; Maintainer for kfreebsd-kernel-headers is GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>; Source for kfreebsd-kernel-headers is src:kfreebsd-kernel-headers.

Reported by: "Aaron M. Ucko" <ucko@debian.org>

Date: Sat, 1 Sep 2012 00:15:02 UTC

Severity: important

Tags: patch

Found in version kfreebsd-kernel-headers/0.82

Reply or subscribe to this bug.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, ucko@debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#686402; Package kfreebsd-kernel-headers. (Sat, 01 Sep 2012 00:15:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Aaron M. Ucko" <ucko@debian.org>:
New Bug report received and forwarded. Copy sent to ucko@debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Sat, 01 Sep 2012 00:15:04 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: "Aaron M. Ucko" <ucko@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: kfreebsd-kernel-headers: several headers assume _BSD_SOURCE
Date: Fri, 31 Aug 2012 20:13:39 -0400
Package: kfreebsd-kernel-headers
Version: 0.82
Severity: important

ITK's (presumably patched) copy of HDF5 fails to build on kFreeBSD
because it builds with -std=c99, disabling the usual implicit
_BSD_SOURCE setting and types such as u_long and u_char:

In file included from /usr/include/sys/proc.h:45:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/sys/filedesc.h:58:2: error: unknown type name 'u_long'
In file included from /usr/include/sys/proc.h:54:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/sys/runq.h:66:51: error: unknown type name 'u_char'
/usr/include/sys/runq.h:69:48: error: unknown type name 'u_char'
In file included from /usr/include/sys/proc.h:58:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/sys/signalvar.h:56:2: error: unknown type name 'sig_t'
/usr/include/sys/signalvar.h:219:2: error: unknown type name 'siginfo_t'
In file included from /usr/include/sys/proc.h:60:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/sys/kern/time.h: In function 'bintime2timespec':
/usr/include/sys/kern/time.h:133:4: error: dereferencing pointer to incomplete type
/usr/include/sys/kern/time.h:134:4: error: dereferencing pointer to incomplete type
/usr/include/sys/kern/time.h: In function 'timespec2bintime':
/usr/include/sys/kern/time.h:141:14: error: dereferencing pointer to incomplete type
/usr/include/sys/kern/time.h:143:15: error: dereferencing pointer to incomplete type
In file included from /usr/include/sys/proc.h:65:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/i386-kfreebsd-gnu/sys/ucontext.h: At top level:
/usr/include/i386-kfreebsd-gnu/sys/ucontext.h:42:5: error: unknown type name 'stack_t'
In file included from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5private.h:158:0,
                 from /.../insighttoolkit4-4.2.0/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5make_libsettings.c:46:
/usr/include/sys/proc.h:261:2: error: unknown type name 'stack_t'

Could you please ensure that headers refer to nonstandard typedefs
with leading double underscores, as (e.g.) __u_long?

Thanks!



Added indication that 686402 affects src:insighttoolkit4 Request was from "Aaron M. Ucko" <ucko@debian.org> to control@bugs.debian.org. (Sat, 01 Sep 2012 00:36:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#686402; Package kfreebsd-kernel-headers. (Sat, 27 Oct 2012 14:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Steve M. Robbins" <steve@sumost.ca>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Sat, 27 Oct 2012 14:09:03 GMT) Full text and rfc822 format available.

Message #12 received at 686402@bugs.debian.org (full text, mbox):

From: "Steve M. Robbins" <steve@sumost.ca>
To: 686402@bugs.debian.org
Subject: Reproduce method
Date: Sat, 27 Oct 2012 09:04:56 -0500
[Message part 1 (text/plain, inline)]
Hi,

I'd like to emphasize that this bug is more widespread than simply the ITK build and that it's trivial to reproduce:

smr@asdfasdf:~$ cat foo.c 
#include <sys/filedesc.h>

void foo()
{
}

smr@asdfasdf:~$ gcc -c foo.c
smr@asdfasdf:~$ gcc -c -std=c99 foo.c
In file included from /usr/include/sys/filedesc.h:38,
                 from foo.c:1:
/usr/include/sys/event.h:62: error: expected specifier-qualifier-list before ‘u_short’
In file included from /usr/include/sys/lock.h:37,
                 from /usr/include/sys/filedesc.h:39,
                 from foo.c:1:
/usr/include/sys/_lock.h:36: error: expected specifier-qualifier-list before ‘u_int’
In file included from /usr/include/sys/filedesc.h:39,
                 from foo.c:1:
/usr/include/sys/lock.h:61: error: expected specifier-qualifier-list before ‘u_int’
In file included from /usr/include/sys/filedesc.h:40,
                 from foo.c:1:
/usr/include/sys/priority.h:124: error: expected specifier-qualifier-list before ‘u_char’
In file included from foo.c:1:
/usr/include/sys/filedesc.h:58: error: expected specifier-qualifier-list before ‘u_long’

[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#686402; Package kfreebsd-kernel-headers. (Mon, 24 Dec 2012 00:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Mon, 24 Dec 2012 00:57:03 GMT) Full text and rfc822 format available.

Message #17 received at 686402@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: "Steve M. Robbins" <steve@sumost.ca>, 686402@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug#686402: kfreebsd-kernel-headers: several headers assume _BSD_SOURCE
Date: Mon, 24 Dec 2012 00:54:54 +0000
user debian-bsd@lists.debian.org
usertags 686402 kfreebsd
tags 686402 + patch
thanks

--- kfreebsd-9-9.0.orig/sys/sys/filedesc.h      2011-08-11 13:30:23.000000000 +0100
+++ kfreebsd-9-9.0/sys/sys/filedesc.h   2012-12-24 00:48:21.750672610 +0000
@@ -45,7 +45,7 @@
  * This structure is used for the management of descriptors.  It may be
  * shared by multiple processes.
  */
-#define NDSLOTTYPE     u_long
+#define NDSLOTTYPE     __u_long
 
 struct filedesc {
    struct      file **fd_ofiles;       /* file structures for open files */

This change looks okay to me, though something like this is probably not okay
during freeze and should wait until after Wheezy release.

insighttoolkit4 has other issues preventing Wheezy transition.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org



Added tag(s) patch. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Mon, 24 Dec 2012 00:57:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#686402; Package kfreebsd-kernel-headers. (Mon, 24 Dec 2012 22:51:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Mon, 24 Dec 2012 22:51:03 GMT) Full text and rfc822 format available.

Message #24 received at 686402@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: "Steve M. Robbins" <steve@sumost.ca>, 686402@bugs.debian.org
Cc: debian-bsd@lists.debian.org
Subject: Re: Bug#686402: kfreebsd-kernel-headers: several headers assume _BSD_SOURCE
Date: Mon, 24 Dec 2012 22:46:12 +0000
tags 686402 - patch
thanks

On 24/12/12 00:54, Steven Chamberlain wrote:
> --- kfreebsd-9-9.0.orig/sys/sys/filedesc.h      2011-08-11 13:30:23.000000000 +0100
> +++ kfreebsd-9-9.0/sys/sys/filedesc.h   2012-12-24 00:48:21.750672610 +0000
> @@ -48,2 +48,2 @@
>   * This structure is used for the management of descriptors.  It may be
>   * shared by multiple processes.
>   */
> -#define NDSLOTTYPE     u_long
> +#define NDSLOTTYPE     __u_long

Actually no... this breaks kernel compilation:

> clang -c -O2 -frename-registers -pipe -fno-strict-aliasing -O1  -std=c99  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Win
> line -Wcast-qual  -Wundef -Wno-pointer-sign   -Wmissing-include-dirs -fdiagnostics-show-option -nostdinc  -I. -I../../.. -I../../../contrib/altq -D_KERNEL -DHAVE_KERNEL_OPTION_H
> EADERS -include opt_global.h  -fno-omit-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding   ../
> ../../dev/syscons/scvidctl.c
> In file included from ../../../dev/syscons/scvidctl.c:44:
> ../../../sys/filedesc.h:57:2: error: unknown type name '__u_long'; did you mean 'u_long'?
>         NDSLOTTYPE *fd_map;             /* bitmap of free fds */
>         ^~~~~~~~~~
>         u_long
> ../../../sys/filedesc.h:48:20: note: expanded from macro 'NDSLOTTYPE'
> #define NDSLOTTYPE      __u_long
>                         ^
> ../../../sys/types.h:53:23: note: 'u_long' declared here
> typedef unsigned long   u_long;
>                         ^

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org



Removed tag(s) patch. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Mon, 24 Dec 2012 22:51:05 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#686402; Package kfreebsd-kernel-headers. (Thu, 02 May 2013 20:51:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Thu, 02 May 2013 20:51:09 GMT) Full text and rfc822 format available.

Message #31 received at 686402@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: 686402@bugs.debian.org
Cc: "debian-bsd@lists.debian.org" <debian-bsd@lists.debian.org>
Subject: Re: Bug#686402: kfreebsd-kernel-headers: several headers assume _BSD_SOURCE
Date: Thu, 02 May 2013 21:48:22 +0100
[Message part 1 (text/plain, inline)]
Control: tags -1 + patch

Should be safe to change this to use regular C99 types post-wheezy.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
[920_c99_types.diff (text/x-patch, attachment)]

Added tag(s) patch. Request was from Steven Chamberlain <steven@pyro.eu.org> to 686402-submit@bugs.debian.org. (Thu, 02 May 2013 20:51:09 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 08:13:37 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.