build regression
Neil Booth
neil@daikokuya.co.uk
Sat Jun 14 19:03:00 GMT 2003
Tom Tromey wrote:-
> On the trunk, libgcj fails to build:
>
> /home/tromey/gnu/Trunk/build/gcc/gcj -B/home/tromey/gnu/Trunk/build/i686-pc-linux-gnu/libjava/ -B/home/tromey/gnu/Trunk/build/gcc/ --encoding=UTF-8 -Wno-deprecated -fclasspath= -fbootclasspath=/home/tromey/gnu/Trunk/build/i686-pc-linux-gnu/libjava -ffloat-store -g -MD -MT java/lang/Class.lo -MF java/lang/Class.d -c ../../../gcc/libjava/java/lang/Class.java -fPIC -o java/lang/.libs/Class.o
> java/lang/Class.lo:0: fatal error: can't open java/lang/Class.lo: No such file or directory
> compilation terminated.
>
> I suspect one of the recent option processing changes in gcc.
> It appears that gcc thinks that the argument to -MT is an input file
> of some sort.
Sorry for the breakage; I had it too but erroneously considered it
unrelated to my changes.
The -MD is swallowing the -MT because the option machinery thinks
-MD takes an option - it does for C but not for Java at the front-end
level. All front ends need to agree on how switches take arguments
now that their handling is combined.
I've done a rudimentary test of the patch below (without actually
building Java) that it had the correct behaviour w.r.t. -MD swallowing
an argument or not. I'll do a little more testing and check it in so
others can continue to hopefully build java.
Neil.
* gcc.c (cpp_unique_options): Rewrite -MD and -MMD to append
an underscore.
* c-opts.c (missing_arg, c_common_handle_option): Rename
OPT_MD and OPT_MMD to OPT_MD_ and OPT_MMD_.
* c.opt: Take MD_ and MMD_ instead of MD and MMD.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.379
diff -u -p -b -r1.379 gcc.c
--- gcc.c 4 Jun 2003 17:50:40 -0000 1.379
+++ gcc.c 14 Jun 2003 18:51:03 -0000
@@ -739,8 +739,8 @@ static const char *trad_capable_cpp =
static const char *cpp_unique_options =
"%{C|CC:%{!E:%eGCC does not support -C or -CC without -E}}\
%{!Q:-quiet} %{nostdinc*} %{C} %{CC} %{v} %{I*} %{P} %I\
- %{MD:-MD %{!o:%b.d}%{o*:%.d%*}}\
- %{MMD:-MMD %{!o:%b.d}%{o*:%.d%*}}\
+ %{MD:-MD_ %{!o:%b.d}%{o*:%.d%*}}\
+ %{MMD:-MMD_ %{!o:%b.d}%{o*:%.d%*}}\
%{M} %{MM} %{MF*} %{MG} %{MP} %{MQ*} %{MT*}\
%{!E:%{!M:%{!MM:%{MD|MMD:%{o*:-MQ %*}}}}}\
%{trigraphs} %{remap} %{g3:-dD} %{H} %C %{D*&U*&A*} %{i*} %Z %i\
Index: c-opts.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-opts.c,v
retrieving revision 1.57
diff -u -p -b -r1.57 c-opts.c
--- c-opts.c 14 Jun 2003 12:26:28 -0000 1.57
+++ c-opts.c 14 Jun 2003 18:51:03 -0000
@@ -176,8 +176,8 @@ missing_arg (enum opt_code code)
break;
case OPT_MF:
- case OPT_MD:
- case OPT_MMD:
+ case OPT_MD_:
+ case OPT_MMD_:
case OPT_include:
case OPT_imacros:
case OPT_o:
@@ -336,9 +336,9 @@ c_common_handle_option (size_t scode, co
cpp_opts->inhibit_warnings = 1;
break;
- case OPT_MD:
- case OPT_MMD:
- cpp_opts->deps.style = (code == OPT_MD ? DEPS_SYSTEM: DEPS_USER);
+ case OPT_MD_:
+ case OPT_MMD_:
+ cpp_opts->deps.style = (code == OPT_MD_ ? DEPS_SYSTEM: DEPS_USER);
deps_file = arg;
break;
Index: c.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c.opt,v
retrieving revision 1.3
diff -u -p -b -r1.3 c.opt
--- c.opt 2 Jun 2003 05:48:29 -0000 1.3
+++ c.opt 14 Jun 2003 18:51:03 -0000
@@ -73,7 +73,7 @@ C ObjC C++ ObjC++ Joined Separate
M
C ObjC C++ ObjC++
-MD
+MD_
C ObjC C++ ObjC++ Separate
MF
@@ -85,7 +85,7 @@ C ObjC C++ ObjC++
MM
C ObjC C++ ObjC++
-MMD
+MMD_
C ObjC C++ ObjC++ Separate
MP
More information about the Gcc-patches
mailing list