This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Specs broken after removal of cpp0
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 13 May 2002 22:17:43 +0100
- Subject: Specs broken after removal of cpp0
Since we are starting to make decisions in the front end
that affect how the integrated preprocessor acts, we need
to ensure that the front end gets all its flags, even
when only preprocessing.
I noticed something was wrong on my alpha-cross just now
since "./cc1 -E -dD -mcpu=ev6 /dev/null" would work as
expected, with the correct defines and assertions for
the stated CPU, but "./xgcc -B./ -E -dD -mcpu=ev6 -xc /dev/null"
would ignore the -mcpu=ev6 command and set CPP up for
an ev4 target.
Since things are broken without this, and it's really a follow-
up to the alpha and other built-in patches, I'll apply this
once a bootstrap has completed.
Neil.
* gcc.c (trad_capable_cpp, default_compilers): Must pass
cc1_options to the front end even when only preprocessing.
cp:
* lang-specs.h: Similarly.
objc:
* lang-specs.h: Similarly.
Index: gcc/gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.315
diff -u -p -r1.315 gcc.c
--- gcc/gcc.c 13 May 2002 19:10:14 -0000 1.315
+++ gcc/gcc.c 13 May 2002 21:09:33 -0000
@@ -666,8 +666,9 @@ static const char *link_libgcc_spec = LI
appropriate -B options. */
static const char *trad_capable_cpp =
-"%{traditional|ftraditional|traditional-cpp:tradcpp0}\
- %{!traditional:%{!ftraditional:%{!traditional-cpp:cc1 -E}}}";
+"%{traditional|ftraditional|traditional-cpp:tradcpp0 %(cpp_options)}\
+ %{!traditional:%{!ftraditional:%{!traditional-cpp:cc1 -E\
+ %(cpp_unique_options) %(cc1_options)}}}";
static const char *cpp_unique_options =
"%{C:%{!E:%eGNU C does not support -C without using -E}}\
@@ -831,23 +832,23 @@ static const struct compiler default_com
{"@c",
/* cc1 has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps is given. */
- "%{E|M|MM:%(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)}\
+ "%{E|M|MM:%(trad_capable_cpp) -lang-c %{ansi:-std=c89}}\
%{!E:%{!M:%{!MM:\
%{traditional|ftraditional:\
%eGNU C no longer supports -traditional without -E}\
%{save-temps|traditional-cpp:%(trad_capable_cpp) \
- -lang-c %{ansi:-std=c89} %(cpp_options) %b.i \n\
+ -lang-c %{ansi:-std=c89} %b.i \n\
cc1 -fpreprocessed %b.i %(cc1_options)}\
%{!save-temps:%{!traditional-cpp:\
cc1 -lang-c %{ansi:-std=c89} %(cpp_unique_options) %(cc1_options)}}\
%{!fsyntax-only:%(invoke_as)}}}}", 0},
{"-",
"%{!E:%e-E required when input is from standard input}\
- %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)", 0},
+ %(trad_capable_cpp) -lang-c %{ansi:-std=c89}", 0},
{".h", "@c-header", 0},
{"@c-header",
"%{!E:%ecompilation of header file requested} \
- %(trad_capable_cpp) -lang-c %{ansi:-std=c89} %(cpp_options)", 0},
+ %(trad_capable_cpp) -lang-c %{ansi:-std=c89}", 0},
{".i", "@cpp-output", 0},
{"@cpp-output",
"%{!M:%{!MM:%{!E:cc1 -fpreprocessed %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}}}}", 0},
@@ -856,7 +857,7 @@ static const struct compiler default_com
"%{!M:%{!MM:%{!E:%{!S:as %(asm_debug) %(asm_options) %i %A }}}}", 0},
{".S", "@assembler-with-cpp", 0},
{"@assembler-with-cpp",
- "%(trad_capable_cpp) -lang-asm %(cpp_options)\
+ "%(trad_capable_cpp) -lang-asm\
%{!M:%{!MM:%{!E:%{!S:-o %{|!pipe:%g.s} |\n\
as %(asm_debug) %(asm_options) %{!pipe:%g.s} %A }}}}", 0},
#include "specs.h"
Index: gcc/objc/lang-specs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/lang-specs.h,v
retrieving revision 1.23
diff -u -p -r1.23 lang-specs.h
--- gcc/objc/lang-specs.h 24 Mar 2002 12:27:45 -0000 1.23
+++ gcc/objc/lang-specs.h 13 May 2002 21:09:34 -0000
@@ -25,7 +25,7 @@ Boston, MA 02111-1307, USA. */
{"@objective-c",
/* cc1obj has an integrated ISO C preprocessor. We should invoke the
external preprocessor if -save-temps or -traditional is given. */
- "%{E|M|MM:%(trad_capable_cpp) -lang-objc %{ansi:-std=c89} %(cpp_options)}\
+ "%{E|M|MM:%(trad_capable_cpp) -lang-objc %{ansi:-std=c89}}\
%{!E:%{!M:%{!MM:\
%{traditional|ftraditional|traditional-cpp:\
%eGNU Objective C no longer supports traditional compilation}\
Index: gcc/cp/lang-specs.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lang-specs.h,v
retrieving revision 1.47
diff -u -p -r1.47 lang-specs.h
--- gcc/cp/lang-specs.h 24 Mar 2002 12:27:42 -0000 1.47
+++ gcc/cp/lang-specs.h 13 May 2002 21:09:34 -0000
@@ -38,8 +38,8 @@ Boston, MA 02111-1307, USA. */
"%{E|M|MM:cc1plus -E -lang-c++ %{!no-gcc:-D__GNUG__=%v1}\
%{!Wno-deprecated:-D__DEPRECATED}\
%{!fno-exceptions:-D__EXCEPTIONS}\
- -D__GXX_ABI_VERSION=100\
- %{ansi:-D__STRICT_ANSI__ -trigraphs -$} %(cpp_options)}\
+ -D__GXX_ABI_VERSION=100 %{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
+ %(cpp_unique_options) %(cc1_options)}\
%{!E:%{!M:%{!MM:\
%{save-temps:cc1plus -E -lang-c++ \
%{!no-gcc:-D__GNUG__=%v1}\
@@ -47,7 +47,7 @@ Boston, MA 02111-1307, USA. */
%{!fno-exceptions:-D__EXCEPTIONS}\
-D__GXX_ABI_VERSION=100\
%{ansi:-D__STRICT_ANSI__ -trigraphs -$}\
- %(cpp_options) %b.ii \n}\
+ %(cpp_unique_options) %(cc1_options) %b.ii \n}\
cc1plus %{save-temps:-fpreprocessed %b.ii}\
%{!save-temps:%(cpp_unique_options)\
%{!no-gcc:-D__GNUG__=%v1} \