public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
To: Dmitrijs Ledkovs <dmitrij.ledkov@ubuntu.com>, tromey@gcc.gnu.org
Cc: gcc-patches@gcc.gnu.org
Subject: Re: PR libgcj/40868 - ecjx should be build with host compiler
Date: Thu, 26 Aug 2010 19:15:00 -0000	[thread overview]
Message-ID: <20100826184937.GI8657@gmx.de> (raw)
In-Reply-To: <871v9lv2t1.fsf@ubuntu.com>

[ 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  <dmitrij.ledkov@ubuntu.com>
	    Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

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)
 

  reply	other threads:[~2010-08-26 18:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-12 17:41 Dmitrijs Ledkovs
2010-08-13  9:24 ` Andrew Haley
2010-08-16  0:11   ` Dmitrijs Ledkovs
2010-08-16  9:31     ` Andrew Haley
2010-08-16  9:41     ` Andrew Haley
2010-08-16 19:03       ` Ralf Wildenhues
2010-08-17 13:32         ` Dmitrijs Ledkovs
2010-08-17 19:02           ` Ralf Wildenhues
2010-08-17 20:36             ` Dmitrijs Ledkovs
2010-08-17 22:55             ` Dave Korn
2010-08-26 15:03             ` Dmitrijs Ledkovs
2010-08-26 19:15               ` Ralf Wildenhues [this message]
2010-08-26 19:52                 ` Tom Tromey
2010-08-26 21:34                 ` Dmitrijs Ledkovs
2010-08-16 21:13       ` Tom Tromey
2010-08-17 14:14         ` Dmitrijs Ledkovs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100826184937.GI8657@gmx.de \
    --to=ralf.wildenhues@gmx.de \
    --cc=dmitrij.ledkov@ubuntu.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tromey@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).