This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: libjava broken on the trunk on i386-darwin8.11
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Java Patches <java-patches at gcc dot gnu dot org>
- Date: Wed, 30 Sep 2009 02:47:51 +0100
- Subject: Re: libjava broken on the trunk on i386-darwin8.11
- References: <de8d50360909291615r2b2503bfp19911fdbf09acf45@mail.gmail.com> <de8d50360909291621m7847d21ej2b6198c95106fe7b@mail.gmail.com> <4AC29F50.8090509@gmail.com>
Dave Korn wrote:
> Andrew Pinski wrote:
>> And this was caused by Dave Korn's change on the 2009-09-22.
>> He added -no-undefined to libgij_la_LDFLAGS which causes libtool to
>> remove -Wl,-undefined -Wl,dynamic_lookup from the link line.
>
> Ow, sorry about that, I didn't know it would change things for Darwin. I'll
> whip up a fix that adds the flag only for windows platforms, thanks for the
> bug report.
I'm now bootstrapping this. Andrew, would you like to check if it fixes
your problem on Darwin?
libjava/ChangeLog:
* configure.host (libgcj_sublib_ltflags): New variable.
* configure.ac (LIBGCJ_SUBLIB_LTFLAGS): AC_SUBST variable for
the above in makefiles.
* configure: Regenerate.
* Makefile.am (libgcj_la_LDFLAGS_NOUNDEF): Rename from this ...
(LIBJAVA_LDFLAGS_NOUNDEF): ... to this, initialise from
LIBGCJ_SUBLIB_LTFLAGS (only when building sublibs), and ...
(libgij_la_LDFLAGS, libgcj_tools_la_LDFLAGS, libjvm_la_LDFLAGS,
lib_gnu_awt_xlib_la_LDFLAGS, libgcj_bc_la_LDFLAGS): ... use it in
all these places to replace hard-coded -no-undefined and -bindir
flags, as well as ...
(libgcj_la_LDFLAGS): ... updating existing reference here.
* Makefile.in: Regenerate.
* include/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
* gcj/Makefile.in: Likewise.
cheers,
DaveK
Index: configure.host
===================================================================
--- configure.host (revision 152310)
+++ configure.host (working copy)
@@ -18,6 +18,7 @@
# libgcj_cflags Special CFLAGS to use when building
# libgcj_cxxflags Special CXXFLAGS to use when building
# libgcj_javaflags Special JAVAFLAGS to use when building
+# libgcj_sublib_ltflags Special Libtool flags to use when building.
# libgcj_interpreter If the bytecode interpreter supports this platform.
# enable_java_net_default If java.net native code should be enabled by
# default.
@@ -41,6 +42,7 @@ libgcj_flags=
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
+libgcj_sublib_ltflags=
libgcj_interpreter=
enable_java_net_default=yes
enable_hash_synchronization_default=no
@@ -347,6 +349,7 @@ case "${host}" in
BACKTRACESPEC=
# Win32 DLLs are limited to 64k exported symbols each.
enable_libgcj_sublibs_default=yes
+ libgcj_sublib_ltflags=-no-undefined -bindir $(bindir)
;;
esac
Index: configure.ac
===================================================================
--- configure.ac (revision 152310)
+++ configure.ac (working copy)
@@ -206,11 +206,14 @@ AC_EXEEXT
# libgcj_cflags - host specific C compiler flags
# libgcj_cxxflags - host specific C++ compiler flags
# libgcj_javaflags - host specific Java compiler flags
+# libgcj_sublib_ltflags - host specific Libtool flags
+# (only used when building sublibs)
# and a number of others; see the list at the start of the file.
libgcj_cflags=
libgcj_cxxflags=
libgcj_javaflags=
+libgcj_sublib_ltflags=
. ${srcdir}/configure.host
@@ -223,11 +226,13 @@ fi
LIBGCJ_CFLAGS="${libgcj_cflags}"
LIBGCJ_CXXFLAGS="${libgcj_cxxflags}"
LIBGCJ_JAVAFLAGS="${libgcj_javaflags}"
+LIBGCJ_SUBLIB_LTFLAGS="${libgcj_sublib_ltflags}"
LIBGCJ_LD_SYMBOLIC="${libgcj_ld_symbolic}"
LIBGCJ_LD_SYMBOLIC_FUNCTIONS="${libgcj_ld_symbolic_functions}"
AC_SUBST(LIBGCJ_CFLAGS)
AC_SUBST(LIBGCJ_CXXFLAGS)
AC_SUBST(LIBGCJ_JAVAFLAGS)
+AC_SUBST(LIBGCJ_SUBLIB_LTFLAGS)
AC_SUBST(LIBGCJ_LD_SYMBOLIC)
AC_SUBST(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
Index: Makefile.am
===================================================================
--- Makefile.am (revision 152310)
+++ Makefile.am (working copy)
@@ -201,12 +201,12 @@ if BUILD_SUBLIBS
toolexeclib_LTLIBRARIES += libgcj-noncore.la
libgcj_noncore_la_LIBADD_SUBOBJECTS = $(NONCORE_PACKAGE_SOURCE_FILES_LO)
libgcj_la_LIBADD_SUBOBJECTS = $(CORE_PACKAGE_SOURCE_FILES_LO)
-libgcj_la_LDFLAGS_NOUNDEF = -no-undefined -bindir $(bindir)
+LIBJAVA_LDFLAGS_NOUNDEF = $(LIBGCJ_SUBLIB_LTFLAGS)
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)
-libgcj_la_LDFLAGS_NOUNDEF =
+LIBJAVA_LDFLAGS_NOUNDEF =
endif
if USE_LIBGCJ_BC
@@ -388,7 +388,7 @@ endif
## See jv_convert_LDADD.
libgij_la_LIBADD = -L$(here)/.libs libgcj.la
## The mysterious backslash in the grep pattern is consumed by make.
-libgij_la_LDFLAGS = -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
+libgij_la_LDFLAGS = -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
libgij_la_LINK = $(CXXLINK) $(libgij_la_LDFLAGS)
@@ -445,7 +445,7 @@ xlib_nat_files = $(xlib_nat_source_files:.cc=.lo)
# certain linuxthread functions get linked:
## The mysterious backslash in the grep pattern is consumed by make.
libgcj_la_LDFLAGS = -rpath $(toolexeclibdir) $(THREADLDFLAGS) $(extra_ldflags) $(THREADLIBS) \
- $(LIBLTDL) $(SYS_ZLIBS) $(libgcj_la_LDFLAGS_NOUNDEF) \
+ $(LIBLTDL) $(SYS_ZLIBS) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
$(LIBGCJ_LD_SYMBOLIC_FUNCTIONS)
libgcj_la_LIBADD = \
@@ -495,7 +495,7 @@ libgcj_tools_la_GCJFLAGS = $(AM_GCJFLAGS) -findire
-fsource-filename=$(here)/classpath/tools/all-classes.lst
libgcj_tools_la_LDFLAGS = -rpath $(toolexeclibdir) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF)
libgcj_tools_la_LIBADD = libgcj.la -lm
libgcj_tools_la_DEPENDENCIES = libgcj.la libgcj.spec
if BUILD_SUBLIBS
@@ -512,7 +512,7 @@ endif
## See jv_convert_LDADD.
libjvm_la_LIBADD = -L$(here)/.libs libgcj.la
libjvm_la_LDFLAGS = -avoid-version $(LIBGCJ_LD_SYMBOLIC) \
- -no-undefined -bindir $(bindir)
+ $(LIBJAVA_LDFLAGS_NOUNDEF)
libjvm_la_LINK = $(CXXLINK) $(libjvm_la_LDFLAGS)
## The .db file. This rule is only used for native builds, so it is
@@ -542,7 +542,7 @@ lib_gnu_awt_xlib_la_CPPFLAGS = \
## The mysterious backslash in the grep pattern is consumed by make.
lib_gnu_awt_xlib_la_LDFLAGS = ../libstdc++-v3/src/libstdc++.la \
@X_PRE_LIBS@ @X_LIBS@ -lX11 @X_EXTRA_LIBS@ \
- -rpath $(toolexeclibdir) -no-undefined -bindir $(bindir) \
+ -rpath $(toolexeclibdir) $(LIBJAVA_LDFLAGS_NOUNDEF) \
-version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LIBGCJ_LD_SYMBOLIC)
lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_awt_xlib_la_LDFLAGS)
@@ -552,7 +552,7 @@ lib_gnu_awt_xlib_la_LINK = $(LIBLINK) $(lib_gnu_aw
## This library is not linked against libgcj.
libgcj_bc_la_SOURCES = libgcj_bc.c
libgcj_bc_la_LDFLAGS = -rpath $(toolexeclibdir) -no-static -version-info 1:0:0 \
- $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) -no-undefined -bindir $(bindir)
+ $(LIBGCJ_LD_SYMBOLIC_FUNCTIONS) $(LIBJAVA_LDFLAGS_NOUNDEF)
libgcj_bc_la_DEPENDENCIES = libgcj.la
libgcj_bc_la_LINK = $(LIBLINK) $(libgcj_bc_la_LDFLAGS)
## This is specific to Linux/{Free,Net,Open}BSD/Hurd and perhaps few others.