Re: [JAVA,libtool] Big libjava is biiiig.

Dave Korn <[email protected]>
Newsgroups gmane.comp.gcc.devel,gmane.comp.gcc.java.devel
Message-ID <[email protected]>
Andrew Haley wrote:

> Did you try my list of things to lift out?  I don't think there will be any
> interdependencies; the only problem might be that the reduction is not enough.

    Hi Andrew,

  I've had a quick hack at it now, and it's not doing what I'd hoped, so
possibly I've misunderstood what you intended, or am not grokking the
structure of java packages correctly.

  If I got the essence of your list right, you were indicating all the
packages that collectively amount to $(bc_objects) in the libjava makefile, yes?

  I tried adding libtool definitions to build a libjava-core which should if
I've got it right be exactly the same as libjava, but exclude the
$(bc_objects), and a libjava-noncore that only links in the $(bc_objects).  So
I've got these definitions in Makefile.am, immediately after all the
corresponding default libgcj_la_XXXX definitions:

-----------------------------<snip>-----------------------------
if BUILD_SUBLIBS
toolexeclib_LTLIBRARIES += libgcj-core.la libgcj-noncore.la
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_la_SOURCES = $(libgcj_la_SOURCES)
libgcj_noncore_la_SOURCES =
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_la_LDFLAGS = $(libgcj_la_LDFLAGS)
libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS)
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_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) \
--> note $(bc_objects) missing here as compared to libgcj_la_LIBADD.
	$(propertyo_files) \
	$(LIBFFI) $(ZLIBS) $(GCLIBS)
libgcj_noncore_la_LIBADD = $(bc_objects)
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_la_DEPENDENCIES = $(libgcj_la_DEPENDENCIES)
libgcj_noncore_la_DEPENDENCIES = $(libgcj_la_DEPENDENCIES) libgcj-core.la
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_la_DEPENDENCIES += $(srcdir)/libgcj.ver
libgcj_noncore_la_DEPENDENCIES += $(srcdir)/libgcj.ver
endif
-----------------------------<snip>
if BUILD_SUBLIBS
libgcj_core_la_LINK = $(libgcj_la_LINK)
libgcj_noncore_la_LINK = $(libgcj_la_LINK)
endif
-----------------------------<snip>-----------------------------

... where BUILD_SUBLIBS is my new AM_CONDITIONAL flag enabled by
--enable-libgcj-sublibs.

  However, the new libjava-core doesn't link, and appears to contain many
dependencies on the $(bc_objects) files, for e.g. fundamental language features:

gnu/java/awt/.libs/java2d.o:/gnu/gcc/gcc/libjava/classpath/gnu/java/awt/java2d/PolyEdge.java:135:
undefined reference to `int gnu::java::math::Fixed::div(int, int, int)'
gnu/java/awt/.libs/java2d.o:/gnu/gcc/gcc/libjava/classpath/gnu/java/awt/java2d/ScanlineConverter.java:419:
undefined reference to `int gnu::java::math::Fixed::div(int, int, int)'

... and even entire complex packages:

java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:689:
undefined reference to `org::w3c::dom::bootstrap::DOMImplementationRegistry*
org::w3c::dom::bootstrap::DOMImplementationRegistry::newInstance()'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:690:
undefined reference to `org::w3c::dom::DOMImplementation*
org::w3c::dom::bootstrap::DOMImplementationRegistry::getDOMImplementation(java::lang::String*)'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:692:
undefined reference to `org::w3c::dom::DOMImplementation::class$'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:694:
undefined reference to `org::w3c::dom::DOMImplementation::class$'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:695:
undefined reference to `org::w3c::dom::Document::class$'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:698:
undefined reference to `org::w3c::dom::Document::class$'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:699:
undefined reference to `org::w3c::dom::Document::class$'
java/.libs/util.o:/gnu/gcc/gcc/libjava/classpath/java/util/Properties.java:699:
undefined reference to `org::w3c::dom::Element::class$'

  So, did I do the partitioning wrong here?  Or have I misunderstood what you
were referring to as "interdependencies"?

    cheers,
      DaveK
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.