From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5109 invoked by alias); 21 Dec 2007 22:25:59 -0000 Received: (qmail 5093 invoked by uid 22791); 21 Dec 2007 22:25:58 -0000 X-Spam-Check-By: sourceware.org Received: from smtp1.dnsmadeeasy.com (HELO smtp1.dnsmadeeasy.com) (205.234.170.144) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Dec 2007 22:25:50 +0000 Received: from smtp1.dnsmadeeasy.com (localhost [127.0.0.1]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP id 1C34531109C; Fri, 21 Dec 2007 22:26:04 +0000 (UTC) X-Authenticated-Name: js.dnsmadeeasy X-Transit-System: In case of SPAM please contact abuse@dnsmadeeasy.com Received: from avtrex.com (unknown [67.116.42.147]) by smtp1.dnsmadeeasy.com (Postfix) with ESMTP; Fri, 21 Dec 2007 22:26:03 +0000 (UTC) Received: from [192.168.7.46] ([192.168.7.46]) by avtrex.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 21 Dec 2007 14:25:46 -0800 Message-ID: <476C3D6A.6060704@avtrex.com> Date: Fri, 21 Dec 2007 22:25:00 -0000 From: David Daney User-Agent: Thunderbird 1.5.0.12 (X11/20071019) MIME-Version: 1.0 To: Java Patch List Cc: gcc-patches Subject: [PATCH] libjava: Add option to disable BC ABI in libgcj. Content-Type: multipart/mixed; boundary="------------090407000000020305000403" X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2007-q4/txt/msg00099.txt.bz2 This is a multi-part message in MIME format. --------------090407000000020305000403 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 1274 Static linking with libgcj does not work well when portions are compiled with the BC ABI. The problem is that the compile time linker is not able to resolve all the needed dependencies. This patch adds a new configure option (--disable-libgcj-bc) that forces all code in libgcj to be compiled with the C++ ABI. The default is to compile libgcj 'normally'. This option would only be used by those statically linking to libgcj. Tested on i686-pc-linux-gnu with no failures in libjava testsuite. I also verified by inspecting build output that -findirect-dispatch -fno-indirect-classes is being passed when compiling the BC ABI files. OK to commit? gcc/ 2007-12-21 David Daney * doc/install.texi (disable-libgcj-bc): Document new option. libjava/ 2007-12-21 David Daney * scripts/makemake.tcl (emit_bc_rule): Use $(LIBGCJ_BC_FLAGS) instead of -findirect-dispatch -fno-indirect-classes. * configure.ac (libgcj-bc): New AC_ARG_ENABLE. (SUPPRESS_LIBGCJ_BC): New AM_CONDITIONAL. * Makefile.am (LIBGCJ_BC_FLAGS): New variable. * Makefile.in: Regenerate. * include/Makefile.in: Same. * testsuite/Makefile.in: Same. * configure: Same. * gcj/Makefile.in: Same. * sources.am: Same. --------------090407000000020305000403 Content-Type: text/x-patch; name="libgcj-bc.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="libgcj-bc.diff" Content-length: 2681 Index: gcc/doc/install.texi =================================================================== --- gcc/doc/install.texi (revision 131121) +++ gcc/doc/install.texi (working copy) @@ -1554,6 +1554,16 @@ using non-functional stubs for native me @item --disable-jvmpi Disable JVMPI support. +@item --disable-libgcj-bc +Disable BC ABI compilation of certain parts of libgcj. By default, +some portions of libgcj are compiled with @option{-findirect-dispatch} +@option{-fno-indirect-classes}. This allows them to be overridden at +runtime. + +If @option{--disable-libgcj-bc} is specified, libgcj is built without +these options. This makes it impossible to override portions of +libgcj at runtime, but can make it easier to statically link to libgcj. + @item --with-ecos Enable runtime eCos target support. Index: libjava/scripts/makemake.tcl =================================================================== --- libjava/scripts/makemake.tcl (revision 131121) +++ libjava/scripts/makemake.tcl (working copy) @@ -317,7 +317,9 @@ proc emit_bc_rule {package} { if {$package_map($package) == "bc"} { puts -nonewline "-fjni " } - puts "-findirect-dispatch -fno-indirect-classes -c -o $loname @$tname" + # Unless bc is disabled with --disable-libgcj-bc, $(LIBGCJ_BC_FLAGS) is: + # -findirect-dispatch -fno-indirect-classes + puts "\$(LIBGCJ_BC_FLAGS) -c -o $loname @$tname" puts "\t@rm -f $tname" puts "" Index: libjava/configure.ac =================================================================== --- libjava/configure.ac (revision 131121) +++ libjava/configure.ac (working copy) @@ -514,6 +514,15 @@ AC_ARG_WITH(java-home, AM_CONDITIONAL(JAVA_HOME_SET, test ! -z "$JAVA_HOME") AC_SUBST(JAVA_HOME) +suppress_libgcj_bc=no +AC_ARG_ENABLE(libgcj-bc, + AS_HELP_STRING([--enable-libgcj-bc], + [enable(default) or disable BC ABI for portions of libgcj]), + [if test "$enable_libgcj_bc" = "no"; then + suppress_libgcj_bc=yes + fi]) +AM_CONDITIONAL(SUPPRESS_LIBGCJ_BC, test "$suppress_libgcj_bc" = "yes") + # What is the native OS API for MinGW? AC_ARG_WITH(win32-nlsapi, AS_HELP_STRING([--with-win32-nlsapi=ansi or unicows or unicode], Index: libjava/Makefile.am =================================================================== --- libjava/Makefile.am (revision 131121) +++ libjava/Makefile.am (working copy) @@ -155,6 +155,12 @@ if USING_GCC AM_CFLAGS += $(WARNINGS) endif +if SUPPRESS_LIBGCJ_BC +LIBGCJ_BC_FLAGS = +else +LIBGCJ_BC_FLAGS = -findirect-dispatch -fno-indirect-classes +endif + ## Extra CFLAGS used for JNI C sources shared with GNU Classpath. PEDANTIC_CFLAGS = -ansi -pedantic -Wall -Wno-long-long --------------090407000000020305000403--