Subject: port-i386/11148: gcc-2.95.2 in -current for i386
To: None <gnats-bugs@gnats.netbsd.org>
From: None <smd@ebone.net>
List: netbsd-bugs
Date: 10/05/2000 19:26:14
>Number:         11148
>Category:       port-i386
>Synopsis:       gcc-2.95.2 and port-i386 (-current)
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Oct 05 19:26:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Sean Doran
>Release:        2000-10-06
>Organization:
Ebone
>Environment:
	
System: NetBSD sean.ebone.net 1.5G NetBSD 1.5G (EBONE) #0: Thu Oct 5 14:23:16 CEST 2000 smd@sean.ebone.net:/usr/src/sys/arch/i386/compile/EBONE i386

pkgsrc/lang/gcc

Reading specs from /usr/pkg/gcc-2.95.2/lib/gcc-lib/i386--netbsdelf/2.95.2/specs
gcc version 2.95.2 19991024 (release)


>Description:
	gcc-2.95.2 can be used to build a working kernel and userland

	there are only pretty minor things

	linking pain made it simplest to just replace the egcs-built/in-tree
	libstdc++.so with one from the pkgsrc distribution (which is not built
	by default); replacing the .a files reduced minor occasional aches also
	(i don't love this because it makes in-tree gcc and pkgsrc gcc not
	coexist nicely, however i haven't had to fall back to in-tree at all)

	minor warnings (null format string) in userland

	should 2.95.2 now replace egcs-2.91.66 19990314 (egcs-1.1.2 release)
	in -current?
>How-To-Repeat:
	1. install pkgsrc/lang/gcc
           do not do a make cleandir
	2. make shared object for libstdc++
	   a) cd .../gcc/work*/objdir/i386--netbsdelf/libstdc++
	   b) make libstdc++.so.2.10.0
	   c) cp libstdc++.so.2.10.0 $(PKG)/gcc-2.95.2/lib

[1&2 should be a separate pkgsrc-change PR, probably]

	3. copy or link the following into /usr/lib:
	   $(PKG)/gcc-2.95.2/lib/libiberty.a
	   $(PKG)/gcc-2.95.2/lib/libstdc++.a.2.10.0
	   ln -s /usr/lib/libstdc++.a.2.10.0 /usr/lib/libstdc++.a
	   $(PKG)/gcc-2.95.2/lib/libstdc++.so.2.10.0 (from step 2)
	   ln -s /usr/lib/libstdc++.so.2.10.0 /usr/lib/libstdc++.so.2.10
	   ln -s /usr/lib/libstdc++.so.2.10.0 /usr/lib/libstdc++.so.2
	   ln -s /usr/lib/libstdc++.so.2.10.0 /usr/lib/libstdc++.so
	   $(PKG)/gcc-2.95.2/lib/gcc-lib/i386--netbsdelf/2.95.2/libgcc.a
	   $(PKG)/gcc-2.95.2/lib/gcc-lib/i386--netbsdelf/2.95.2/libg2c.a
	   $(PKG)/gcc-2.95.2/lib/gcc-lib/i386--netbsdelf/2.95.2/libobjc.a
	   $(PKG)/gcc-2.95.2/lib/gcc-lib/i386--netbsdelf/2.95.2/libchill.a

	4. in /etc/mk.conf:
	   HAVE_GCC29=yes
	   # this prevents the step 3 libraries from being over written
	   # by make build / make install in $(SRCDIR)

	5. everyone's $PATH should be adjusted to have
	   /usr/pkg/gcc-2.95.2/bin BEFORE /usr/bin, to invoke 
	   the 2.95.2 programs

	6. build away...

A GENERIC.MP (-rsommerfeld_i386mp_1) and a GENERIC kernel builds fine;
kernels derived from the former built with the following options works also:

-pipe -O3 -march=i686 -mfancy-math-387 -fsched-interblock -fsched-spec
-fsched-interblock -fsched-spec-load -fbranch-count-reg -fforce-mem 
-fforce-addr -finline-functions -mwide-multiply -funroll-loops

some of which are redundant in 2.95.2 but not in the in-tree egcs.

Many packages were built just fine.

So far I haven't found anything that trips up under 2.95.2, except
in userland there are plenty of null format string warnings:

/usr/src/games/worm/worm.c: In function `life':
/usr/src/games/worm/worm.c:160: warning: null format string
/usr/src/games/worm/worm.c:168: warning: null format string
/usr/src/games/worm/worm.c: In function `process':
/usr/src/games/worm/worm.c:315: warning: null format string

from err(1,NULL) scattered around everywhere.

I build such "poisoned" .o files with NOGCCERROR=1, but there
must be a nicer way...

>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted: