public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
@ 2010-08-12  1:39 Joseph S. Myers
  2010-08-12  3:51 ` Steve Kargl
  2010-08-15  0:00 ` Alan Modra
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph S. Myers @ 2010-08-12  1:39 UTC (permalink / raw)
  To: gcc-patches, fortran

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
  2010-08-12  1:39 Fix -MD/-MMD interface difference between driver and cc1/f951 etc Joseph S. Myers
@ 2010-08-12  3:51 ` Steve Kargl
  2010-08-15  0:00 ` Alan Modra
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Kargl @ 2010-08-12  3:51 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches, fortran

On Thu, Aug 12, 2010 at 12:52:17AM +0000, Joseph S. Myers wrote:
> 
> 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.
> 

The Fortran bits are ok.

-- 
Steve

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
  2010-08-12  1:39 Fix -MD/-MMD interface difference between driver and cc1/f951 etc Joseph S. Myers
  2010-08-12  3:51 ` Steve Kargl
@ 2010-08-15  0:00 ` Alan Modra
  2010-08-15  7:01   ` Andrew Pinski
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Modra @ 2010-08-15  0:00 UTC (permalink / raw)
  To: Joseph S. Myers; +Cc: gcc-patches, fortran

On Thu, Aug 12, 2010 at 12:52:17AM +0000, Joseph S. Myers wrote:
> 	* cpp.c (gfc_cpp_handle_option): Use OPT_MMD and OPT_MMDX.

This happens to break all linux-2.6.x and at least some linux-2.5.x
kernel builds, which use -Wp,-MD,...

-- 
Alan Modra
Australia Development Lab, IBM

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Fix -MD/-MMD interface difference between driver and cc1/f951 etc.
  2010-08-15  0:00 ` Alan Modra
@ 2010-08-15  7:01   ` Andrew Pinski
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Pinski @ 2010-08-15  7:01 UTC (permalink / raw)
  To: Joseph S. Myers, gcc-patches, fortran

On Sat, Aug 14, 2010 at 4:59 PM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Aug 12, 2010 at 12:52:17AM +0000, Joseph S. Myers wrote:
>>       * cpp.c (gfc_cpp_handle_option): Use OPT_MMD and OPT_MMDX.
>
> This happens to break all linux-2.6.x and at least some linux-2.5.x
> kernel builds, which use -Wp,-MD,...

This has already been fixed. See
http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01048.html .

Thanks,
Andrew Pinski

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-15  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-12  1:39 Fix -MD/-MMD interface difference between driver and cc1/f951 etc Joseph S. Myers
2010-08-12  3:51 ` Steve Kargl
2010-08-15  0:00 ` Alan Modra
2010-08-15  7:01   ` Andrew Pinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).