From nobody@FreeBSD.org  Thu Nov 15 16:57:45 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 21D9A37B417
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 15 Nov 2001 16:57:45 -0800 (PST)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.4/8.11.4) id fAG0vjB01745;
	Thu, 15 Nov 2001 16:57:45 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200111160057.fAG0vjB01745@freefall.freebsd.org>
Date: Thu, 15 Nov 2001 16:57:45 -0800 (PST)
From: "Aaron D. Gifford" <agifford@infowest.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: SHOWSTOPPING FAILURE OF "make buildkernel" IN -STABLE when "MODULES_WITH_WORLD=true" in /etc/make.conf
X-Send-Pr-Version: www-1.0

>Number:         32021
>Category:       kern
>Synopsis:       SHOWSTOPPING FAILURE OF "make buildkernel" IN -STABLE when "MODULES_WITH_WORLD=true" in /etc/make.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    matusita
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 15 17:00:00 PST 2001
>Closed-Date:    Sun Nov 18 02:14:41 PST 2001
>Last-Modified:  Sun Nov 18 02:15:43 PST 2001
>Originator:     Aaron D. Gifford
>Release:        FreeBSD 4.4-STABLE
>Organization:
N/A
>Environment:
FreeBSD 4.4-STABLE #5: Wed Nov 14 17:11:37 MST 2001     root@my.host:/usr/obj/usr/src/sys/GENERIC
>Description:
Any attempt to build recent -STABLE kernels failes as follows:

--------------------------------------------------------------
>How-To-Repeat:
Try to build a -STABLE kernel on a recent -STABLE system with "MODULES_WITH_WORLD=true" in your /etc/make.conf file and you WILL encounter this problem.
>Fix:
The temporary work-around is to edit /usr/src/conf/Makefile.i386 and add the following two lines IMMEDIATELY BEFORE the ".endif" line in the ".if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules)" section of the Makefile:

.else
cleandir:

That fixes things temporarily, but isn't a real fix, because I don't know exactly why things broke sometime in the last 2-3 weeks in the first place.
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->analyzed 
State-Changed-By: matusita 
State-Changed-When: Thu Nov 15 19:15:12 PST 2001 
State-Changed-Why:  
This problem is actually in src/Makefile.inc1, not 
src/sys/i386/compile/${conf}/Makefile.  I've already commited a fix 
to 5-current, MFC will come in a few days later. 


Responsible-Changed-From-To: freebsd-bugs->matusita 
Responsible-Changed-By: matusita 
Responsible-Changed-When: Thu Nov 15 19:15:12 PST 2001 
Responsible-Changed-Why:  
I'll handle this. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32021 

From: Makoto Matsushita <matusita@jp.freebsd.org>
To: agifford@infowest.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/32021: SHOWSTOPPING FAILURE OF "make buildkernel" IN
 -STABLE when "MODULES_WITH_WORLD=true" in /etc/make.conf
Date: Fri, 16 Nov 2001 12:13:58 +0900

 > SHOWSTOPPING FAILURE OF "make buildkernel" IN -STABLE when "MODULES_WITH_WORLD=true" in /etc/make.conf
 
 I suppose that this occurs only if you set both MODULES_WITH_WORLD
 _and_ do "make buildkernel", right?
 
 Sorry for inconvenience, maybe that's my fault.  This morning I hit an
 idea my changes to src/Makefile.inc1 still causes a problem as you
 mentioned, and fix in 5-current.  If it works well in 5-current (needs
 some time to spent), I'll MFC to 4-stable, hopefully next monday.
 
 -- -
 Makoto `MAR' Matsushita
State-Changed-From-To: analyzed->closed 
State-Changed-By: matusita 
State-Changed-When: Sun Nov 18 02:14:41 PST 2001 
State-Changed-Why:  
Fixed in rev 1.227 and 1.141.2.38. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=32021 
>Unformatted:
 >>> Kernel build for GENERIC started on Thu Nov 15 16:56:43 MST 2001
 --------------------------------------------------------------
 ===> GENERIC
 mkdir -p /usr/obj/usr/src/sys
 cd /usr/src/sys/i386/conf;  PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/obj/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  config  -d /usr/obj/usr/src/sys/GENERIC GENERIC
 Don't forget to do a ``make depend''
 Kernel build directory is /usr/obj/usr/src/sys/GENERIC
 cd /usr/obj/usr/src/sys/GENERIC;  MAKEOBJDIRPREFIX=/usr/obj  COMPILER_PATH=/usr/obj/usr/src/i386/usr/libexec:/usr/obj/usr/src/i386/usr/bin  LIBRARY_PATH=/usr/obj/usr/src/i386/usr/lib:/usr/obj/usr/src/i386/usr/lib  OBJFORMAT_PATH=/usr/obj/usr/src/i386/usr /libexec  CFLAGS="-nostdinc -O -pipe -march=pentiumpro"  PERL5LIB=/usr/obj/usr/src/i386/usr/libdata/perl/5.00503  GROFF_BIN_PATH=/usr/obj/usr/src/i386/usr/bin  GROFF_FONT_PATH=/usr/obj/usr/src/i386/usr/share/groff_font  GROFF_TMAC_PATH=/usr/obj/usr/src/i 386/usr/share/tmac  DESTDIR=/usr/obj/usr/src/i386  INSTALL="sh /usr/src/tools/install.sh"  PATH=/usr/obj/usr/src/i386/usr/sbin:/usr/obj/usr/src/i386/usr/bin:/usr/obj/usr/src/i386/usr/games:/sbin:/bin:/usr/sbin:/usr/bin  OBJFORMAT_PATH=/usr/obj/usr/src/i3 86/usr/libexec:/usr/libexec MACHINE=i386 make KERNEL=kernel clean cleandir
 rm -f *.o *.so *.So *.ko *.s eddep errs  kernel kernel linterrs makelinks  setdef[01].c setdefs.h tags  vers.c
 vnode_if.c vnode_if.h aicasm aicasm_gram.c aicasm_scan.c y.tab.h  aic7xxx_seq.h aic7xxx_reg.h device_if.c device_if.h bus_if.c  bus_if.h miibus_if.c miibus_if.h power_if.c power_if.h card_if.c  card_if.h ppbus_if.c ppbus_if.h pci_if.c pci_if.h usb_if.c   usb_if.h isa_if.c isa_if.h
 make: don't know how to make cleandir. Stop
 *** Error code 2
  
 Stop in /usr/src.
 *** Error code 1
  
 Stop in /usr/src.
 
 
 
 A little digging shows that in /usr/obj/usr/src/sys/GENERIC/Makefile there is the following section:
 
 .if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules)
 all:    modules
 depend: modules-depend
 clean:  modules-clean
 cleandepend:  modules-cleandepend
 cleandir:  modules-cleandir
 tags:  modules-tags
 install install.debug: modules-install
 reinstall reinstall.debug: modules-reinstall
 .endif
 
 That's the ONLY plase "cleandir" exists.  The problem is, the IF condition will NOT evaluate to TRUE if "MODULES_WITH_WORLD=true" in /etc/make.conf (which I always set, since I like to build my modules just once and then build a whole bunch of custom ker nels).  Thus, on my system or on any system where the .if expression isn't true in the Makefile AND the "make buildkernel" does a "make cleandir" it will FAIL with the same error as above.
 
