This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Thu, 12 Aug 2010 00:52:17 +0000 (UTC)
- Subject: Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
When fixing incompatibilities between whether particular options take
arguments in the driver and in the compilers proper
<http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02225.html>
<http://gcc.gnu.org/ml/gcc-patches/2010-07/msg02340.html>, I missed
that this issue also applied to the -MD and -MMD options and found
that in the course of testing the patch to make the driver use shared
option processing machinery.
This patch fixes this issue by changing the internal options (taking
arguments) used by cc1 etc. to -MDX and -MMDX, leaving the external
options (to the driver, not taking arguments) unchanged. (The
alternative of using -MD= and -MMD= runs into issues with specs
generating separate arguments in some cases when not desired.)
Bootstrapped with no regressions on x86_64-unknown-linux-gnu. OK to
commit (the driver and Fortran pieces)?
2010-08-12 Joseph Myers <joseph@codesourcery.com>
* gcc.c (cpp_unique_options): Generate -MDX and -MMDX from -MD and
-MMD.
c-family:
2010-08-12 Joseph Myers <joseph@codesourcery.com>
* c.opt (MD, MMD): Change to MDX and MMDX.
* c-opts.c (c_common_handle_option): Use OPT_MMD and OPT_MMDX.
fortran:
2010-08-12 Joseph Myers <joseph@codesourcery.com>
* lang.opt (MD, MMD): Change to MDX and MMDX.
* cpp.c (gfc_cpp_handle_option): Use OPT_MMD and OPT_MMDX.
Index: c-family/c.opt
===================================================================
--- c-family/c.opt (revision 163095)
+++ c-family/c.opt (working copy)
@@ -72,9 +72,9 @@ M
C ObjC C++ ObjC++
Generate make dependencies
-MD
+MDX
C ObjC C++ ObjC++ Separate MissingArgError(missing filename after %qs)
-Generate make dependencies and compile
+-MD Generate make dependencies and compile
MF
C ObjC C++ ObjC++ Joined Separate MissingArgError(missing filename after %qs)
@@ -88,9 +88,9 @@ MM
C ObjC C++ ObjC++
Like -M but ignore system header files
-MMD
+MMDX
C ObjC C++ ObjC++ Separate MissingArgError(missing filename after %qs)
-Like -MD but ignore system header files
+-MMD Like -MD but ignore system header files
MP
C ObjC C++ ObjC++
Index: c-family/c-opts.c
===================================================================
--- c-family/c-opts.c (revision 163095)
+++ c-family/c-opts.c (working copy)
@@ -398,9 +398,9 @@ c_common_handle_option (size_t scode, co
flag_no_output = 1;
break;
- case OPT_MD:
- case OPT_MMD:
- cpp_opts->deps.style = (code == OPT_MD ? DEPS_SYSTEM: DEPS_USER);
+ case OPT_MDX:
+ case OPT_MMDX:
+ cpp_opts->deps.style = (code == OPT_MDX ? DEPS_SYSTEM: DEPS_USER);
cpp_opts->deps.need_preprocessor_output = true;
deps_file = arg;
break;
Index: gcc.c
===================================================================
--- gcc.c (revision 163095)
+++ gcc.c (working copy)
@@ -829,8 +829,8 @@ static const char *trad_capable_cpp =
file that happens to exist is up-to-date. */
static const char *cpp_unique_options =
"%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*&F*} %{P} %I\
- %{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\
- %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
+ %{MD:-MDX %{!o:%b.d}%{o*:%.d%*}}\
+ %{MMD:-MMDX %{!o:%b.d}%{o*:%.d%*}}\
%{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
%{!E:%{!M:%{!MM:%{!MT:%{!MQ:%{MD|MMD:%{o*:-MQ %*}}}}}}}\
%{remap} %{g3|ggdb3|gstabs3|gcoff3|gxcoff3|gvms3:-dD}\
Index: fortran/cpp.c
===================================================================
--- fortran/cpp.c (revision 163095)
+++ fortran/cpp.c (working copy)
@@ -456,11 +456,11 @@ gfc_cpp_handle_option (size_t scode, con
gfc_cpp_option.deps = 1;
break;
- case OPT_MMD:
+ case OPT_MMDX:
gfc_cpp_option.deps_skip_system = 1;
/* fall through */
- case OPT_MD:
+ case OPT_MDX:
gfc_cpp_option.deps = 1;
gfc_cpp_option.deps_filename = arg;
break;
Index: fortran/lang.opt
===================================================================
--- fortran/lang.opt (revision 163095)
+++ fortran/lang.opt (working copy)
@@ -60,7 +60,7 @@ M
Fortran
; Documented in C
-MD
+MDX
Fortran Separate
; Documented in C
@@ -76,7 +76,7 @@ MM
Fortran
; Documented in C
-MMD
+MMDX
Fortran Separate
; Documented in C
--
Joseph S. Myers
joseph@codesourcery.com