# Buildworld of 8_2_RELENG fails from 8.2-RC2 host - missing headers?



## MidnightCommando (Jan 28, 2011)

I've recently installed 8.2-RC2 on a spare machine I had lying around, I figured it would be nice to have FreeBSD on some bare metal again instead of in virtualisation - 

Install went off without a hitch, all sources were installed with the system (I intended the first thing I would do to be a complete rebuild) - 

Just before putting up the error: Things I have tried: 

csup to latest revision of 8_2_RELENG 
nuked /usr/src completely and csup'd a fresh tree, again 8_2_RELENG
both to no avail. 

The output I get from the buildworld follows: 


```
gx260# make buildworld
--------------------------------------------------------------
>>> World build started on Fri Jan 28 11:40:02 EST 2011
--------------------------------------------------------------

--------------------------------------------------------------
>>> Rebuilding the temporary build tree
--------------------------------------------------------------
rm -rf /usr/obj/usr/src/tmp
mkdir -p /usr/obj/usr/src/tmp/lib
mkdir -p /usr/obj/usr/src/tmp/usr
mkdir -p /usr/obj/usr/src/tmp/legacy/usr
mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p /usr/obj/usr/src/tmp/legacy/usr >/dev/null
mtree -deU -f /usr/src/etc/mtree/BSD.usr.dist  -p /usr/obj/usr/src/tmp/usr >/dev/null
mtree -deU -f /usr/src/etc/mtree/BSD.include.dist  -p /usr/obj/usr/src/tmp/usr/include >/dev/null
ln -sf /usr/src/sys /usr/obj/usr/src/tmp

--------------------------------------------------------------
>>> stage 1.1: legacy release compatibility shims
--------------------------------------------------------------
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL="sh /usr/src/tools/install.sh"  
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/b
in  WORLDTMP=/usr/obj/usr/src/tmp  VERSION="FreeBSD 8.2-RC2 i386 802000"  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make -f 
Makefile.inc1  DESTDIR=  BOOTSTRAPPING=802000  SSP_CFLAGS=  -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE -
DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF legacy
===> tools/build (obj,includes,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/tools/build created for /usr/src/tools/build
cd /usr/src/tools/build; make buildincludes; make installincludes
rm -f .depend
mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include /usr/src/tools/build/dummy.c
cc -O2 -march=pentium4 -pipe   -I/usr/obj/usr/src/tmp/legacy/usr/include -c /usr/src/tools/build/dummy.c
building static egacy library
ranlib libegacy.a
sh /usr/src/tools/install.sh -C -o root -g wheel -m 444   libegacy.a /usr/obj/usr/src/tmp/legacy/usr/lib


--------------------------------------------------------------
>>> stage 1.2: bootstrap tools
--------------------------------------------------------------
cd /usr/src; MAKEOBJDIRPREFIX=/usr/obj/usr/src/tmp  INSTALL="sh /usr/src/tools/install.sh"  
PATH=/usr/obj/usr/src/tmp/legacy/usr/sbin:/usr/obj/usr/src/tmp/legacy/usr/bin:/usr/obj/usr/src/tmp/legacy/usr/games:/sbin:/bin:/usr/sbin:/usr/b
in  WORLDTMP=/usr/obj/usr/src/tmp  VERSION="FreeBSD 8.2-RC2 i386 802000"  MAKEFLAGS="-m /usr/src/tools/build/mk  -m /usr/src/share/mk" make -f 
Makefile.inc1  DESTDIR=  BOOTSTRAPPING=802000  SSP_CFLAGS=  -DWITHOUT_HTML -DWITHOUT_INFO -DNO_LINT -DWITHOUT_MAN  -DNO_PIC -DWITHOUT_PROFILE -
DNO_SHARED  -DNO_CPU_CFLAGS -DNO_WARNS -DNO_CTF bootstrap-tools
===> cddl/usr.bin/sgsmsg (obj,depend,all,install)
/usr/obj/usr/src/tmp/usr/src/cddl/usr.bin/sgsmsg created for /usr/src/cddl/usr.bin/sgsmsg
rm -f .depend
mkdep -f .depend -a    -I/usr/obj/usr/src/tmp/legacy/usr/include 
/usr/src/cddl/usr.bin/sgsmsg/../../../sys/cddl/contrib/opensolaris/common/avl/avl.c 
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c 
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c 
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c
/usr/src/cddl/usr.bin/sgsmsg/../../../sys/cddl/contrib/opensolaris/common/avl/avl.c:96:23: error: sys/debug.h: No such file or directory
/usr/src/cddl/usr.bin/sgsmsg/../../../sys/cddl/contrib/opensolaris/common/avl/avl.c:97:21: error: sys/avl.h: No such file or directory
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c:81:17: error: sgs.h: No such file or directory
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/sgsmsg.c:82:27: error: _string_table.h: No such file or 
directory
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c:29:27: error: _string_table.h: No such file 
or directory
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/string_table.c:31:17: error: sgs.h: No such file or 
directory
/usr/src/cddl/usr.bin/sgsmsg/../../../cddl/contrib/opensolaris/cmd/sgs/tools/common/findprime.c:30:17: error: sgs.h: No such file or directory
mkdep: compile failed
*** Error code 1

Stop in /usr/src/cddl/usr.bin/sgsmsg.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
*** Error code 1

Stop in /usr/src.
gx260#
```

