Subject: port-i386/19991: Unable to compile NetBSD-current/i386
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bpstark@pacbell.net>
List: netbsd-bugs
Date: 01/21/2003 23:13:33
>Number:         19991
>Category:       port-i386
>Synopsis:       Unable to build a release
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 21 23:14:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Brian Stark
>Release:        NetBSD 1.6K
>Organization:

Brian Stark
bpstark@pacbell.net
>Environment:
	
	
System: NetBSD rainforest.private.net 1.6K NetBSD 1.6K (CALLISTO) #0: Wed Nov 20 21:08:21 PST 2002 bstark@rainforest.private.net:/usr/src/sys/arch/i386/compile/CALLISTO i386
Architecture: i386
Machine: i386
>Description:

Unable to build a release of NetBSD-current. The error messages I see are:

/usr/src/tools/obj.i386/tools.NetBSD-1.6K-i386/bin/i386--netbsdelf-gcc  -ffreestanding  -pipe -Werror -Wall -Wno-main -Wno-format-zero-length -Wpointer-arith -Wmissing-prototypes -Wstrict-prototypes -Wno-sign-compare -Wno-uninitialized  -Di386 -I.  -I/usr/src/sys/arch -I/usr/src/sys -nostdinc -DLKM -DMAXUSERS=32 -D_KERNEL -D_KERNEL_OPT   -c /usr/src/sys/dev/pci/if_pcn.c
/usr/src/sys/dev/pci/if_pcn.c: In function `pcn_init':
/usr/src/sys/dev/pci/if_pcn.c:1769: internal error--unrecognizable insn:
(insn 644 643 646 (set (reg:SI 170)
        (unspec:SI[ 
                (const_int 512 [0x200])
            ]  5)) -1 (nil)
    (nil))
*** Error code 1

Stop.
nbmake: stopped in /usr/obj/sys/arch/i386/compile.i386/GENERIC
*** Error code 1

Stop.
nbmake: stopped in /usr/src/etc
*** Error code 1

Stop.
nbmake: stopped in /usr/src

ERROR: failed to make release
*** BUILD ABORTED ***

This occurs when /etc/mk.conf does not contain an optimization flag for
the COPTS variable.

This occurs with CVS sources from January 21, 2003. It is worth mentioning
that this problem has existed for quite a while (I've just been a bit 
lazy in getting to this problem report).


>How-To-Repeat:
	
Make sure that /etc/mk.conf does not contain an optimization flag for
the COPTS variable.

Grab latest CVS sources for NetBSD.

Build NetBSD-current/i386 using the build.sh script as the root user. 
I am passing in parameters for the -D and -R flags:

cd /usr/src
su 
./build.sh -D /export/destdir/NetBSD-20030121 -R /export/release/NetBSD-20030121

>Fix:
	
I believe it was Jason Thorpe who suggested the work around of 
modifying /etc/mk.conf to include '-O' for the optimization flag for COPTS: 

rainforest:{root}# cat /etc/mk.conf | grep COPTS
COPTS+=-O -pipe
rainforest:{root}#

I have experimented with other optimization levels (-O2), but those seem to
prevent the boot floppy images from being created because they affect the size
of the image, and the makefiles for the boot floppies hard-code the max size
of the image.  
>Release-Note:
>Audit-Trail:
>Unformatted: