Subject: Re: gcc-2.95.3 package on -current
To: Jan Schaumann <>
From: Frederick Bruckman <>
List: tech-pkg
Date: 03/28/2004 10:47:57
On Sun, 28 Mar 2004, Jan Schaumann wrote:

> It appears that there's a problem with the gcc-2.95.3 package when using
> it on -current, where -current has already switched to gcc-3.3.3.
> I can compile and install the package, and it will compile code, but
> running the code gets confused when it tries to resolve symbols, as it
> first looks in /usr/lib et al.
> I noticed this with a simple C++ program, which, after being compiled
> with /usr/pkg/gcc-2.95.3/bin/g++ gives this error:
> Undefined symbol "cout" referenced from COPY relocation in ./a.out
> If I set LD_PRELOAD to /usr/pkg/gcc-2.95.3/lib/, it will
> work, but obviously this is no solution.

So that indicates a problem with the linker, doesn't it?

> Anybody know of a way to get this to work properly?

Here's an idea... Build an "ld" from binutils>=2.14 with
"--with-lib-path=/usr/pkg/gcc-2.95.3/lib:/lib/usr/lib" and
"--prefix=/usr/pkg/gcc-2.95.3", and then build gcc with
"--with-ld=/usr/pkg/gcc-2.95.3/bin/ld". You could also try dumping
binutils and gcc in the same directory, NetBSD 1.6-toolchain-style,
and hope for the best.