Has anyone got any ideas regarding this?


----------



## bschmidt (Jan 28, 2011)

I guess you already tried stripping everything from /usr/obj?


----------



## MidnightCommando (Jan 28, 2011)

Naturlich, did `# rm -rf /usr/obj/*` before each buildworld attempt, as per documentation.


----------



## SirDice (Jan 28, 2011)

MidnightCommando said:
			
		

> csup to latest revision of 8_2_RELENG


It's RELENG_8_2.


----------



## MidnightCommando (Jan 28, 2011)

SirDice said:
			
		

> It's RELENG_8_2.



Just checked my supfile, and so it is. Apologies. However either way I have a source tree that is stubbornly refusing to build, any help towards fixing that issue would be appreciated .


----------



## SirDice (Jan 28, 2011)

Anything in /etc/make.conf or /etc/src.conf?


----------



## MidnightCommando (Jan 28, 2011)

```
gx260# cat /etc/src.conf 
CFLAGS=-O2 -march=pentium4 -pipe
NDEBUG=1
NO_WERROR=1
WERROR=0
MALLOC_PRODUCTION=
WITHOUT_AMD=1
WITHOUT_INET6=1
WITHOUT_NCP=1
WITHOUT_QUOTAS=1
WITHOUT_ZFS=1
```



```
gx260# cat /etc/make.conf
CPUTYPE?=pentium4
CFLAGS= -O2  -fomit-frame-pointer -fno-strict-aliasing -pipe
MAKE_SHELL?=sh
COPTFLAGS= -O2 -fomit-frame-pointer -pipe
NO_MANCOMPRESS=
SUP=            /usr/bin/csup
SUPFLAGS=       -L 2
SUPHOST=        cvsup.au.FreeBSD.org
SUPFILE=        /usr/share/examples/cvsup/standard-supfile
PORTSSUPFILE=   /usr/share/examples/cvsup/ports-supfile
DOCSUPFILE=     /usr/share/examples/cvsup/doc-supfile
TOP_TABLE_SIZE= 51
DOC_LANG=	en_GB.ISO8859-1
```

(Please don't give me flak about disabling IPv6, I've done so for a reason - that being that there is no IPv6 traffic on the internal network I run, and likely won't be for some time) 

There you go >_>


----------



## SirDice (Jan 28, 2011)

I was afraid of something like that...

Remove the CFLAGS and COPTFLAGS.


----------



## MidnightCommando (Jan 28, 2011)

Well, I was about to get indignant, SirDice, but I tried what you suggested, and like magic, suddenly the compile is starting. 

May I ask "What the?!" though? There are plenty of ways to force something to break, but that shouldn't do it 

(Got curious, tried += instead of =, still works - overwrites some include flag?)


----------



## SirDice (Jan 28, 2011)

Short answer, don't use those flags unless you absolutely know what they do.

Everything is already pretty optimized so there's no need for it. The only optimization you should set is the CPUTYPE.


----------



## MidnightCommando (Jan 28, 2011)

SirDice: I assure you I absolutely know what those flags do. It seems like I had some syntactic confusion lingering regarding the .conf files - I am using Gentoo as my primary environment at present, which is similar enough to feel comfortable and just different enough to be infuriating if you try to transfer skills  

Thankyou very much for all your help and patience - looks like this is all resolved nicely now


----------

