public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <iain@codesourcery.com>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: "gcc-patches@gcc.gnu.org patches" <gcc-patches@gcc.gnu.org>,
	Alan Modra	<amodra@gmail.com>,
	Bernd Edlinger <bernd.edlinger@hotmail.de>
Subject: Re: [Patch Ada/build] deal with some cross/native cross issues
Date: Wed, 11 Dec 2013 14:48:00 -0000	[thread overview]
Message-ID: <61449BFE-27DC-4CB4-B6E7-CFB2470127DD@codesourcery.com> (raw)
In-Reply-To: <1757219.DocZddhPPW@polaris>

[-- Attachment #1: Type: text/plain, Size: 2255 bytes --]

Hello Eric,

I had made the mods to this and done some light testing - then got side-tracked by other priorities.
however, since the topic has come up on the list:

On 6 Nov 2013, at 12:57, Eric Botcazou wrote:

>> I've been trying to improve the building and testing of Darwin for crosses
>> and native crosses.

>> 1. xgnatugn needs to be run on the build system, so needs to be built with
>> the build system's gnatmake. I haven't put a canonical prefix on this since
>> this doesn't appear to be done elsewhere. Defined as GNATMAKE_FOR_BUILD and
>> passed to sub-processes.
> 
> Why do you need to pass it to ADA_TOOLS_FLAGS_TO_PASS though?  Just replace 
> $(GNATMAKE) with gnatmake.
done (FWIW, I think that GNATMAKE_FOR_BUILD would make it obvious for a future reader, but not a big deal)

>> 2. Some builds might need to pass LDFLAGS to the gnat* builds.  Appended
>> LDFLAGS to GCC_LINK.  Passed on in gnattools/Make.
> 
> OK.
> 
>> 3. In gnattools, the RTS dir must be for the host and not for the build; 
>> This actually only showed up when I tried a cross from a 64bit pointer
>> machine to a 32bit pointer one (i.e it is easy for it to go unnoticed).
> 
> OK, but don't you need to do the same for gnatmake/gnatbind/gnatlink here?
> See gcc-interface/Make-lang.in, line 171 and below, for similar code.

it did appear odd that one path had the test and the other did not, however the comment on the native-x case is somewhat misleading since it implies (at least to me) that the *intention* is to use the newly-built target(=host) lib?

In the current patch this is changed to place the test and setting RTS_DIR to cover both native and canadian X cases, at least this should be safe.

Note that I have *not* tested any canadian-crosses, just cross and native-cross, if you need someone to do a canadian X before this is applied, let me know, and I'll try to set something up. (unless it gets covered by Alan or Bernd's cases).

I am re-testing the attached, rebased to tot, but that will take a while, given the machines I have available, 

OK to apply if [cross & native-cross] testing passes?

(if the other folks doing cross-build stuff want to incorporate/take this on, that's OK too).
Iain


[-- Attachment #2: ada-x-build-v2-diff.txt --]
[-- Type: text/plain, Size: 3226 bytes --]

 gcc/ada/gcc-interface/Make-lang.in | 9 +++++----
 gcc/ada/gcc-interface/Makefile.in  | 2 +-
 gnattools/Makefile.in              | 6 ++++++
 3 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/gcc-interface/Make-lang.in b/gcc/ada/gcc-interface/Make-lang.in
index cd3676f..f7aafc0 100644
--- a/gcc/ada/gcc-interface/Make-lang.in
+++ b/gcc/ada/gcc-interface/Make-lang.in
@@ -178,6 +178,10 @@ else
   GNATLINK_FOR_HOST=$(host)-gnatlink
   GNATLS_FOR_HOST=$(host)-gnatls
 
+  ifneq ($(findstring ada,$(LANGUAGES)),)
+    RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
+  endif
+
   ifeq ($(host), $(target))
     # This is a cross native. All the sources are taken from the currently
     # built runtime.
@@ -193,9 +197,6 @@ else
   else
     # This is a canadian cross. We should use a toolchain running on the
     # build platform and targeting the host platform.
-    ifneq ($(findstring ada,$(LANGUAGES)),)
-      RTS_DIR:=$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep adalib )))
-    endif
     ADA_TOOLS_FLAGS_TO_PASS=\
         CC="$(CC)" \
         CXX="$(CXX)" \
@@ -658,7 +659,7 @@ ada.tags: force
 ada/doctools/xgnatugn$(build_exeext): ada/xgnatugn.adb
 	-$(MKDIR) ada/doctools
 	$(CP) $^ ada/doctools
-	cd ada/doctools && $(GNATMAKE) -q xgnatugn
+	cd ada/doctools && gnatmake -q xgnatugn
 
 # Note that doc/gnat_ugn.texi and doc/projects.texi do not depend on
 # xgnatugn being built so we can distribute a pregenerated doc/gnat_ugn.info
diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 885a5ed..6b675f2 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2415,7 +2415,7 @@ TOOLS_FLAGS_TO_PASS=		\
 	"GNATLINK=$(GNATLINK)"	\
 	"GNATBIND=$(GNATBIND)"
 
-GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES)
+GCC_LINK=$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) $(LDFLAGS)
 
 # Build directory for the tools. Let's copy the target-dependent
 # sources using the same mechanism as for gnatlib. The other sources are
diff --git a/gnattools/Makefile.in b/gnattools/Makefile.in
index fdd6491..118847c 100644
--- a/gnattools/Makefile.in
+++ b/gnattools/Makefile.in
@@ -24,6 +24,7 @@ srcdir = @srcdir@
 libdir = @libdir@
 build = @build@
 target = @target@
+host = @host@
 prefix = @prefix@
 INSTALL = @INSTALL@
 INSTALL_DATA = @INSTALL_DATA@
@@ -92,6 +93,7 @@ TOOLS_FLAGS_TO_PASS_RE= \
 	"CC=../../xgcc -B../../" \
 	"CXX=../../xg++ -B../../ $(CXX_LFLAGS)" \
 	"CFLAGS=$(CFLAGS)" \
+	"LDFLAGS=$(LDFLAGS)" \
 	"ADAFLAGS=$(ADAFLAGS)" \
 	"ADA_CFLAGS=$(ADA_CFLAGS)" \
 	"INCLUDES=$(INCLUDES_FOR_SUBDIR)" \
@@ -192,7 +194,11 @@ regnattools: $(GCC_DIR)/stamp-gnatlib-rts
 # put the host RTS dir first in the PATH to hide the default runtime
 # files that are among the sources
 # FIXME: This should be done in configure.
+ifeq ($(host), $(build))
 RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
+else
+RTS_DIR:=$(strip $(subst \,/,$(shell $(host)-gnatls -v | grep adalib )))
+endif
 gnattools-cross: $(GCC_DIR)/stamp-tools
 	# gnattools1-re
 	$(MAKE) -C $(GCC_DIR)/ada/tools -f ../Makefile \

[-- Attachment #3: Type: text/plain, Size: 2 bytes --]




      reply	other threads:[~2013-12-11 14:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-03 21:35 Iain Sandoe
2013-11-06 13:13 ` Eric Botcazou
2013-12-11 14:48   ` Iain Sandoe [this message]

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=61449BFE-27DC-4CB4-B6E7-CFB2470127DD@codesourcery.com \
    --to=iain@codesourcery.com \
    --cc=amodra@gmail.com \
    --cc=bernd.edlinger@hotmail.de \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@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).