Bug 3662 - egcs-1.1.2: gcc seems to use direcory "ld" as linker
egcs-1.1.2: gcc seems to use direcory "ld" as linker
Status: CLOSED DEFERRED
Product: Red Hat Linux
Classification: Retired
Component: egcs (Show other bugs)
6.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Cristian Gafton
:
: 5647 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-06-23 05:13 EDT by schludi
Modified: 2008-05-01 11:37 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-08-04 08:46:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description schludi 1999-06-23 05:13:52 EDT
this happens on redhat-6.0 with egcs-1.1.2-12 installed:

$ mkdir foo
$ cd foo
$ echo 'main(){return 0;}' > bar.c
$ /usr/bin/gcc -o bar bar.c
$ mkdir ld
$ /usr/bin/gcc -o bar bar.c
collect2: ld returned 33 exit status
Comment 1 Bill Nottingham 1999-06-23 10:37:59 EDT
Do you have the current directory in your path?
Comment 2 schludi 1999-06-24 01:51:59 EDT
yes, my PATH begins with ":". schludi
Comment 3 schludi 1999-06-24 02:02:59 EDT
Jeffrey A Law <law@cygnus.com> writes:

> Take "." out of your path.  Or at least put it at the end of your
> path.  You're
> a wonderful candidate for a trojan horse right now.
>
> jeff
I know that if PATH begins with ":", someone evil could do me some
harm. But this is what I want (as non-root user)!
If I say:

$ mkdir man
$ type man
man is /usr/bin/man

this is what I expect. Since the directory "man" is not an "program"
(though it has "x" bits) "type" ignores it. I think this is what gcc
should do when it searches for "ld".

regards,
	schludi
Comment 4 Jim Kingdon 1999-07-24 13:43:59 EDT
One could argue that gcc should behave like "type" and ignore
directories, but I can't say I see a big problem with the
current behavior.
Comment 5 Jim Kingdon 1999-08-04 08:46:59 EDT
The good news is that this has been fixed in the GCC development
version (2.96; Ian Lance Taylor's change of 4 Aug 1999).  The bad
news is that this GCC won't ship with Red Hat Linux for a while,
due to C++ incompatibilities.
Comment 6 Jim Kingdon 1999-10-08 09:37:59 EDT
*** Bug 5647 has been marked as a duplicate of this bug. ***

If there is a directory called "ld" in the current
directory, and your PATH searches the current directory
before other directories, the command "gcc x.c -o x" fails
with: "collect2: ld returned 33 exit status".  The problem
probably exists on all architectures and may occur under
other circumstances.  I have only tested it on RH6.0 x86.
Found while trying to run configure in binutils.

Note You need to log in before you can comment on or make changes to this bug.