Subject: pkg/25093: gcc-2.95.3 broken under -current
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jschauma@netmeister.org>
List: pkgsrc-bugs
Date: 04/07/2004 12:07:05
>Number:         25093
>Category:       pkg
>Synopsis:       lang/gcc is broken under -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 07 16:08:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jan Schaumann
>Release:        NetBSD 1.6ZK
>Organization:
	
>Environment:
	
	
System: NetBSD dogfish-head.cs.stevens-tech.edu 1.6ZK NetBSD 1.6ZK (BOCK.current) #0: Tue Mar 9 11:41:58 EST 2004 jschauma@doppelbock.hpcf.cs.stevens-tech.edu:/share/src/sys/arch/i386/compile/obj/BOCK.current i386
Architecture: i386
Machine: i386
>Description:

Running NetBSD-current we have the default compiler gcc version 3.3.3.
If you install lang/gcc from pkgsrc (ie gcc 2.95.3), the resulting compiler
will be able to compile programs, but it will link them against the
systems libraries (libc, libstdc++ etc.), so that running these binaries
will result in the following error:

Undefined symbol "cerr" referenced from COPY relocation in ./a.out

A statically linked program does not show that behaviour.

>How-To-Repeat:

	Install NetBSD-current.

	Install lang/gcc from pkgsrc.

	Write a simple C program and compile with /usr/pkg/gcc-2.95.3/bin/gcc.

	Execute that program.

>Fix:

Unknown.  Some suggestions have been made in the thread starting with
http://mail-index.netbsd.org/tech-pkg/2004/03/28/0033.html

Somewhat related may be the thread starting with
http://mail-index.netbsd.org/tech-pkg/2004/03/28/0012.html

FWIW, I've had no luck installing binutils into /usr/pkg/gcc-2.95.3 with
a --with-lib-path=/usr/pkg/gcc-2.95.3/lib:/lib:/usr/lib and
telling gcc to use the ld from /usr/pkg/gcc-2.95.3/bin/ld
>Release-Note:
>Audit-Trail:
>Unformatted: