From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8777 invoked by alias); 26 Aug 2010 18:49:48 -0000 Received: (qmail 8756 invoked by uid 22791); 26 Aug 2010 18:49:47 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_GC,TW_IB,URIBL_BLACK X-Spam-Check-By: sourceware.org Received: from mailout-de.gmx.net (HELO mail.gmx.net) (213.165.64.22) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Thu, 26 Aug 2010 18:49:41 +0000 Received: (qmail invoked by alias); 26 Aug 2010 18:49:38 -0000 Received: from xdsl-89-0-79-90.netcologne.de (EHLO localhost.localdomain) [89.0.79.90] by mail.gmx.net (mp066) with SMTP; 26 Aug 2010 20:49:38 +0200 Received: from ralf by localhost.localdomain with local (Exim 4.69) (envelope-from ) id 1OohW5-0002O4-LA; Thu, 26 Aug 2010 20:49:37 +0200 Date: Thu, 26 Aug 2010 19:15:00 -0000 From: Ralf Wildenhues To: Dmitrijs Ledkovs , tromey@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Subject: Re: PR libgcj/40868 - ecjx should be build with host compiler Message-ID: <20100826184937.GI8657@gmx.de> Mail-Followup-To: Ralf Wildenhues , Dmitrijs Ledkovs , tromey@gcc.gnu.org, gcc-patches@gcc.gnu.org References: <87eie34tnv.fsf@ubuntu.com> <4C650A04.8040207@redhat.com> <4C6906BC.7040501@redhat.com> <20100816185338.GK1336@gmx.de> <8762z9v006.fsf@ubuntu.com> <20100817184502.GF16326@gmx.de> <871v9lv2t1.fsf@ubuntu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <871v9lv2t1.fsf@ubuntu.com> User-Agent: Mutt/1.5.20 (2010-04-22) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg01926.txt.bz2 [ http://gcc.gnu.org/ml/gcc-patches/2010-08/msg00930.html ] Sorry for the delay. Below is my attempt. Tested in native configuration. Can you please test the cross compile case? You need to use --enable-maintainer-mode or run 'cd libjava && autoreconf -v' explicitly for the patch to have effect. Thanks. Tom, if that succeeds, OK to commit? Notes: The patch assumes that in the native setup, users expect CXXFLAGS and GCJFLAGS to be applied to the compile resp. link. The latter is already done, so the former seems just logical, which is why the compile rule is placed in the !NATIVE block only. Ensuring both of the variables are always nonempty was done for consistency reasons. The dummy object is needed because, well, there are gcj versions out there that will refuse to link without finding an object on the command line. It could have probably just as well been created with the same driver, but I don't think that this way makes things worse than they were before. Thanks, Ralf Fix building ecjx in cross compile mode. 2010-08-26 Dmitrijs Ledkovs Ralf Wildenhues libjava/: PR libgcj/40868 * configure.ac: Add GCC_FOR_ECJX variable. Ensure GCJ_FOR_ECJX is always set. * Makefile.am [!NATIVE] (ecjx.$(OBJEXT)): New rule. * Makefile.in: Regenerate. * configure: Regenerate. * gcj/Makefile.in: Regenerate. * include/Makefile.in: Regenerate. * testsuite/Makefile.in: Regenerate. diff --git a/libjava/Makefile.am b/libjava/Makefile.am index dcdf827..52d0995 100644 --- a/libjava/Makefile.am +++ b/libjava/Makefile.am @@ -1170,6 +1170,8 @@ ecjx_LINK = $(GCJ_FOR_ECJX_LINK) $(ecjx_LDFLAGS) ecjx_LDFLAGS = $(ECJX_BASE_FLAGS) $(ECJ_BUILD_JAR) ecjx_LDADD = ecjx_DEPENDENCIES = +ecjx.$(OBJEXT): ecjx.cc + $(GCC_FOR_ECJX) -c $< endif !NATIVE diff --git a/libjava/configure.ac b/libjava/configure.ac index 685cb72..df6bca3 100644 --- a/libjava/configure.ac +++ b/libjava/configure.ac @@ -394,7 +394,8 @@ NATIVE=yes # Which gcj and host gcj (for ecjx) do we use? which_gcj=default host_exeext=${ac_exeext} -GCJ_FOR_ECJX= +GCJ_FOR_ECJX='$(GCJ)' +GCC_FOR_ECJX='$(CXX)' built_gcc_dir="`cd ${builddotdot}/../../${host_subdir}/gcc && ${PWDCMD-pwd}`" if test -n "${with_cross_host}"; then # We are being configured with a cross compiler. We can't @@ -402,6 +403,7 @@ if test -n "${with_cross_host}"; then NATIVE=no cross_host_exeext= GCJ_FOR_ECJX="${with_cross_host}-gcj" + GCC_FOR_ECJX="${with_cross_host}-gcc" case "${with_cross_host}" in *mingw* | *cygwin*) cross_host_exeext=.exe @@ -467,6 +469,7 @@ JAVAC="$GCJ -C" export JAVAC AC_SUBST(GCJ_FOR_ECJX) +AC_SUBST(GCC_FOR_ECJX) AC_SUBST(GCJH) AC_SUBST(host_exeext)