From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20337 invoked by alias); 19 Feb 2015 11:43:10 -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 20320 invoked by uid 89); 19 Feb 2015 11:43:09 -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 11:43:07 +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 1YOPVW-0000D3-MW from Thomas_Schwinge@mentor.com ; Thu, 19 Feb 2015 03:43:03 -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 11:43:00 +0000 From: Thomas Schwinge To: Bernd Schmidt , Jakub Jelinek , Ilya Verbin CC: Richard Biener , Jan Hubicka , , Joseph Myers , , Subject: Offloading compilers' support libraries (was: nvptx offloading patches [3/n], RFD) In-Reply-To: <54E5ACCE.7080502@codesourcery.com> 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> <54E5ACCE.7080502@codesourcery.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 12:02:00 -0000 Message-ID: <8761aydt4y.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/msg01177.txt.bz2 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-length: 5978 Hi! On Thu, 19 Feb 2015 10:28:46 +0100, Bernd Schmidt = wrote: > 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' fa= iled > >>> 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 expec= ted 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 dependen= cies on > >>> newlib headers as newlib is built after libgcc? > >> > >> I've committed this patch to fix this last issue (the header dependenc= e, > >> 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/objnvpt= x/./gcc/ -nostdinc -B/usr/src/gcc/objnvptx/nvptx-none/newlib/ -isystem /usr= /src/gcc/objnvptx/nvptx-none/newlib/targ-include -isystem /usr/src/gcc/newl= ib/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-in= clude -g -O2 conftest.c >&5 > > error opening libc.a > > collect2: error: ld returned 1 exit status > > very early during in-tree newlib configure. >=20 > Not a fix for your problem, but there's a similar issue when trying to=20 > get at the libgcc for the nvptx accel compiler after it's been=20 > installed. The libgcc Makefile puts it in the wrong place -=20 > gcc/nvptx-none/accel/nvptx-none instead of gcc/host/accel/nvptx-none.=20 I also wondered about this; it's somewhere on my TODO list... > The patch below corrects that and removes an intelmicemul special case=20 > which I believe has the same effect - Ilya, could you test this? This code has originally been posted in . This specific buglet aside (that the handling of intelmic and nvptx offloading is inconsistent) -- will we have to add such handling to each and every library that is built for the offloading compilers? (Including libraries that aren't part of the GCC sources, but may be built as part of GCC's build process, such as when newlib is linked into [GCC]/newlib?) One step back -- I understand correctly that this change is to make sure that the regular target compiler and the offloading compilers don't clash in their installed files' names? (By putting them into the accel/[offloading architecture]/ subdirectory?) (As I've written in , I currently install into separate prefixes/DESTDIRS, because I have not yet verified that there is no overlap in the installed files.) Then, why does this only apply to libsubdir? What about header files, documentation files, and so on? (If they aren't expected to differ between the target and offloading compilers, I think it's still not a good idea to arbitrarely have them be overwritten by on respective build tree's make install process.) Should we have a more general solution to this problem? > Index: libgcc/Makefile.in > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libgcc/Makefile.in (revision 445788) > +++ libgcc/Makefile.in (working copy) > @@ -45,6 +45,7 @@ fixed_point =3D @fixed_point@ > with_aix_soname =3D @with_aix_soname@ >=20=20 > host_noncanonical =3D @host_noncanonical@ > +real_host_noncanonical =3D @real_host_noncanonical@ > target_noncanonical =3D @target_noncanonical@ >=20=20 > # List of extra object files that should be compiled for this target mac= hine. > @@ -185,7 +186,7 @@ STRIP =3D @STRIP@ > STRIP_FOR_TARGET =3D $(STRIP) >=20=20 > # Directory in which the compiler finds libraries etc. > -libsubdir =3D $(libdir)/gcc/$(host_noncanonical)/$(version)@accel_dir_su= ffix@ > +libsubdir =3D $(libdir)/gcc/$(real_host_noncanonical)/$(version)@accel_d= ir_suffix@ > # Used to install the shared libgcc. > slibdir =3D @slibdir@ > # Maybe used for DLLs on Windows targets. > Index: libgcc/configure.ac > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- libgcc/configure.ac (revision 445788) > +++ libgcc/configure.ac (working copy) > @@ -398,16 +398,14 @@ esac >=20=20 > # Used for constructing correct paths for offload compilers. > accel_dir_suffix=3D > +real_host_noncanonical=3D${host_noncanonical} > +echo "eaaf: $enable_as_accelerator_for" > if test x"$enable_as_accelerator_for" !=3D x; then > accel_dir_suffix=3D/accel/${target_noncanonical} > - case "${target_noncanonical}" in > - *-intelmicemul-*) > - # In this case we expect offload compiler to be built as native, s= o we > - # need to change install directory for driver to be able to find l= ibgcc. > - host_noncanonical=3D${enable_as_accelerator_for} ;; > - esac > + real_host_noncanonical=3D${enable_as_accelerator_for} > fi > AC_SUBST(accel_dir_suffix) > +AC_SUBST(real_host_noncanonical) >=20=20 > if test x"$enable_offload_targets" !=3D x; then > extra_parts=3D"${extra_parts} crtoffloadbegin.o crtoffloadend.o" Gr=C3=BC=C3=9Fe, Thomas --=-=-= Content-Type: application/pgp-signature Content-length: 472 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJU5cw9AAoJEPoxNhtoi6COXIkH/12l2gx/JgYtv88skrmzSUDu AlvHCKa7GxcN9eSJ3ACUbBIqxUXVwIdQicFq9+9vauV6z71qeW6xporX1uKlWRl+ 4MxHNy97smditouXLONWkuUAprXns1D8al3c/27i4wSYaB2CGKCR9kmD3dKTdJGw Z/kv1lsmrxtvMxvuNVoMazfOdXWluh/41uA8l2YJLG++4RsvvCnnDMYL0LniTFSx 2wo5872+G0Z+Kw9baV0zyYKJwjkSy72pbIepQL6OgRL9LukEsGWpAIEkCfkMjHWF wJrn8phd8mRTCrj3jis5yFg+dUhdx5eVr8Orn77/Yv+qawFwxTnwvW4/iYBwjxI= =vfas -----END PGP SIGNATURE----- --=-=-=--