Subject: bin/3783: Build failure for ranlib
To: None <gnats-bugs@gnats.netbsd.org>
From: Erik Bertelsen <erik@erik-be.uni-c.dk>
List: netbsd-bugs
Date: 06/24/1997 12:12:51
>Number:         3783
>Category:       bin
>Synopsis:       Build failure for ranlib
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jun 24 01:20:00 1997
>Last-Modified:
>Originator:     Erik Bertelsen
>Organization:
	
>Release:        <NetBSD-current source date>
>Environment:
	
System: NetBSD erik-be.uni-c.dk 1.2G NetBSD 1.2G (ERIKBE) #36: Sun Jun 22 17:45:29 MEST 1997 erik@erik-be.uni-c.dk:/sw/NetBSD/src/sys/arch/i386/compile/ERIKBE i386


>Description:
Building ranlib fails:

===> usr.bin/ranlib
cc -O -I/sw/NetBSD/src/usr.bin/ranlib -I/sw/NetBSD/src/usr.bin/ranlib/../ar  -Werror  -c /sw/NetBSD/src/usr.bin/ranlib/../ar/archive.c
cc -O -I/sw/NetBSD/src/usr.bin/ranlib -I/sw/NetBSD/src/usr.bin/ranlib/../ar  -Werror  -c /sw/NetBSD/src/usr.bin/ranlib/build.c
cc -O -I/sw/NetBSD/src/usr.bin/ranlib -I/sw/NetBSD/src/usr.bin/ranlib/../ar  -Werror  -c /sw/NetBSD/src/usr.bin/ranlib/../ar/misc.c
cc -O -I/sw/NetBSD/src/usr.bin/ranlib -I/sw/NetBSD/src/usr.bin/ranlib/../ar  -Werror  -c /sw/NetBSD/src/usr.bin/ranlib/ranlib.c
cc -O -I/sw/NetBSD/src/usr.bin/ranlib -I/sw/NetBSD/src/usr.bin/ranlib/../ar  -Werror  -c /sw/NetBSD/src/usr.bin/ranlib/touch.c
cc   -o ranlib archive.o build.o misc.o ranlib.o touch.o 
build.o: Undefined symbol `_emalloc' referenced from text segment
build.o: Undefined symbol `_emalloc' referenced from text segment
build.o: Undefined symbol `_emalloc' referenced from text segment
misc.o: Undefined symbol `_envtmp' referenced from text segment
misc.o: Undefined symbol `_envtmp' referenced from text segment
misc.o: Undefined symbol `_envtmp' referenced from text segment
misc.o: Undefined symbol `_envtmp' referenced from text segment


The reason is that ar's misc.c is being compiled instead of ranlib's own.

The following lines are from my /etc/mk.conf

BSDOBJDIR=/sw/NetBSD/obj
BSDSRCDIR=/sw/NetBSD/src
NOPROFILE=noprofile
NOLINT=nolint

OBJMACHINE=true
USR_OBJMACHINE=true

My (tedious) workaround is to change misc.c to have an absolute file name
while compiling misc.c and then back to a leaf filename while linking, not
too funny....



	regards
	Erik Bertelsen
>How-To-Repeat:
>Fix:
>Audit-Trail:
>Unformatted: