From patchwork Wed Sep 17 13:31:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 390401 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 D73AC1400E0 for ; Wed, 17 Sep 2014 23:32:03 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=p4FdT1alJVpOauddEkyXv6i9aLQKC ahSO3Hn4cibA7w0UoSyKsDcwiRc6l4l8w4CtCu7cuAXtl/AB/X44P71kjfDgg8Sq VtygdKhQpXi9nFFDWl6Vh/Wu9xjfEblOMizim5zXIZprl3FGCeundqsqULgmcAhj SWTZZMTztEvGt8= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=ByuS+CDVD6aG3rkRL200HJrTwMc=; b=Zns Ww9X5i17YvIhz8aTntk1hSePU/et3CDQTWNTygAV3tVDvu03/EAXsxGpRe4WarqF G44Ryg6aCLg2xDoYWw0fhSmquElnZmZD4Lq6ZBW5k4IjI2v6k/E9+VxstTl5thnh fQSK0DQuCK/92uGFG4PoSdhAShDUFx/8tm+AvWjQ= Received: (qmail 14298 invoked by alias); 17 Sep 2014 13:31:57 -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 14287 invoked by uid 89); 17 Sep 2014 13:31:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS 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, 17 Sep 2014 13:31:54 +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 s8HDVoOG030734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 17 Sep 2014 09:31:51 -0400 Received: from tucnak.zalov.cz (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s8HDVm8o031509 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 17 Sep 2014 09:31:49 -0400 Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.14.8/8.14.7) with ESMTP id s8HDVkwJ023849; Wed, 17 Sep 2014 15:31:46 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.14.8/8.14.8/Submit) id s8HDVicO023848; Wed, 17 Sep 2014 15:31:44 +0200 Date: Wed, 17 Sep 2014 15:31:44 +0200 From: Jakub Jelinek To: Ilya Verbin , Kirill Yukhin , Bernd Schmidt , Alexandre Oliva , Paolo Bonzini , DJ Delorie Cc: gcc-patches@gcc.gnu.org Subject: [kyukhin/gomp4-offload] DESTDIR issues Message-ID: <20140917133144.GF17454@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes Hi! It seems building of the host compiler requires the offloading compiler to be installed directly in the prefix, which is something really undesirable e.g. for distro builds where things are installed with non-empty $(DESTDIR). Right now it seems that for building all that is needed is main_target_image.h. Either we can do something like the following patch, i.e. look at -I$(DESTDIR)/$(target_dir)/include first and fall back to -I$(target_dir)/include, which fixed the build for me, but unfortunately it violates GNU conventions: https://www.gnu.org/prep/standards/html_node/DESTDIR.html "DESTDIR should be supported only in the install* and uninstall* targets, as those are the only targets where it is useful." while this patch uses it during build. Another option would be to have two different modes of building --enable-offload-targets= compilers, one where you really have all the offloading target compilers installed (with empty DESTDIR, or initially with non-empty DESTDIR, then somehow (package manager, etc.) copied to the right prefix), and another one where for each offloading target you'd additionally specify the build directory containing non-installed tree (dunno, could be e.g. --enable-offload-targets=x86_64-intelmic-linux-gnu=/some/path,ptx-none=/some/other/path format?) and let the host compiler's build look into the other build trees for what it needs during building and/or testing (for building main_target_image.h should be supposedly all that is needed, for testing perhaps more). Thoughts on this? 2014-09-17 Jakub Jelinek * plugin/Makefile.am (libgomp_plugin_mic_la_CPPFLAGS): Use $(DESTDIR)$(target_dir)/include path before trying $(target_dir)/include. * plugin/Makefile.in: Regenerated. Jakub --- liboffloadmic/plugin/Makefile.am 2014-09-16 18:16:17.961415565 +0200 +++ liboffloadmic/plugin/Makefile.am 2014-09-17 14:40:26.990566860 +0200 @@ -47,7 +47,7 @@ target_dir = $(libdir)/gcc/$(accel_targe if PLUGIN_HOST toolexeclib_LTLIBRARIES = libgomp-plugin-mic.la libgomp_plugin_mic_la_SOURCES = libgomp-plugin-mic.cpp - libgomp_plugin_mic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -DMIC_LIB_PATH=\"$(target_dir)\" -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_dir) -I$(target_dir)/include + libgomp_plugin_mic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -DMIC_LIB_PATH=\"$(target_dir)\" -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_dir) -I$(DESTDIR)$(target_dir)/include -I$(target_dir)/include libgomp_plugin_mic_la_LDFLAGS = -L$(liboffload_dir)/.libs -loffloadmic -version-info 1:0:0 else # PLUGIN_TARGET plugin_includedir = $(libsubincludedir) --- liboffloadmic/plugin/Makefile.in 2014-09-16 18:16:17.961415565 +0200 +++ liboffloadmic/plugin/Makefile.in 2014-09-17 14:54:50.555096069 +0200 @@ -277,7 +277,7 @@ libsubincludedir = $(libdir)/gcc/$(targe target_dir = $(libdir)/gcc/$(accel_target)/$(gcc_version) @PLUGIN_HOST_TRUE@toolexeclib_LTLIBRARIES = libgomp-plugin-mic.la @PLUGIN_HOST_TRUE@libgomp_plugin_mic_la_SOURCES = libgomp-plugin-mic.cpp -@PLUGIN_HOST_TRUE@libgomp_plugin_mic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -DMIC_LIB_PATH=\"$(target_dir)\" -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_dir) -I$(target_dir)/include +@PLUGIN_HOST_TRUE@libgomp_plugin_mic_la_CPPFLAGS = $(CPPFLAGS) -DLINUX -DCOI_LIBRARY_VERSION=2 -DMYO_SUPPORT -DOFFLOAD_DEBUG=1 -DSEP_SUPPORT -DTIMING_SUPPORT -DHOST_LIBRARY=1 -DMIC_LIB_PATH=\"$(target_dir)\" -I$(coi_inc_dir) -I$(myo_inc_dir) -I$(liboffload_src_dir) -I$(libgomp_dir) -I$(DESTDIR)$(target_dir)/include -I$(target_dir)/include @PLUGIN_HOST_TRUE@libgomp_plugin_mic_la_LDFLAGS = -L$(liboffload_dir)/.libs -loffloadmic -version-info 1:0:0 @PLUGIN_HOST_FALSE@plugin_includedir = $(libsubincludedir) @PLUGIN_HOST_FALSE@plugin_include_HEADERS = main_target_image.h