public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* [JAVA,libtool]  Big libjava is biiiig.
@ 2009-05-06 15:55 Dave Korn
  2009-05-06 15:58 ` Dave Korn
  0 siblings, 1 reply; 27+ messages in thread
From: Dave Korn @ 2009-05-06 15:55 UTC (permalink / raw)
  To: java-patches, gcc


    Hi,

  As I'm sure everyone concerned is aware, libgcj is currently a bit of a
monolith.  Wighing in at 93M for a static archive, 73M for a shared library
(win32), it exports 82720 symbols.  Which is unfortunately 17184 more than the
system limit (64k) for a Windows DLL.

  The idea of breaking libjava up into smaller sublibraries has been mooted at
least a couple of times before (e.g. [*], [**]), but it's always raised issues
relating to backward compatibility.

  On windows we have no such back-compat issues to worry about; libjava has
not worked as a DLL in who-knows-how-long-if-ever.  I envisage that we could
very easily break it up into a bunch of separate (but presumably quite
inter-dependent) DLLs, and as a convenience we could provide a 'top-level'
libjava import library[***] that merged all the import libraries for the
individual DLLs.

  So I'm currently experimenting with a patch that adds a new option
"--enable-libgcj-sublibs" in libjava/configure.ac.  I may need to add a
dummy-link-and-relink stage to get the interdependencies working right, or I
might have to hack something in libtool, but the basic approach of adding a
bunch of extra libtool declarations based on $(filter)ing the full list of
dependencies from the complete libgcj_la_LIBADD definition seemed a reasonable
way to go:

+if BUILD_SUBLIBS
+libgcj_gnu_la_LIBADD = $(filter gnu/%.lo,$(libgcj_la_LIBADD)) -L$(here)/.libs
libgcj.la
+libgcj_java_la_LIBADD = $(filter java/%.lo,$(libgcj_la_LIBADD))
-L$(here)/.libs libgcj.la
+libgcj_javax_la_LIBADD = $(filter javax/%.lo,$(libgcj_la_LIBADD))
-L$(here)/.libs libgcj.la
+libgcj_misc_la_LIBADD = $(filter-out gnu/%.lo java/%.lo
javax/%.lo,$(libgcj_la_LIBADD)) -L$(here)/.libs libgcj.la
+endif

  Questions:

1)  Would this be a reasonable approach, specifically i) in adding a configure
option to cause sublibraries to be built, and ii) in using gmake's $(filter)
construct to crudely subdivide the libraries like this?

2)  Given that there's a bit of a logjam upstream, and not likely to be
another libtool release betwen now and the end of stage1, would it be
acceptable (in general) to hack on our in-tree libtool first and send patches
upstream second (thus still avoiding any potential future merge lossage)?


    cheers,
      DaveK
-- 
[*]   - http://gcc.gnu.org/ml/gcc/2005-04/threads.html#01450
[**]  - http://gcc.gnu.org/ml/java-patches/2005-q1/threads.html#00225
[***] - For those not familiar, when windows executables import symbols from
DLLs, they do so by statically linking against a so-named 'import library'
that contains .data section stubs that build the structures that constitute
the final exe's table of imports as understood by the runtime loader.


^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-08-28 19:56 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-06 15:55 [JAVA,libtool] Big libjava is biiiig Dave Korn
2009-05-06 15:58 ` Dave Korn
2009-05-06 16:15   ` Ralf Wildenhues
2009-05-06 16:30     ` David Daney
2009-05-06 16:33       ` Richard Guenther
2009-05-06 16:44         ` Andrew Haley
2009-08-22 15:31       ` Dave Korn
2009-08-22 23:41         ` Andrew Haley
2009-08-23  2:27           ` Dave Korn
2009-08-29  0:48         ` Tom Tromey
2009-08-29  2:39           ` David Daney
2009-08-29  7:50             ` Dave Korn
2009-05-06 17:00     ` Dave Korn
2009-05-08  1:00       ` Ralf Wildenhues
2009-05-11 17:27         ` Dave Korn
2009-05-11 17:33           ` Andrew Haley
2009-05-11 18:15             ` Dave Korn
2009-05-13 14:52             ` Dave Korn
2009-05-13 18:35               ` Andrew Haley
2009-05-13 18:49                 ` Dave Korn
2009-05-13 16:18           ` Dave Korn
2009-05-06 16:40   ` Andrew Haley
2009-05-06 16:57     ` Dave Korn
2009-05-06 17:19       ` Andrew Haley
2009-05-11 17:39         ` Dave Korn
2009-05-11 18:03           ` Andrew Haley
     [not found]     ` <7230133d0905060959h5371a608nff03cce1e1e98f47@mail.gmail.com>
2009-05-06 17:12       ` Dave Korn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).