From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11430 invoked by alias); 19 Feb 2015 10:48:32 -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 11406 invoked by uid 89); 19 Feb 2015 10:48:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Feb 2015 10:48:27 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-03.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1YOOed-0001NE-1z from Thomas_Schwinge@mentor.com ; Thu, 19 Feb 2015 02:48:23 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-03.mgc.mentorg.com (137.202.0.108) with Microsoft SMTP Server id 14.3.224.2; Thu, 19 Feb 2015 10:48:21 +0000 From: Thomas Schwinge To: Jakub Jelinek CC: Ilya Verbin , Bernd Schmidt , Richard Biener , Jan Hubicka , , Joseph Myers Subject: If we're building an offloading compiler, always enable the LTO front end (was: nvptx offloading patches [3/n], RFD) In-Reply-To: <20150218123518.GM1746@tucnak.redhat.com> References: <20150204113817.GO1746@tucnak.redhat.com> <20150216210812.GO1746@tucnak.redhat.com> <20150217133206.GA62715@msticlxl57.ims.intel.com> <20150217153918.GX1746@tucnak.redhat.com> <20150217164033.GY1746@tucnak.redhat.com> <87oaoreg7g.fsf@kepler.schwinge.homeip.net> <20150218113438.GI1746@tucnak.redhat.com> <87vbize7zi.fsf@schwinge.name> <20150218123518.GM1746@tucnak.redhat.com> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) Date: Thu, 19 Feb 2015 10:50:00 -0000 Message-ID: <87bnkqdvny.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" X-SW-Source: 2015-02/txt/msg01168.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 3743 Hi! On Wed, 18 Feb 2015 13:35:18 +0100, Jakub Jelinek wrote: > On Wed, Feb 18, 2015 at 01:09:53PM +0100, Thomas Schwinge wrote: > > On Wed, 18 Feb 2015 12:34:38 +0100, Jakub Jelinek wr= ote: > > > offloading fails: > > >=20 > > > /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linu= x-gnu/5.0.0//accel/nvptx-none/mkoffload @/tmp/cce9PdmR > > > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not rec= ognized > > > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not rec= ognized > > > mkoffload: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/x86_6= 4-pc-linux-gnu-accel-nvptx-none-gcc returned 1 exit status > > > compilation terminated. > > > lto-wrapper: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/../= libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload returned = 1 exit status > > > compilation terminated. > > > /usr/bin/ld: lto-wrapper failed > > > collect2: error: ld returned 1 exit status > > >=20 > > > Is --enable-languages=3Dc,c++,fortran,lto required when configuring t= he > > > offload compiler? It isn't required for intelmic. > >=20 > > Yes, exactly. I assume the reason is that x86_64-intelmicemul-linux-gnu > > defaults to supporting LTO, and due to this also defaults to building t= he > > LTO front end. I'll enhance the nvptx offloading documentation > > accordingly. Maybe we should add some "magic" to build the LTO front e= nd > > if --enable-as-accelerator-for=3D[...] has been specified? >=20 > Toplevel configure.ac has: > # If LTO is enabled, add the LTO front end. > if test "$enable_lto" =3D "yes" ; then > case ,${enable_languages}, in > *,lto,*) ;; > *) enable_languages=3D"${enable_languages},lto" ;; > esac > if test "${build_lto_plugin}" =3D "yes" ; then > configdirs=3D"$configdirs lto-plugin" > fi > fi > so IMHO we want similar snippet for the --enable-as-accelerator-for=3D ca= se, > perhaps right below this one. Not building lto FE for the accelerator > compilers make them completely useless, thus I think we really want to do > that automatically. Like this? commit 56c0312469f583ba3fa9fa2777981742ab6d6c75 Author: Thomas Schwinge Date: Thu Feb 19 11:41:23 2015 +0100 If we're building an offloading compiler, always enable the LTO front e= nd. =20=20=20=20 * configure.ac [--enable-as-accelerator-for] (enable_languages): Make sure it contains lto. * configure: Regenerate. --- configure | 8 ++++++++ configure.ac | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git configure configure index dd794db..2afc52b 100755 --- configure +++ configure @@ -6217,6 +6217,14 @@ if test -d ${srcdir}/gcc; then fi fi =20 + # If we're building an offloading compiler, add the LTO front end. + if test x"$enable_as_accelerator_for" !=3D x ; then + case ,${enable_languages}, in + *,lto,*) ;; + *) enable_languages=3D"${enable_languages},lto" ;; + esac + fi + missing_languages=3D`echo ",$enable_languages," | sed -e s/,all,/,/ -e s= /,c,/,/ ` potential_languages=3D,c, =20 diff --git configure.ac configure.ac index 4ea5e00..08a6fbf 100644 --- configure.ac +++ configure.ac @@ -1918,6 +1918,14 @@ if test -d ${srcdir}/gcc; then fi fi =20 + # If we're building an offloading compiler, add the LTO front end. + if test x"$enable_as_accelerator_for" !=3D x ; then + case ,${enable_languages}, in + *,lto,*) ;; + *) enable_languages=3D"${enable_languages},lto" ;; + esac + fi + missing_languages=3D`echo ",$enable_languages," | sed -e s/,all,/,/ -e s= /,c,/,/ ` potential_languages=3D,c, =20 Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU5b9xAAoJEPoxNhtoi6COrMMIAM+5XI3dG4IpCRRaJIrfXH+s XE8NGdf6/BUlhd3jOJfrmBG8CxXw8YzNPjcenYcpGwlFkN9Bk+5jzT8KCpVmQIEq 04W51Rwaw6VlceZoMVkbzV4bvN9sM7wqoC+rAHY0nOhJIELXqGRPpK2GRFHwk4wo SdqMPWvf8eCmT0WMAJLW0WNRhN4NcJynO0Y1/SmKX1KWXtq29uHeA0G8k3ed4vKP iKrPe1F8TEIdl46tHnLk4NrSEcR9bHD2YRX25uD2gBYgYg7Cuwf/qOrqeWN8XhPt P+e9jvni6h/k7u6/UATcv6nUwO/+RLQBVSlRLOuUp4xmLed+PxJyo3Gy/vZ+YOs= =HF1D -----END PGP SIGNATURE----- --=-=-=--