NetBSD Problem Report #9527

Received: (qmail 13710 invoked from network); 3 Mar 2000 21:17:53 -0000
Message-Id: <200003032117.WAA20678@azenomei.knuffel.net>
Date: Fri, 3 Mar 2000 22:17:31 +0100 (CET)
From: rhialto@polder.ubc.kun.nl
Reply-To: rhialto@polder.ubc.kun.nl
To: gnats-bugs@gnats.netbsd.org
Subject: collect2 breaks if directory called ld too early in $PATH
X-Send-Pr-Version: 3.95

>Number:         9527
>Category:       bin
>Synopsis:       collect2 (and thus cc) breaks if directory called ld too early in $PATH
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 03 13:18:01 +0000 2000
>Closed-Date:    Mon Dec 17 22:02:24 +0000 2001
>Last-Modified:  Mon Dec 17 22:02:24 +0000 2001
>Originator:     Olaf 'Rhialto' Seibert
>Release:        1.4.1
>Organization:

>Environment:

System: NetBSD azenomei.falu.nl 1.4.1 NetBSD 1.4.1 (AZENOMEI) #22: Tue Feb 22 22:39:20 CET 2000 rhialto@azenomei.falu.nl:/usr/src/sys/arch/alpha/compile/AZENOMEI alpha


>Description:

	If you have a directory called "ld" in your $PATH before the
	real ld (the linker), you cannot compile any programs.
>How-To-Repeat:

Script started on Fri Mar  3 22:10:38 2000
azenomei.3:/tmp$ l c.c
-rw-r--r--  1 rhialto  wheel  18 Mar  3 21:27 c.c
azenomei.3:/tmp$ gcc c.c
azenomei.3:/tmp$ mkdir ld
azenomei.3:/tmp$ gcc c.c
collect2: ld returned 33 exit status
azenomei.3:/tmp$ echo $PATH
.:/home/rhialto/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/pkg/bin:/usr/pkg/sbin:/usr/X11R6/bin:/usr/games
azenomei.3:/tmp$ exit

Script done on Fri Mar  3 22:11:01 2000
>Fix:

	Workaround: put . at end of $PATH, if present.
	Fix: I didn't look at that, I'm trying to make a crosscompiler to
	the VAX ;-)
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: tv 
State-Changed-When: Mon Dec 17 14:00:44 PST 2001 
State-Changed-Why:  
First off, putting "." at the head of path is a botch.  Don't do that. 

This shouldn't be relevant to the new toolchain in -current.  With that said, 
historically, gcc has used $PATH if it cannot find a specific compiled-in path 
for ld.  If something else named "ld" is higher up in your $PATH, it's 
reasonable for gcc to expect that "ld" to be a more up to date or more useful 
version. 
>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.