Subject: Problems building with DESTDIR?
To: None <current-users@netbsd.org>
From: Rafal Boni <rafal@mediaone.net>
List: current-users
Date: 10/05/1999 15:03:30
I ran accross this while converting the last of my -current a.out x86 boxes
to ELF... amd, ld.new, and the binutils all failed to build with DESTDIR set
(to /../. in that case).

Having completed the conversion to ELF (well, I'm still planning on doing an
additional make build to make sure everything's been recompiled with the 
right compiler), I just tried to build amd again.

I'm building from sources from a SUP of 10/2.

The results are as follows:
	(1) DESTDIR unset.  amd builds fine
	(2) DESTDIR set to /.  amd fails to link:
		
cc   -o amd -nostdlib -L//usr/lib //usr/lib/crt0.o //usr/lib/crtbegin.o conf_parse.o conf_tok.o srvr_nfs.o srvr_amfs_auto.o sched.o rpc_fwd.o restart.o opts.o ops_unionfs.o ops_umapfs.o ops_ufs.o ops_tmpfs.o ops_tfs.o ops_pcfs.o ops_nullfs.o ops_nfs3.o ops_nfs.o ops_mfs.o ops_cdfs.o ops_autofs.o nfs_subr.o nfs_start.o nfs_prot_svc.o mntfs.o mapc.o map.o info_union.o info_passwd.o info_nis.o info_ndbm.o info_file.o info_hesiod.o get_args.o conf.o clock.o autil.o amq_svc.o amq_subr.o amfs_union.o amfs_toplvl.o amfs_root.o amfs_program.o amfs_nfsx.o amfs_nfsl.o amfs_linkx.o amfs_link.o amfs_inherit.o amfs_host.o amfs_error.o amfs_direct.o amfs_auto.o amd.o am_ops.o -L/home/doppelganger/src/current/src/usr.sbin/amd/libamu -lamu -lrpcsvc -ll -lgcc -lc -lgcc //usr/lib/crtend.o
srvr_nfs.o: In function `start_ping':
srvr_nfs.o(.text+0x50): undefined reference to `plog'
[...]
srvr_nfs.o: In function `got_portmap':
srvr_nfs.o(.text+0x125): undefined reference to `pickup_rpc_reply'
srvr_nfs.o(.text+0x1ca): undefined reference to `debug_flags'
srvr_nfs.o(.text+0x1da): undefined reference to `debug_flags'
[...]
srvr_nfs.o(.text+0x211): undefined reference to `rpc_msg_init'
srvr_nfs.o(.text+0x257): undefined reference to `make_rpc_packet'
srvr_nfs.o: In function `recompute_portmap':
srvr_nfs.o(.text+0x31b): undefined reference to `plog'
[...]
collect2: ld returned 1 exit status
*** Error code 1

Stop.

	Basically, it looks like the symbols from libamu are never picked
	up by the linker.  Has anyone seen similar things happening?  If
	not, I'll try and dig a bit deeper and file a PR; if so, I'd
	appreciate your insights into the hows and whys.

--rafal

----
Rafal Boni                                                   rafal@mediaone.net