From patchwork Thu Feb 19 09:28:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bernd Schmidt X-Patchwork-Id: 441554 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 DA2E314009B for ; Thu, 19 Feb 2015 20:29:04 +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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=AKZqbkqdu9KEem+w1 Mtqy67hTrvAU9sjYO5YwYFBAxQtK188+7DrLGjeeEY6829ZH9cX3uQvdJ+Ms/bPG kMr2wWRAUKL6/DJZYTMIxB6rF4wo8Um/9IDtltkbYd/ohMfTBaW/lSvBrztDSxUc qAWqmR2BHAjRWdGf8bW5jdN5CA= 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 :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=XZWrZ+OFKz2V3xMW5s97Q1A MSmU=; b=bfGsCzD2jsACZyfzn3jgD6JMfJh20ddbP3COoJ5UMDJHINJ/8brfJOr 4oL4pLONcKc2IVaDPYvTK+Ls1P9rWp1Fqo0wiu8L5ybYn39V7p0gIXAgGdFU2GCG BQoM3KKpaqmlG17cMtWEDyM1Yj4ieyxsqbkxdBx2AeTfx0hrIhso= Received: (qmail 13430 invoked by alias); 19 Feb 2015 09:28:56 -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 13415 invoked by uid 89); 19 Feb 2015 09:28:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 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 09:28:53 +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 1YONPd-0004pb-Jb from Bernd_Schmidt@mentor.com ; Thu, 19 Feb 2015 01:28:49 -0800 Received: from [127.0.0.1] (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 09:28:47 +0000 Message-ID: <54E5ACCE.7080502@codesourcery.com> Date: Thu, 19 Feb 2015 10:28:46 +0100 From: Bernd Schmidt User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Jakub Jelinek , Joseph Myers CC: Ilya Verbin , Thomas Schwinge , Richard Biener , Jan Hubicka , Subject: Re: nvptx offloading patches [3/n], RFD References: <5454CAB9.3040907@codesourcery.com> <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> In-Reply-To: <20150217164033.GY1746@tucnak.redhat.com> On 02/17/2015 05:40 PM, Jakub Jelinek wrote: > On Tue, Feb 17, 2015 at 04:21:06PM +0000, Joseph Myers wrote: >> On Tue, 17 Feb 2015, Jakub Jelinek wrote: >> >>> Third attempt failed with: >>> ../../../libgcc/config/nvptx/realloc.c:24:20: fatal error: stdlib.h: No such file or directory >>> compilation terminated. >>> ../../../libgcc/static-object.mk:17: recipe for target 'realloc.o' failed >>> make[2]: *** [realloc.o] Error 1 >>> make[2]: *** Waiting for unfinished jobs.... >>> make[2]: Leaving directory '/usr/src/gcc/objnvptx/nvptx-none/libgcc' >>> I have nvptx-newlib symlinked into the gcc tree as newlib, so I expected it >>> would be built in-tree, is that not the case (at least wiki/Offloading >>> mentions that). Or is it just that libgcc can't really have dependencies on >>> newlib headers as newlib is built after libgcc? >> >> I've committed this patch to fix this last issue (the header dependence, >> that is; I don't know about the in-tree build). > > Thanks, sure, libgcc now builds fine, the in-tree build fails: > configure:4261: checking for C compiler default output file name > configure:4283: /usr/src/gcc/objnvptx/./gcc/xgcc -B/usr/src/gcc/objnvptx/./gcc/ -nostdinc -B/usr/src/gcc/objnvptx/nvptx-none/newlib/ -isystem /usr/src/gcc/objnvptx/nvptx-none/newlib/targ-include -isystem /usr/src/gcc/newlib/libc/include -B/usr/local/nvptx-none/bin/ -B/usr/local/nvptx-none/lib/ -isystem /usr/local/nvptx-none/include -isystem /usr/local/nvptx-none/sys-include -g -O2 conftest.c >&5 > error opening libc.a > collect2: error: ld returned 1 exit status > very early during in-tree newlib configure. Not a fix for your problem, but there's a similar issue when trying to get at the libgcc for the nvptx accel compiler after it's been installed. The libgcc Makefile puts it in the wrong place - gcc/nvptx-none/accel/nvptx-none instead of gcc/host/accel/nvptx-none. The patch below corrects that and removes an intelmicemul special case which I believe has the same effect - Ilya, could you test this? Bernd Index: libgcc/Makefile.in =================================================================== --- libgcc/Makefile.in (revision 445788) +++ libgcc/Makefile.in (working copy) @@ -45,6 +45,7 @@ fixed_point = @fixed_point@ with_aix_soname = @with_aix_soname@ host_noncanonical = @host_noncanonical@ +real_host_noncanonical = @real_host_noncanonical@ target_noncanonical = @target_noncanonical@ # List of extra object files that should be compiled for this target machine. @@ -185,7 +186,7 @@ STRIP = @STRIP@ STRIP_FOR_TARGET = $(STRIP) # Directory in which the compiler finds libraries etc. -libsubdir = $(libdir)/gcc/$(host_noncanonical)/$(version)@accel_dir_suffix@ +libsubdir = $(libdir)/gcc/$(real_host_noncanonical)/$(version)@accel_dir_suffix@ # Used to install the shared libgcc. slibdir = @slibdir@ # Maybe used for DLLs on Windows targets. Index: libgcc/configure.ac =================================================================== --- libgcc/configure.ac (revision 445788) +++ libgcc/configure.ac (working copy) @@ -398,16 +398,14 @@ esac # Used for constructing correct paths for offload compilers. accel_dir_suffix= +real_host_noncanonical=${host_noncanonical} +echo "eaaf: $enable_as_accelerator_for" if test x"$enable_as_accelerator_for" != x; then accel_dir_suffix=/accel/${target_noncanonical} - case "${target_noncanonical}" in - *-intelmicemul-*) - # In this case we expect offload compiler to be built as native, so we - # need to change install directory for driver to be able to find libgcc. - host_noncanonical=${enable_as_accelerator_for} ;; - esac + real_host_noncanonical=${enable_as_accelerator_for} fi AC_SUBST(accel_dir_suffix) +AC_SUBST(real_host_noncanonical) if test x"$enable_offload_targets" != x; then extra_parts="${extra_parts} crtoffloadbegin.o crtoffloadend.o" Index: libgcc/configure =================================================================== --- libgcc/configure (revision 445788) +++ libgcc/configure (working copy) @@ -566,6 +566,7 @@ sfp_machine_header set_use_emutls set_have_cc_tls vis_hide +real_host_noncanonical accel_dir_suffix force_explicit_eh_registry fixed_point @@ -4482,17 +4483,15 @@ esac # Used for constructing correct paths for offload compilers. accel_dir_suffix= +real_host_noncanonical=${host_noncanonical} +echo "eaaf: $enable_as_accelerator_for" if test x"$enable_as_accelerator_for" != x; then accel_dir_suffix=/accel/${target_noncanonical} - case "${target_noncanonical}" in - *-intelmicemul-*) - # In this case we expect offload compiler to be built as native, so we - # need to change install directory for driver to be able to find libgcc. - host_noncanonical=${enable_as_accelerator_for} ;; - esac + real_host_noncanonical=${enable_as_accelerator_for} fi + if test x"$enable_offload_targets" != x; then extra_parts="${extra_parts} crtoffloadbegin.o crtoffloadend.o" fi