Subject: toolchain/26415: 2.0 HAVE_STRUCT_STATFS_F_IOSIZE inconsistent about sys/mount.h
To: None <gnats-bugs@gnats.netbsd.org>
From: Darrin B. Jewell <dbj@netbsd.org>
List: netbsd-bugs
Date: 07/23/2004 07:51:57
>Number:         26415
>Category:       toolchain
>Synopsis:       2.0 HAVE_STRUCT_STATFS_F_IOSIZE inconsistent about sys/mount.h
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 23 11:54:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Darrin B. Jewell
>Release:        netbsd-2-0 updated via cvs ~20040722T1714Z
>Organization:
>Environment:
Darwin Quiteria 7.4.0 Darwin Kernel Version 7.4.0: Wed May 12 16:58:24 PDT 2004; root:xnu/xnu-517.7.7.obj~7/RELEASE_PPC  Power Macintosh powerpc
>Description:
The netbsd-2-0 branch doesn't currently build on Darwin.

It fails in src/tools/makefs with the following error:

  #   compile  makefs/ffs.lo
  cc -O -I. -no-cpp-precomp -I/u2/n/h/obj.i386/tools/compat -I/u2/n/h/obj.i386/tools/compat/include  -I/u3/n/h/src/tools/makefs/../compat -DHAVE_NBTOOL_CONFIG_H=1  -D_FILE_OFFSET_BITS=64 -I/u3/n/h/src/tools/makefs/../../usr.sbin/makefs  -I/u3/n/h/src/bin/ls -I/u3/n/h/src/sbin/mknod -I/u3/n/h/src/usr.sbin/mtree -c -o ffs.lo.o    /u3/n/h/src/usr.sbin/makefs/ffs.c
  /u3/n/h/src/usr.sbin/makefs/ffs.c: In function `ffs_create_image':
  /u3/n/h/src/usr.sbin/makefs/ffs.c:419: error: storage size of `sfs' isn't known
  
  *** Failed target:  ffs.lo
  *** Failed command: cc -O -I. -no-cpp-precomp -I/u2/n/h/obj.i386/tools/compat -I/u2/n/h/obj.i386/tools/compat/include -I/u3/n/h/src/tools/makefs/../compat -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 -I/u3/n/h/src/tools/makefs/../../usr.sbin/makefs -I/u3/n/h/src/bin/ls -I/u3/n/h/src/sbin/mknod -I/u3/n/h/src/usr.sbin/mtree -c -o ffs.lo.o /u3/n/h/src/usr.sbin/makefs/ffs.c
  *** Error code 1

  Stop.
  nbmake: stopped in /u3/n/h/src/tools/makefs

It appears that the fstatfs call need sys/mount.h to be included.
However, src/usr.sbin/makefs/ffs.c does this:
  #if !HAVE_NBTOOL_CONFIG_H
  #include <sys/mount.h>
  #endif

But this is inconsistent with configure.ac, which does include sys/mount.h
when it performs its test for this feature:
  AC_CHECK_MEMBERS(struct statfs.f_iosize,,, [#include <sys/mount.h>])                         

>How-To-Repeat:
Cross build netbsd-2-0 from darwin
>Fix:
Either allow sys/mount.h to be included unconditionally,
or else remove it from the configure.ac test for the
HAVE_STRUCT_STATFS_F_IOSIZE feature.

What would break if we just included sys/mount.h all the time?
>Release-Note:
>Audit-Trail:
>Unformatted: