Subject: pkg/10988: cross/binutils will not build with "." before "/usr/bin" in PATH
To: None <gnats-bugs@gnats.netbsd.org>
From: Steve Woodford <swoodfor@bluews.com>
List: netbsd-bugs
Date: 09/11/2000 04:14:24
>Number:         10988
>Category:       pkg
>Synopsis:       cross/binutils will not build with "." before "/usr/bin" in PATH
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 11 04:15:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Steve Woodford
>Release:        NetBSD-1.5_ALPHA2
>Organization:
>Environment:
System: NetBSD haggis 1.5_ALPHA2 NetBSD 1.5_ALPHA2 (HAGGIS) #0: Wed Aug 16 08:23:13 BST 2000 swoodfor@haggis:/u0/netbsd/src/sys/arch/i386/compile/HAGGIS i386


>Description:
The `configure' phase of building cross/binutils fails when the shell's
search path has "." before "/usr/bin".

When `configure' tries to compile "conftest.c", the compiler's link phase
falls over as follows:

===> Configuring for cross-binutils-2.9.1.1
Created "Makefile" in /u0/netbsd/pkgsrc/cross/binutils/work/binutils-2.9.1 using "mt-frag"
/usr/bin/cc
collect2: ld returned 33 exit status
*** The command 'cc -o conftest -O2   -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -Wl,-R/usr/pkg/lib -L/usr/pkg/lib conftest.c' failed.
*** You must set the environment variable CC to a working compiler.
*** Error code 1

Note the error from collect2. This is because it picks up the "ld" directory
within the binutils distribution, and presumably tries to exec(2) it. ;-)

[Note: This is arguably a bug in whatever collect2 uses to exec the linker; it
should at least stat(2) before it execs...]

>How-To-Repeat:
As a non-root user with "." before "/usr/bin" in the PATH environment
variable, try to build cross/binutils.

>Fix:
Modify PATH accordingly.
>Release-Note:
>Audit-Trail:
>Unformatted: