------- 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 = <generate random string>();
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

Reply via email to