Subject: GCC4 on amd64 breaks in pxeboot during build
To: None <tech-toolchain@netbsd.org>
From: Scott Ellis <scotte@warped.com>
List: tech-toolchain
Date: 05/24/2006 11:50:24
I thought I saw in one of mrg's email updates that amd64 builds properly 
with gcc4, so I thought I'd give it a whirl.  Unfortunately, I get 
breakage in the pxe boot stuff (specifically i386/stand/pxeboot/pxe.h).

This looks like a GCC4 specific problem, since it deals with the 
__packed__ attribute which has been causing problems elsewhere.

Building -current on amd64 for amd64 with:

intrepid# ./build.sh -u -M obj.amd64 -D /misc/netbsd_build/amd64/destdir 
-T /misc/netbsd_build/amd64/tooldir -R 
/misc/netbsd_build/amd64/releasedir release

(-u makes no difference, other than speeding up the build)

results in:

[snip]
cc1: warnings being treated as errors
In file included from 
/misc/netbsd_src/src/sys/arch/i386/stand/pxeboot/pxe.c:102
:
/misc/netbsd_src/src/sys/arch/i386/stand/pxeboot/pxe.h:52: warning: 
'__packed__'
  attribute ignored
/misc/netbsd_src/src/sys/arch/i386/stand/pxeboot/pxe.h:58: warning: 
'__packed__'
  attribute ignored

*** Failed target:  pxe.o
[snip]

The mk.conf is as follows (but I think HAVE_GCC=4 is the only relevant 
item):

# Don't build other stuff
MKDOC=no
MKLINT=no
MKINFO=no
MKUUCP=no
# On-hold due to bugs in x11 building
MKPROFILE=no
#MKPICINSTALL=no
# Don't build Auth methods we don't need
MKKERBEROS=no
MKKERBEROS4=no
MKHESIOD=no
MKSKEY=no
MKYP=no
# I don't use sendmail or postfix
MKSENDMAIL=no
MKPOSTFIX=no
# I don't want IPV6
MKINET6=no
USE_INET6=no
# I don't use PF (yet)
#MKPF=no
# Misc Stuff
# Set compiler options.
# Note that CFLAGS is the 'wrong' way to set things
CFLAGS += -pipe
#COPTS += -pipe
STRIPFLAG = -s
# Don't fail on 'release'
CHECKFLIST_FLAGS=-e -m
# Build X stuff
#X11SRCDIR=/usr/xsrc
MKX11=yes
# Misc
HAVE_GCC=4


Removing the __packed__ attribute allows the build to proceed, and it 
doesn't look like that is actually needed in the two offending pxe 
structs anyway, although I have not tested it.

	ScottE