This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: build failure on powerpc-darwin, GCC trunk revision 132159


On Fri, Feb 08, 2008 at 11:53:09PM +0100, Matthias Klose wrote:
> Geoff Keating schrieb:
> > Between revision 132140 and 132159, GCC trunk started failing to
> > bootstrap on powerpc-darwin, with errors building libjava, like:
> > 
> > /usr/bin/ld: multiple definitions of symbol java resource
> > sun/rmi/rmic/messages.properties
> > /Users/regress/tbox/native/build/powerpc-apple-darwin8.5.0/libjava/.libs/libgcj.dylib(single
> > module) definition of java resource sun/rmi/rmic/messages.properties
> > ./.libs/libgcj-tools.dylib(single module) definition of java resource
> > sun/rmi/rmic/messages.properties
> > 
> > and eventually
> > 
> > make[3]: *** [grmic] Error 1
> > 
> > This change seems most likely to have caused it:
> > 
> > r132156 | doko | 2008-02-06 11:22:53 -0800 (Wed, 06 Feb 2008) | 6 lines
> > Changed paths:
> >    M /trunk/libjava/classpath/ChangeLog.gcj
> >    M /trunk/libjava/classpath/tools/Makefile.am
> >    M /trunk/libjava/classpath/tools/Makefile.in
> > 
> > 2008-02-06  Matthias Klose  <doko@ubuntu.com>
> > 
> >         * tools/Makefile.am ($(TOOLS_ZIP)): Copy over rmic template files.
> >         Copy resource files independent of JAVA_MAINTAINER_MODE.
> >         * tools/Makefile.in: Regenerate.
> > 
> 
> The attached patch should fix this, by avoiding the inclusion of the
> *.properties files in the libgcj-tools.jar.
> 
> I don't yet understand why these appear twice. in
> libjava/classpath/tools/Makefile.am, only the class files are written into
> all-classes.lst. libjava/Makefile compiles libgcj-tools.jar using
> --filelist=all-classes.lst, so these should not appear there again.

libjava/sources.am lists all *.properties files in property_files
variable and while those aren't added to libgcj*.jar, they are linked into
libgcj.so:
libgcj_la_LIBADD = \
        classpath/native/fdlibm/libfdlibm.la \
        java/lang/Object.lo \
        java/lang/Class.lo \
        java/process-$(PLATFORM).lo \
        $(all_packages_source_files:.list=.lo) \
        $(bc_objects) \
        $(propertyo_files) \
        $(LIBFFI) $(ZLIBS) $(GCLIBS)
...
## Note that property_files is defined in sources.am.
propertyo_files = $(patsubst classpath/resource/%,%,$(addsuffix .lo,$(property_files)))

$(propertyo_files): %.lo: classpath/resource/%
	$(mkinstalldirs) `dirname $@`; \
	$(LTGCJCOMPILE) -o $@ -c $< -Wc,--resource,$(@:.lo=)

Thus we get all property files linked into libgcj.so and most of them also
linked into libgcj-tools.so.

See
nm libgcj.so.9 | grep \.properties | awk '{print $3}' | grep -v GLOBAL | LC_ALL=C sort
and
nm libgcj-tools.so.9 | grep \.properties | awk '{print $3}' | grep -v GLOBAL | LC_ALL=C sort

libgcj-tools.so contains a subset of the *.properties files from libgcj.so,
libgcj-4.3.0.jar none:
unzip -l ../libgcj-4.3.0.jar | grep properties
and libgcj-tools-4.3.0.jar some:
unzip -l ../libgcj-tools-4.3.0.jar | grep properties

On Linux typically the symbols are hidden and even if not, the dynamic
linker would pick the ones earlier in the search scope.  Guess darwin can't
cope with symbol interposition.

The patch below would fix build on darwin when not
--enable-java-maintainer-mode I guess, java maintainer mode would be still
broken.  I think the important question is, do we want/need the tools properties
in libgcj.so (then we would need to ensure the *.properties files are just
in *.jar file, not in libgcj-tools.so), or should they just be in
libgcj-tools*.{so,jar} (then those that are in tools.zip should be nuked
from source.am (property_files) ).
This is a 4.3 rc blocker, can we get this resolved soon?

> libjava/classpath/ChangeLog.gcj
> 
> 2008-02-08  Matthias Klose  <doko@ubuntu.com>
> 
> 	* tools/Makefile.am ($(TOOLS_ZIP)): Revert part of previous change,
> 	Do copy resource files in JAVA_MAINTAINER_MODE only.
> 	* tools/Makefile.in: Regenerate.
>  
> Index: libjava/classpath/tools/Makefile.am
> ===================================================================
> --- libjava/classpath/tools/Makefile.am	(revision 132188)
> +++ libjava/classpath/tools/Makefile.am	(working copy)
> @@ -186,7 +186,6 @@
>  	AC=`echo $(JCOMPILER) | sed -e 's/UTF-8/ISO-8859-1/g'`; \
>  	  $$AC -g -w -d $(srcdir)/asm @asm.lst
>  	$(JCOMPILER) -g -w -d $(srcdir)/classes @classes.lst @vm-tools.lst
> -endif
>  ## Copy over tools resource files.
>  	@list=`cd $(top_srcdir)/resource && find gnu/classpath/tools \
>  	       com/sun/javadoc com/sun/tools/doclets com/sun/tools/javac \
> @@ -197,6 +196,7 @@
>  	  echo "  cp $(top_srcdir)/resource/$$p classes/$$p"; \
>  	  cp $(top_srcdir)/resource/$$p classes/$$p; \
>  	done
> +endif
>  ## Copy over rmic template files.
>  	@list=`cd $(srcdir) && find gnu/classpath/tools -name \*.jav -print`; \
>  	for p in $$list; do \


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]