From patchwork Thu Feb 19 10:48:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 441563 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CD94414012A for ; Thu, 19 Feb 2015 21:48:39 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; q=dns; s=default; b=WxHW4eHMvkAmm2U/ PZGXRKGKd/D3ohXJlX9kBcBzeWEWX3XypwCwQjxDoNDsjGkeDBX33QP5gmjRawFa nY1VyYZQh/Vs6GJeJZldSvG66jmF1P1muFODkB3v7Oa5+I3sLY4cXyvk25P253R2 VTylyV89x4I5v31ZzeXanBe1AhI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=default; bh=tZsZnFtNZPVdzJJQ/YP/5Q WvZSs=; b=YjKnzFhnmf8nEvYV3OfbGh8OnIl9eq8xKYVPCfsAOhiKjiuqnGEB7U gUkAR+8qb9V7fYPBefGyfh9R8OeJceIZYyU0eaQ5glt4uholGwczWeserpnLDTP5 xN6FS37Cl6rgYhT+57aRDlpLE+IpKwmRurL7BPT2z3L5sUtDhKJIU= 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-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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 11:48:17 +0100 Message-ID: <87bnkqdvny.fsf@schwinge.name> MIME-Version: 1.0 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 wrote: > > > offloading fails: > > > > > > /usr/src/gcc/objnvptxinst/usr/local/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.0.0//accel/nvptx-none/mkoffload @/tmp/cce9PdmR > > > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized > > > x86_64-pc-linux-gnu-accel-nvptx-none-gcc: error: language lto not recognized > > > mkoffload: fatal error: /usr/src/gcc/objnvptxinst/usr/local/bin/x86_64-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 > > > > > > Is --enable-languages=c,c++,fortran,lto required when configuring the > > > offload compiler? It isn't required for intelmic. > > > > 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 the > > LTO front end. I'll enhance the nvptx offloading documentation > > accordingly. Maybe we should add some "magic" to build the LTO front end > > if --enable-as-accelerator-for=[...] has been specified? > > Toplevel configure.ac has: > # If LTO is enabled, add the LTO front end. > if test "$enable_lto" = "yes" ; then > case ,${enable_languages}, in > *,lto,*) ;; > *) enable_languages="${enable_languages},lto" ;; > esac > if test "${build_lto_plugin}" = "yes" ; then > configdirs="$configdirs lto-plugin" > fi > fi > so IMHO we want similar snippet for the --enable-as-accelerator-for= case, > 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 end. * 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(+) Grüße, Thomas diff --git configure configure index dd794db..2afc52b 100755 --- configure +++ configure @@ -6217,6 +6217,14 @@ if test -d ${srcdir}/gcc; then fi fi + # If we're building an offloading compiler, add the LTO front end. + if test x"$enable_as_accelerator_for" != x ; then + case ,${enable_languages}, in + *,lto,*) ;; + *) enable_languages="${enable_languages},lto" ;; + esac + fi + missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` potential_languages=,c, 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 + # If we're building an offloading compiler, add the LTO front end. + if test x"$enable_as_accelerator_for" != x ; then + case ,${enable_languages}, in + *,lto,*) ;; + *) enable_languages="${enable_languages},lto" ;; + esac + fi + missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ ` potential_languages=,c,