[11317] in Athena Bugs

home help back first fref pref prev next nref lref last post

sun4 7.6P: libnsl.a: some object files can't be statically linked

daemon@ATHENA.MIT.EDU (Calvin Clark)
Sun Oct 31 15:12:19 1993

Date: Sun, 31 Oct 93 15:12:11 EST
From: Calvin Clark <ckclark@MIT.EDU>
To: bugs@MIT.EDU

-------
System name:		triad
Type and version:	SPARC/Classic 7.6P
Display type:		cgthree

What were you trying to do?

	Statically link a program that calls gethostbyname().

What's wrong:

	There are a couple of objects in libnsl.a
	which require the dynamic linking routines:

	; cat foo.c
	main () { (void) gethostbyname ("foo"); }
	; gcc -static foo.c -lnsl
	Undefined                       first referenced
	 symbol                             in file
	dlerror                             /usr/lib/libnsl.a(netdir.o)
	dlopen                              /usr/lib/libnsl.a(gethostent.o)
	dlsym                               /usr/lib/libnsl.a(gethostent.o)
	dlclose                             /usr/lib/libnsl.a(netdir.o)
	dgettext                            /usr/lib/libnsl.a(netdir.o)
	ld: fatal: Symbol referencing errors. No output written to a.out

What should have happened:

	I should be able to statically link with these
	objects.

Please describe any relevant documentation references:

	gethostbyname (3n)

home help back first fref pref prev next nref lref last post