Bug 1963 - collect2 interprets "-oldstyle_liblookup" as "-o ldstyle_liblookup"
Summary: collect2 interprets "-oldstyle_liblookup" as "-o ldstyle_liblookup"
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: other (show other bugs)
Version: 3.4.0
: P3 normal
Target Milestone: 3.4.1
Assignee: Rainer Orth
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-02-13 08:26 UTC by anonymous
Modified: 2004-04-30 20:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-04-29 18:02:06


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description anonymous 2001-02-13 08:26:00 UTC
If one passes -Wl,-oldstyle_liblookup to gcc
(in order to pass the option to ld),
collect2 interprets the option as specifying the 
output file.

i.e. "-ofoo" is the same as "-o foo"

In the latest snapshot, SWITCHES_NEED_SPACES can be defined
to prevent this problem,

Release:
gcc-3.4 originally reported for gcc 2.95.2 and latest snapshot

Environment:
alpha-dec-osf4.0a, also x86

How-To-Repeat:
gcc -o foo -Wl,-oldstyle_liblookup foo.c

Unformatted:
 From: epeisach@zif.mit.edu
 Reply-To: epeisach@zif.mit.edu
 X-Send-Pr-Version: gnatsweb-2.6 (1.135)
 X-GNATS-Notify:
Comment 1 anonymous 2001-02-13 08:26:00 UTC
Fix:
For 2.95 - without some recoding, nothing can be done,
for newer gcc's, define SWITCHES_NEED_SPACES "o" in
gcc/config/alpha/osf.h
Comment 2 Christian Ehrhardt 2003-04-16 21:12:28 UTC
State-Changed-From-To: open->analyzed
State-Changed-Why: This still happens, the problem is not arch specific. IMHO -Wl, should
    not treat any following -o as an option to gcc.
Comment 3 Andrew Pinski 2003-07-28 01:36:53 UTC
This is a dup of bug 5762 which contains a patch.

*** This bug has been marked as a duplicate of 5762 ***
Comment 4 Jan Jech 2003-10-22 21:17:23 UTC
Gcc 3.3.2 on Tru64 5.1A (alphaev56-dec-osf5.1) with patched collect2.c according
bug 5762.
Compiling Samba 3.0 with Active Directory support (need Kerberos) finish without
support of AD (configure doesn't recognize Kerberos)
Reason: gcc with options "-Wl,-oldstyle_liblookup" collect2 still interprets the
option as specifying the output file.

For example one message from log file:
configure:23198: checking for krb5_encrypt_data in -lk5crypto
configure:23229: gcc -o conftest -L/usr/local/BerkeleyDB.4.1/lib
-L/usr/local/ssl/lib -L/usr/local/include conftest.c -lk5crypto
-Wl,-oldstyle_liblookup -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lsecurity
-lresolv >&5
collect2: ldstyle_liblookup: cannot open as COFF file collect2: 

Jan Jech


Comment 5 Jan Jech 2003-10-23 17:50:10 UTC
Any suggestion to solve it?
Comment 6 Rainer Orth 2004-04-29 18:00:40 UTC
reopening ...
Comment 7 Rainer Orth 2004-04-29 18:02:05 UTC
... to confirm.  Patch to be submitted shortly.
Comment 8 Rainer Orth 2004-04-29 18:21:58 UTC
Patch here:

  http://gcc.gnu.org/ml/gcc-patches/2004-04/msg01920.html
Comment 9 GCC Commits 2004-04-30 20:09:54 UTC
Subject: Bug 1963

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	ro@gcc.gnu.org	2004-04-30 20:09:51

Modified files:
	gcc            : ChangeLog 
	gcc/config/alpha: osf.h 

Log message:
	PR other/1963
	* config/alpha/osf.h (SWITCHES_NEED_SPACES): Define.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3532&r2=2.3533
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/osf.h.diff?cvsroot=gcc&r1=1.35&r2=1.36

Comment 10 GCC Commits 2004-04-30 20:13:02 UTC
Subject: Bug 1963

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	ro@gcc.gnu.org	2004-04-30 20:12:57

Modified files:
	gcc            : ChangeLog 
	gcc/config/alpha: osf.h 

Log message:
	PR other/1963
	* config/alpha/osf.h (SWITCHES_NEED_SPACES): Define.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.427&r2=2.2326.2.428
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/alpha/osf.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.35&r2=1.35.4.1

Comment 11 Rainer Orth 2004-04-30 20:14:27 UTC
Fixed for 3.4.1, 3.5.