Bug 21112 - Xassembler and Xpreprocessor does not worked
Summary: Xassembler and Xpreprocessor does not worked
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: driver (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: 4.1.0
Assignee: Jim Wilson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-19 20:49 UTC by Jim Wilson
Modified: 2005-06-05 07:45 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.1.0
Known to fail: 3.4.0 4.0.0
Last reconfirmed: 2005-05-04 18:42:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jim Wilson 2005-04-19 20:49:03 UTC
The Xassembler and Xpreprocessor options don't work.  They accidentally pass
options to the linker in addition to the assembler and preprocessor.

For example, on linux, the assembler ignores the -D option, but the linker does
not.  If I try using -Xassembler to pass the -D option to the assembler, I get a
linker error.
aretha$ ./xgcc -B./ -Xassembler -D tmp.c
/usr/bin/ld: unrecognized option '-D'
/usr/bin/ld: use the --help option for usage information
collect2: ld returned 1 exit status

Adding the -v option confirms that -D got passed to both the assembler and the
linker, which is wrong.

The -Xpreprocessor option has the same implementation as -Xassembler, and hence
the same problem.
Comment 1 Andrew Pinski 2005-04-19 20:54:06 UTC
Confirmed.  -Xassebler did not exist in 3.3.3 but -Xpreprocessor did and works as expected.
Comment 2 GCC Commits 2005-05-04 17:20:49 UTC
Subject: Bug 21112

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	wilson@gcc.gnu.org	2005-05-04 17:20:44

Modified files:
	gcc            : ChangeLog gcc.c 

Log message:
	Fix the Xassembler and Xpreprocessor options, which have never worked right.
	PR driver/21112
	* gcc.c (process_command): In the second argv scan loop, ignore
	Xassembler and Xpreprocessor, along with their argument.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8599&r2=2.8600
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/gcc.c.diff?cvsroot=gcc&r1=1.456&r2=1.457

Comment 3 Jim Wilson 2005-05-04 18:42:51 UTC
Mine.

Andrew Pinski claims Xpreprocessor was in gcc-3.3.3 and works, but I can find no
evidence to support that.  It does not show up in a grep of FSF gcc-3.3.x
sources.  Also, the original patch that added Xassembler also added
Xpreprocessor, so I do not see how one could have existed before the other.
Comment 4 Jim Wilson 2005-05-04 18:51:00 UTC
Fixed on mainline.

I do not believe that there is any regression here, and hence I do not believe
that the patch needs to be applied to the gcc-3.4 or gcc-4.0 branches.  I'll
leave this open for now in case anyone wants to disagree with me.
Comment 5 Andrew Pinski 2005-05-04 18:51:29 UTC
(In reply to comment #3)
> Mine.

Woops I was wrong, I was looking at it wrongly.  I must have missed the warning:
gcc: unrecognized option `-Xpreprocessor'
Comment 6 Jim Wilson 2005-05-04 19:39:46 UTC
Since everyone agrees there is no regression, I am closing.