Subject: ld: cannot find -lgcc_pic-lgcc_p
To: None <current-users@netbsd.org>
From: Johnny Lam <jlam@jgrind.org>
List: current-users
Date: 03/20/2002 11:40:12
I'm running a NetBSD-1.5ZA/i386 snapshot from ftp.netbsd.org built from
around 20021222.  I get the following when trying to link a shared object:

# cc -v -pipe -shared -Wl,-x -o pltcl.so pltcl.o -Wl,-R/usr/pkg/lib -L/usr/pkgsrc/scratch/postgresql-pltcl/work/.buildlink/lib -ltcl83 
Using builtin specs.
gcc version 2.95.3 20010315 (release) (NetBSD nb1)
 ld -m elf_i386 -shared -o pltcl.so /usr/lib/crtbeginS.o -L/usr/pkgsrc/scratch/postgresql-pltcl/work/.buildlink/lib -x pltcl.o -R/usr/pkg/lib -ltcl83 -lgcc_pic-lgcc_p -lgcc_pic-lgcc_p /usr/lib/crtendS.o
ld: cannot find -lgcc_pic-lgcc_p

The same command works if I remove -pipe:

# cc -v -shared -Wl,-x -o pltcl.so pltcl.o -Wl,-R/usr/pkg/lib -L/usr/pkgsrc/scratch/postgresql-pltcl/work/.buildlink/lib -ltcl83 
Using builtin specs.
gcc version 2.95.3 20010315 (release) (NetBSD nb1)
 ld -m elf_i386 -shared -o pltcl.so /usr/lib/crtbeginS.o -L/usr/pkgsrc/scratch/postgresql-pltcl/work/.buildlink/lib -x pltcl.o -R/usr/pkg/lib -ltcl83 -lgcc_pic -lgcc_pic /usr/lib/crtendS.o

I'm confused as to why adding -pipe to the command line should change the
linker command invoked.

	Thanks,

	-- Johnny Lam <jlam@jgrind.org>