diff options
author | Dave Korn <dave.korn.cygwin@gmail.com> | 2010-03-21 19:41:37 +0000 |
---|---|---|
committer | Dave Korn <davek@gcc.gnu.org> | 2010-03-21 19:41:37 +0000 |
commit | 474b97ce0ff47918ce4fb78b4ee970d4009ecf02 (patch) | |
tree | 3802590e4709444b1219175a10f94cc33e72acb9 /libjava/Makefile.am | |
parent | 713812e2445496115c6cc9d789b2662cdd2225dc (diff) | |
download | gcc-474b97ce0ff47918ce4fb78b4ee970d4009ecf02.zip gcc-474b97ce0ff47918ce4fb78b4ee970d4009ecf02.tar.gz gcc-474b97ce0ff47918ce4fb78b4ee970d4009ecf02.tar.bz2 |
re PR target/42811 (java.lang.ExceptionInInitializerError in ecj1)
PR target/42811
* libjava/configure.ac (DLLTOOL): Call AC_CHECK_TOOL.
(libgcj_sublib_core_extra_deps): New host-dependent configure var.
(LIBGCJ_SUBLIB_CORE_EXTRA_DEPS): AC_SUBST it.
* libjava/configure.host (libgcj_sublib_core_extra_deps): Define
appropriately on Cygwin and MinGW.
(libgcj_sublib_core_extra_deps): Add libgcj-noncore-dummy import
stub library on Cygwin and MinGW.
* libjava/Makefile.am (LIBJAVA_CORE_EXTRA): Import AC_SUBST'd
LIBGCJ_SUBLIB_CORE_EXTRA_DEPS if building sublibs, else define empty.
(libgcj_la_DEPENDENCIES): Use it.
(DLL_VERSION): New makefile macro.
(libgcj-noncore-dummy.dll.a): New build rule for dummy import stub
library.
(libgcj_noncore_la_LIBADD): Trim superfluous convenience libs.
(AM_MAKEFLAGS): Add DLLTOOL recursive propagation.
* libjava/libgcj-noncore-dummy.def: New file.
* libjava/Makefile.in: Regenerate.
* libjava/include/Makefile.in: Likewise.
* libjava/testsuite/Makefile.in: Likewise.
* libjava/configure: Likewise.
* libjava/gcj/Makefile.in: Likewise.
From-SVN: r157606
Diffstat (limited to 'libjava/Makefile.am')
-rw-r--r-- | libjava/Makefile.am | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libjava/Makefile.am b/libjava/Makefile.am index 11c60df..190c686 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -202,11 +202,13 @@ toolexeclib_LTLIBRARIES += libgcj-noncore.la libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO) libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO) LIBJAVA_LDFLAGS_NOUNDEF = $(LIBGCJ_SUBLIB_LTFLAGS) +LIBJAVA_CORE_EXTRA = @LIBGCJ_SUBLIB_CORE_EXTRA_DEPS@ else # If not building sublibraries, everything goes in libgcj, # and it cannot be usefully built shared on PE platforms. libgcj_la_LIBADD_SUBOBJECTS = $(ALL_PACKAGE_SOURCE_FILES_LO) LIBJAVA_LDFLAGS_NOUNDEF = +LIBJAVA_CORE_EXTRA = endif if USE_LIBGCJ_BC @@ -460,7 +462,8 @@ libgcj_la_DEPENDENCIES = libgcj-$(gcc_version).jar \ java/lang/Class.lo \ java/process-$(PLATFORM).lo \ $(ALL_PACKAGE_SOURCE_FILES_LO) \ - $(LIBLTDL) $(libgcj_la_LIBADD) + $(LIBLTDL) $(libgcj_la_LIBADD) \ + $(LIBJAVA_CORE_EXTRA) if ANONVERSCRIPT libgcj_la_DEPENDENCIES += $(srcdir)/libgcj.ver endif @@ -472,17 +475,28 @@ libgcj_la_LINK = $(LIBLINK) $(libgcj_la_LDFLAGS) EXTRA_libgcj_la_SOURCES = java/lang/Object.java if BUILD_SUBLIBS +## This extra target is invoked on windows hosts only by adding it +## to LIBGCJ_SUBLIB_CORE_EXTRA_SRCS in configure.host, which causes +## it to be linked in to the core DLL and generate a circular import +## dependency loop between the two DLLs. This is required to fix +## PR42811 by ensuring that any application that links against +## either always loads both at runtime. +DLL_VERSION=`expr \`grep -v '^\#' $(srcdir)/libtool-version | sed -e 's/\(.*\):\(.*\):.*/\1 + \2/'\`` +libgcj-noncore-dummy.dll.a : $(srcdir)/libgcj-noncore-dummy.def + $(DLLTOOL) -d $^ -l $@ --dllname cyggcj-noncore-$(DLL_VERSION).dll + +## These are the libtool definitions for the noncore library. libgcj_noncore_la_SOURCES = libgcj_noncore_la_LDFLAGS = $(libgcj_la_LDFLAGS) -libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) \ - $(LIBFFI) $(ZLIBS) $(GCLIBS) libgcj.la +libgcj_noncore_la_LIBADD = $(libgcj_noncore_la_LIBADD_SUBOBJECTS) libgcj.la libgcj_noncore_la_DEPENDENCIES = libgcj-$(gcc_version).jar $(LIBLTDL) \ $(libgcj_noncore_la_LIBADD) libgcj.la if ANONVERSCRIPT libgcj_noncore_la_DEPENDENCIES += $(srcdir)/libgcj.ver endif libgcj_noncore_la_LINK = $(libgcj_la_LINK) -endif + +endif # BUILD_SUBLIBS # We compile libgcj_tools with -findirect-dispatch so that they can # depend on external classes: in particular, gjdoc uses antlr. In @@ -1513,6 +1527,7 @@ AM_MAKEFLAGS = \ "gxx_include_dir=$(gxx_include_dir)" \ "AR=$(AR)" \ "AS=$(AS)" \ + "DLLTOOL=$(DLLTOOL)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ |