[Bug java/43302] [Regression] gcc creates "dummy" resources in object files

2010-05-03 Thread glarkin at FreeBSD dot org


--- Comment #3 from glarkin at FreeBSD dot org  2010-05-03 18:37 ---
(In reply to comment #2)
> Experimenting with -save-temps I noticed that the .dummy resource is in the
> .jar generated by ecj which seems to point to it as the main suspect.
> 

I believe that's correct - please see:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42143#c7

Thank you,
Greg Larkin


-- 

glarkin at FreeBSD dot org changed:

   What|Removed |Added

 CC|            |glarkin at FreeBSD dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43302



[Bug java/42143] [4.3/4.4/4.5/4.6 Regression] gcj creates "dummy" variables

2010-05-03 Thread glarkin at FreeBSD dot org


--- Comment #7 from glarkin at FreeBSD dot org  2010-05-03 18:36 ---
(In reply to comment #6)
> So can someone please comment on this?
> 

I recently encountered this problem while using gcc/gcj 4.5 with ecj-4.5.jar to
compile the pdftk utility (http://www.accesspdf.com/pdftk/) on FreeBSD.  I
maintain the pdftk port for FreeBSD, and I previously used gcc/gcj 4.2 with
ecj-4.3.jar without any problems.

I found a workaround by patching the pdftk Makefiles like so:

 ##
 # implicit rules for creating A from B

 %.o : %.java
$(GCJ) $(GCJFLAGS) -c $< -o $@
+   ${OBJCOPY} -L '_ZGr8_$$_dummy' $@

The FreeBSD objcopy command changes the .dummy resource from global scope to
local scope in each .o file.  After doing that, the pdftk link phase succeeded
instead of dying with a ton of "duplicate symbol" errors.

After searching for the source of the duplicate symbol, I think I found it
here:

http://gcc.gnu.org/ml/java-patches/2009-q1/msg00049.html

If the patch included in this message is the source of the duplicate symbol
problem, then I wonder if it could be fixed like so?

String someRandomString = ();
ZipEntry entry = new ZipEntry(".dummy" + someRandomString);

Feedback welcome,
Greg Larkin


-- 

glarkin at FreeBSD dot org changed:

   What|Removed |Added

     CC|            |glarkin at FreeBSD dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42143