From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18503 invoked by alias); 11 Dec 2013 14:48:23 -0000 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 Received: (qmail 18490 invoked by uid 89); 11 Dec 2013 14:48:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 11 Dec 2013 14:48:21 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Vql52-0000Ju-Dk from Iain_Sandoe@mentor.com ; Wed, 11 Dec 2013 06:48:04 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 11 Dec 2013 06:48:03 -0800 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 11 Dec 2013 14:48:01 +0000 Subject: Re: [Patch Ada/build] deal with some cross/native cross issues MIME-Version: 1.0 (Apple Message framework v1283) Content-Type: multipart/mixed; boundary="Apple-Mail=_967436D8-6496-4EA8-991D-ABF02B3FADC1" From: Iain Sandoe In-Reply-To: <1757219.DocZddhPPW@polaris> Date: Wed, 11 Dec 2013 14:48:00 -0000 CC: "gcc-patches@gcc.gnu.org patches" , Alan Modra , Bernd Edlinger Message-ID: <61449BFE-27DC-4CB4-B6E7-CFB2470127DD@codesourcery.com> References: <66B73BAF-77A5-46B4-9D81-9043E7F17BAA@codesourcery.com> <1757219.DocZddhPPW@polaris> To: Eric Botcazou X-SW-Source: 2013-12/txt/msg01104.txt.bz2 --Apple-Mail=_967436D8-6496-4EA8-991D-ABF02B3FADC1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="us-ascii" Content-length: 2261 Hello Eric, I had made the mods to this and done some light testing - then got side-tra= cked 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 cross= es >> and native crosses. >> 1. xgnatugn needs to be run on the build system, so needs to be built wi= th >> the build system's gnatmake. I haven't put a canonical prefix on this si= nce >> this doesn't appear to be done elsewhere. Defined as GNATMAKE_FOR_BUILD = and >> passed to sub-processes. >=20 > Why do you need to pass it to ADA_TOOLS_FLAGS_TO_PASS though? Just repla= ce=20 > $(GNATMAKE) with gnatmake. done (FWIW, I think that GNATMAKE_FOR_BUILD would make it obvious for a fut= ure 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. >=20 > OK. >=20 >> 3. In gnattools, the RTS dir must be for the host and not for the build;= =20 >> 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). >=20 > 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(=3Dho= st) 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-c= ross, 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, g= iven the machines I have available,=20 OK to apply if [cross & native-cross] testing passes? (if the other folks doing cross-build stuff want to incorporate/take this o= n, that's OK too). Iain --Apple-Mail=_967436D8-6496-4EA8-991D-ABF02B3FADC1 Content-Disposition: attachment; filename="ada-x-build-v2-diff.txt" Content-Type: text/plain; name="ada-x-build-v2-diff.txt" Content-Transfer-Encoding: quoted-printable Content-length: 3220 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/Mak= e-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=3D$(host)-gnatlink GNATLS_FOR_HOST=3D$(host)-gnatls =20 + ifneq ($(findstring ada,$(LANGUAGES)),) + RTS_DIR:=3D$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep ad= alib ))) + 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:=3D$(strip $(subst \,/,$(shell $(GNATLS_FOR_HOST) -v | grep = adalib ))) - endif ADA_TOOLS_FLAGS_TO_PASS=3D\ CC=3D"$(CC)" \ CXX=3D"$(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 =20 # 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.in= fo diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Make= file.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=3D \ "GNATLINK=3D$(GNATLINK)" \ "GNATBIND=3D$(GNATBIND)" =20 -GCC_LINK=3D$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) +GCC_LINK=3D$(CXX) $(GCC_LINK_FLAGS) $(ADA_INCLUDES) $(LDFLAGS) =20 # 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 =3D @srcdir@ libdir =3D @libdir@ build =3D @build@ target =3D @target@ +host =3D @host@ prefix =3D @prefix@ INSTALL =3D @INSTALL@ INSTALL_DATA =3D @INSTALL_DATA@ @@ -92,6 +93,7 @@ TOOLS_FLAGS_TO_PASS_RE=3D \ "CC=3D../../xgcc -B../../" \ "CXX=3D../../xg++ -B../../ $(CXX_LFLAGS)" \ "CFLAGS=3D$(CFLAGS)" \ + "LDFLAGS=3D$(LDFLAGS)" \ "ADAFLAGS=3D$(ADAFLAGS)" \ "ADA_CFLAGS=3D$(ADA_CFLAGS)" \ "INCLUDES=3D$(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:=3D$(strip $(subst \,/,$(shell gnatls -v | grep adalib ))) +else +RTS_DIR:=3D$(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 \ --Apple-Mail=_967436D8-6496-4EA8-991D-ABF02B3FADC1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii" Content-length: 2 --Apple-Mail=_967436D8-6496-4EA8-991D-ABF02B3FADC1--