Subject: gdb failure when MKPIC=no
To: None <port-vax@netbsd.org, current-users@netbsd.org>
From: NetBSD Mailing list <netbsd@mrynet.com>
List: current-users
Date: 11/21/1999 06:04:28
I've had a problem for quite a while doing a world build.
Everything these days builds fine, except for gdb -- it has always failed
as follows:

>
cc   -o gdb init.o main.o version.o blockframe.o breakpoint.o findvar.o stack.o thread.o source.o
values.o eval.o valops.o valarith.o valprint.o printcmd.o symtab.o symfile.o symmisc.o infcmd.o infrun.o
command.o expprint.o environ.o gdbtypes.o copying.o vax-tdep.o ser-tcp.o ser-unix.o infptrace.o
inftarg.o fork-child.o corelow.o vaxnbsd-nat.o kcore-nbsd.o remote.o dcache.o remote-utils.o
tracepoint.o mem-break.o target.o parse.o language.o c-exp.o f-exp.o jv-exp.o m2-exp.o buildsym.o exec.o
bcache.o objfiles.o minsyms.o maint.o demangle.o dbxread.o coffread.o elfread.o dwarfread.o dwarf2read.o
mipsread.o stabsread.o corefile.o c-lang.o ch-exp.o ch-lang.o f-lang.o jv-lang.o jv-valprint.o
jv-typeprint.o m2-lang.o scm-exp.o scm-lang.o scm-valprint.o complaints.o typeprint.o c-typeprint.o
ch-typeprint.o f-typeprint.o m2-typeprint.o c-valprint.o cp-valprint.o ch-valprint.o f-valprint.o
m2-valprint.o nlmread.o serial.o mdebugread.o os9kread.o top.o utils.o annotate.o inflow.o gnu-regex.o
-ledit -lkvm -ltermcap -L/ravine/src/gnu/lib/libbfd -lbfd
stack.o: Undefined symbol `_solib_address' referenced from text segment
infcmd.o: Undefined symbol `_solib_add' referenced from text segment
infrun.o: Undefined symbol `_solib_add' referenced from text segment
infrun.o: Undefined symbol `_solib_add' referenced from text segment
fork-child.o: Undefined symbol `_solib_create_inferior_hook' referenced from text segment
corelow.o: Undefined symbol `_clear_solib' referenced from text segment
corelow.o: Undefined symbol `_solib_add' referenced from text segment
objfiles.o: Undefined symbol `_clear_solib' referenced from text segment
collect2: ld returned 1 exit status
*** Error code 1
<

In the past I've forced the world build with make -k, and finally today
got around to investigating.

As I'm building on a VERY slow platform (VaxStation 3100), I've had PIC, 
profiling and docs (MAN, INFO and DOC) all turned off in mk.conf.

As a result, the MKPIC=no directive test in src/gnu/usr.bin/gdb/Makefile:

	.if ${MKPIC} != "no"
	NATDEPFILES+= solib.c
	.endif

is causing solib.c to be omitted from the compile and load of gdb.
Hacking Makfile to include compilation and inclusion of this object has
proven it's needed, as my own testing has indicated. 

Why would NetBSD omit this object when not compiling PICs?  (Rhetorical: hint-
the other BSDs don't omit it.)

I submit that changes to the makefile be committed to replace unconditional
inclusion of solib.c compilation and solib.o inclusion in the gdb linking.

Cheers,
	-skots
--
Scott G. Akmentins-Taylor     InterNet: staylor@mrynet.com
MRY Systems			        staylor@mrynet.lv
    (Skots Gregorijs Akmentins-Teilors -- just call me "Skots")
		----- Labak miris neka sarkans -----