Subject: bin/2524: building links with wrong libc_pic.a when DESTDIR set
To: None <gnats-bugs@NetBSD.ORG>
From: Phillip F Knaack <>
List: netbsd-bugs
Date: 06/06/1996 16:29:42
>Number:         2524
>Category:       bin
>Synopsis:       building links with wrong libc_pic.a when DESTDIR set
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jun  6 18:20:03 1996
>Originator:     Phillip F Knaack
   IDEA (Information Development for Extension Audiences)
>Release:        NetBSD 1.2_ALPHA (Wed Jun 5 1996 sup)
System: NetBSD 1.1B NetBSD 1.1B (NCREMP) #3: Sun May 5 11:44:44 CDT 1996 i386
  building 1.2_ALPHA on 1.1B, using DESTDIR variable set to "/usr/dest"

	The ld/rtld/Makefile links with "-lc_pic", but if DESTDIR is set
this is the wrong libc_pic.a (should be $DESTDIR/usr/lib/libc_pic.a).
	set DESTDIR, temporarily remove /usr/lib/libc_pic.a, and build 
/usr/src/gnu/usr.bin/ld/rtld; it will fail trying to link with the wrong one.
	The following patch (or something like it) will link with 
the correct (new) libc_pic.a:

*** gnu/usr.bin/ld/rtld/Makefile.old	Thu Jun  6 16:10:09 1996
--- gnu/usr.bin/ld/rtld/Makefile	Thu Jun  6 16:27:47 1996
*** 10,16 ****
--- 10,20 ----
  LDFLAGS+=-Bshareable -Bsymbolic -assert nosymbolic
+ .if !defined(DESTDIR)
  LDADD+=	-lc_pic
+ .else
+ LDADD+= $(DESTDIR)/usr/lib/libc_pic.a
+ .endif
  BINDIR= /usr/libexec
  MLINKS=	rtld.1