Niklas Hallqvist: gcj -fmain=foo --save-temps broken

Marc Espie Marc.Espie@liafa.jussieu.fr
Sat May 8 12:45:00 GMT 1999


This is from Niklas Hallqvist, who's experiencing some temporary email
problems with the ORBS setup. Please write him, and not me.

------- Forwarded Message

To: egcs@egcs.cygnus.com
Date: Sat, 08 May 1999 21:31:57 +0200
From: Niklas Hallqvist <niklas@petra.appli.se>

Hi!

Below is a shar archive of a test showing that gcj -fmain=foo
- --save-temps is broken.  The problem is that the "nice" naming of
- --save-temps causes a name clash when gcj needs to create its
temporary assembly file binding main to a specific class' main
method.  I also provide a suggested fix below, before the patch.

The environment is OpenBSD 2.5, the base egcs version is 990502.

Niklas

1999-05-08  Niklas Hallqvist  <niklas@appli.se>

	* jvspec.c (jvgenmain_spec): Give a guaranteed unique name to the
	generated files so clobbering won't occur in the presence of
	--save-temps.

- --- gcc/java/jvspec.c.orig	Sat May  8 21:27:22 1999
+++ gcc/java/jvspec.c	Sat May  8 21:25:51 1999
@@ -74,15 +74,15 @@
 #define COMBINE_INPUTS 0
 
 char jvgenmain_spec[] =
- -  "jvgenmain %i %{!pipe:%u.i} |\n\
- -   cc1 %{!pipe:%U.i} %1 \
+  "jvgenmain %i %{!pipe:%u.main.i} |\n\
+   cc1 %{!pipe:%U.main.i} %1 \
 		   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
 		   %{g*} %{O*} \
 		   %{v:-version} %{pg:-p} %{p} %{f*}\
 		   %{aux-info*}\
 		   %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- -		   %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%U.s}} |\n\
- -              %{!S:as %a %Y -o %d%w%u%O %{!pipe:%U.s} %A\n }";
+		   %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%U.main.s}} |\n\
+              %{!S:as %a %Y -o %d%w%u.main%O %{!pipe:%U.main.s} %A\n }";
 
 void
 lang_specific_driver (fn, in_argc, in_argv, in_added_libraries)

- ---8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<--
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	1.java
#	Makefile
#
echo x - 1.java
sed 's/^X//' >1.java << 'END-of-1.java'
Xclass A { public static void main (String args[]) {} }
END-of-1.java
echo x - Makefile
sed 's/^X//' >Makefile << 'END-of-Makefile'
XGCJ=	gcj
X
X1:	1.java
X	${GCJ} --save-temps -fmain=A 1.java
END-of-Makefile
exit


----- End forwarded message -----


More information about the Gcc-patches mailing list