NetBSD Problem Report #7221

Received: (qmail 17377 invoked from network); 24 Mar 1999 08:24:07 -0000
Message-Id: <xofpv5zthwc.fsf@blubb.pdc.kth.se>
Date: 24 Mar 1999 09:24:03 +0100
From: joda@pdc.kth.se (Johan Danielsson)
To: gnats-bugs@gnats.netbsd.org
Subject: ld.new Makefile has confused SCRIPTDIR

>Number:         7221
>Category:       bin
>Synopsis:       ld.new Makefile has confused SCRIPTDIR
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 24 00:35:00 +0000 1999
>Closed-Date:    Mon Aug 02 16:42:08 +0000 1999
>Last-Modified:  Mon Aug 02 16:43:14 +0000 1999
>Originator:     Johan Danielsson
>Release:        1999-03-23
>Organization:
>Environment:
System: NetBSD blubb.pdc.kth.se 1.3I NetBSD 1.3I (BLUBB) #23: Thu Feb 11 02:12:34 CET 1999 root@:/usr/misc/src/netbsd/netbsd-current/src/sys/arch/i386/compile/BLUBB i386


>Description:

src/gnu/usr.bin/ld.new/Makefile sets SCRIPTDIR to
/usr/share/ldscripts, but ld looks for `ldscripts' in that directory
(that is the .x* files are in /usr/share/ldscripts, but ld looks for
`ldscripts' in /usr/share/ldscripts, and if found adds
/usr/share/ldscripts to the library search path).

>How-To-Repeat:

This is with a hacked ld.new that actually looks for ldscripts (and
doesn't compile in everything - that's another feature of the
Makefile)

bash$ ktrace ./ld -m i386nbsd scrt0.o y.o  -L/usr/lib/aout -lgcc -lc -lgcc
bash$ kdump -m 128 | grep ldscr 
  7841 ld       NAMI  "/usr/share/ldscripts/ldscripts"
  7841 ld       NAMI  "ldscripts/i386nbsd.x"
  7841 ld       NAMI  "/usr/lib/aout/ldscripts/i386nbsd.x"
  7841 ld       NAMI  "/usr/share/ldscripts/ldscripts/i386nbsd.x"

But i386nbsd.x is really in /usr/share/ldscripts/i386nbsd.x.

>Fix:

This is something of a fix, but this will add /usr/share to the
library search list, which might not be desirable. Maybe ldscripts
doesn't belong in /usr/share, I guess that whoever wrote this intended
it to be in /usr/lib or some such.

This patch also makes just the default ld-target be compiled in.

--- Makefile	1999/03/18 08:13:05	1.1.1.7
+++ Makefile	1999/03/24 08:17:14
@@ -26,7 +26,7 @@
 CPPFLAGS+=	-I. -I${.CURDIR} -I${BFDOBJ} -I${DIST}/ld \
 		-I${DIST}/bfd -I${DIST}/include \
 		-DDEFAULT_EMULATION='"${DEFAULT_EMUL.${MACHINE_ARCH}}"' \
-		-DSCRIPTDIR=\"${SCRIPTDIR}\" \
+		-DSCRIPTDIR=\"${SCRIPTBASEDIR}\" \
 		-DTARGET='"${MACHINE_GNU_ARCH}--netbsd"' \
 		-DEMULATION_LIST='${EMULS:S/^/\&ld_/:S/$/_emulation,/} 0'
 LDADD+=		-L${BFDOBJ} -lbfd -lgnumalloc
@@ -35,7 +35,8 @@

 DIST=		${.CURDIR}/../../dist
 BFDOBJ!=	cd ${.CURDIR}/../../lib/libbfd; ${MAKE} print-objdir
-SCRIPTDIR=	/usr/share/ldscripts
+SCRIPTBASEDIR=	/usr/share
+SCRIPTDIR=	${SCRIPTBASEDIR}/ldscripts

 .PATH:		${DIST}/ld

@@ -89,7 +90,7 @@
 e${_EMUL_}.c: ${DIST}/ld/genscripts.sh ${DIST}/ld/emulparams/${_EMUL_}.sh
 	sh ${DIST}/ld/genscripts.sh ${DIST}/ld ${LIBDIR} \
 		${MACHINE_GNU_ARCH}-netbsd ${MACHINE_GNU_ARCH}-netbsd \
-		${MACHINE_GNU_ARCH}-netbsd ${_EMUL_} \
+		${MACHINE_GNU_ARCH}-netbsd ${DEFAULT_EMUL.${MACHINE_ARCH}} \
 		"" ${_EMUL_}
 .endfor

>Release-Note:
>Audit-Trail:

From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
To: joda@pdc.kth.se
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/7221: ld.new Makefile has confused SCRIPTDIR
Date: Mon, 2 Aug 1999 17:35:09 +0200 (MET DST)

 Just curious: 
 Does the problem described in PR 7221 still happen on 1.4? I was not able
 to reproduce _any_ reference to ldscripts...


  - Hubert

 -- 
 NetBSD - Better for your uptime than Viagra

State-Changed-From-To: open->closed 
State-Changed-By: hubertf 
State-Changed-When: Mon Aug 2 09:42:08 PDT 1999 
State-Changed-Why:  
This was fixed some time ago. 


- Hubert 

From: joda@pdc.kth.se (Johan Danielsson)
To: Hubert Feyrer <hubert.feyrer@rz.uni-regensburg.de>
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: bin/7221: ld.new Makefile has confused SCRIPTDIR
Date: 02 Aug 1999 18:40:15 +0200

 Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de> writes:

 > Does the problem described in PR 7221 still happen on 1.4? I was not able
 > to reproduce _any_ reference to ldscripts...

 Dunno about 1.4, but gnu/usr.bin/ld.new/Makefile:

 revision 1.9
 date: 1999/02/14 13:01:09;  author: lukem;  state: Exp;  lines: +5 -2
 * fix pax to install in /usr/share/ldscripts not /usr/share/ldscripts/ldscripts
 * chmod/chown files after pax

 /Johan
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.