Subject: port-i386/2184: i386 boot blocks don't compile
To: None <gnats-bugs@NetBSD.ORG>
From: John M Vinopal <banshee@gabriella.resort.com>
List: netbsd-bugs
Date: 03/07/1996 00:15:02
>Number:         2184
>Category:       port-i386
>Synopsis:       i386 boot blocks don't compile
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar  7 03:50:02 1996
>Last-Modified:
>Originator:     John M Vinopal
>Organization:
The Wailer at the Gates of Dawn            /   banshee@resort.com          |
Just who ARE you calling a FROOFROO Head? /                                |
DoD#0667  "Just a friend of the beast."  | http://www.resort.com/~banshee/ |
2,3,5,7,13,17,19,31,61,89,107,127,521,607....\      Port and Absinthe      |
>Release:        1.1
>Environment:
System: NetBSD gabriella.resort.com 1.1A NetBSD 1.1A (GABRIELLA-NCR) #0: Sun Feb 4 16:16:19 PST 1996 banshee@gabriella.resort.com:/usr/local/NetBSD/src/sys/arch/i386/compile/GABRIELLA-NCR i386


>Description:
	include dependancies cause boot block compilation to abort due
	to multiple definition of the DIRSIZ macro.  The two definitions
	are in sys/dirent.h and ufs/ufs/dir.h -- the latter notes that its
	definition of DIRSIZ overrides the other via #undef.  However, to
	do this, <sys/dirent.h> must appear first, which is not the case
	in the boot block sys.c code.
	
>How-To-Repeat:
	cd /sys/arch/i386/boot; make

>Fix:
Undef of _KERNEL removes the duplicate DIRSIZ macro.  This macro is
the only thing presently enclosed in #ifdef _KERNEL -- but will this
always be the case?  Perhaps a more burly set of #ifdefs are needed,
relying on a specific order of #includes is ugly hackery.

*** foo Thu Mar  7 00:07:16 1996
--- sys.c       Thu Mar  7 00:06:37 1996
***************
*** 29,35 ****
--- 29,37 ----
   */
  
  #include "boot.h"
+ #undef _KERNEL
  #include <sys/dirent.h>
+ #define _KERNEL
  #include <sys/reboot.h>
  
  char mapbuf[MAXBSIZE], iobuf[MAXBSIZE], fsbuf[SBSIZE];

>Audit-Trail:
>Unformatted: