From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25294 invoked by alias); 18 Feb 2015 12:35:39 -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 25280 invoked by uid 89); 18 Feb 2015 12:35:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 18 Feb 2015 12:35:32 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1ICZOdX012354 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 18 Feb 2015 07:35:25 -0500 Received: from tucnak.zalov.cz (ovpn-116-28.ams2.redhat.com [10.36.116.28]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t1ICZMHo029808 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Wed, 18 Feb 2015 07:35:24 -0500 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.9/8.14.9) with ESMTP id t1ICZK5L006309; Wed, 18 Feb 2015 13:35:20 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.9/8.14.9/Submit) id t1ICZIeV006308; Wed, 18 Feb 2015 13:35:18 +0100 Date: Wed, 18 Feb 2015 12:35:00 -0000 From: Jakub Jelinek To: Thomas Schwinge Cc: Ilya Verbin , Bernd Schmidt , Richard Biener , Jan Hubicka , gcc-patches@gcc.gnu.org, Joseph Myers Subject: Re: nvptx offloading patches [3/n], RFD Message-ID: <20150218123518.GM1746@tucnak.redhat.com> Reply-To: Jakub Jelinek 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> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87vbize7zi.fsf@schwinge.name> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg01100.txt.bz2 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: > > On Wed, Feb 18, 2015 at 10:12:19AM +0100, Thomas Schwinge wrote: > > > Do you literally have »nvptx-newlib symlinked into the gcc tree as > > > newlib«? If yes, then that should explain the problem: as I wrote in > > > , > > > you need to »add a symbolic link to nvptx-newlib's newlib directory to > > > the directory containing the GCC sources«, so not link [GCC]/newlib -> > > > [newlib-nvptx], but [GCC]/newlib -> [newlib-nvptx]/newlib. Does that > > > resolve the issue? > > (It did.) Can you suggest a better wording, to make this more clear in > the documentation? Your wording is fine, but should be listed on wiki/Offloading and doc/install.texi perhaps too? > > 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. > Note that I recently added another prerequisite patch for nvptx > offloading to : > . > If that is not applied, you'll get run-time errors because in > libgomp/plugin/plugin-nvptx.c:GOMP_OFFLOAD_get_table, cuModuleGetFunction > can't find main$_omp_fn$0 and similar symbols. Can you adjust that to add a cgraph flag alongside of the offloadable instead and use that instead of the attribute? Jakub