From patchwork Thu Nov 7 13:58:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 289342 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)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CA36F2C0098 for ; Fri, 8 Nov 2013 00:59:15 +1100 (EST) 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=xyWX0p+SvduXjmb1 FuJbVejiwTtnl4lWUX8TKwxpKOG5hjukil19WEVHVuvtFKaZ7WlatsiLQY3//jXw /Xp+K7gJkwsBxqD0IjjllIbBBRtJ0ZpAMK3FJXwVTzCrJINRTrXtU+JXkDOZRGdg lBcOliGKppniIaW0CFjPpHCyMUk= 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=EGdffvtlIcmtA2DOCDdpTa 3bsiI=; b=dzYQosB+WytJ9BMSi3Z2SzXVT7aKfU+h4m2aasL3zI1MKuc2k67Ex9 D4mnYFVJwnFKCuyQj12y8gyEO5BQ4EMq913jASDQkpJm55UJboc5S/art+x4MDlN To5sTPu+W7zmXCRrLlZjjr6XrHWlaxzTukKXadekcyxb5QjrdPNHY= Received: (qmail 5325 invoked by alias); 7 Nov 2013 13:59:04 -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 5313 invoked by uid 89); 7 Nov 2013 13:59:04 -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_50, RDNS_NONE, SPAM_SUBJECT, URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 07 Nov 2013 13:59:02 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VeQ6f-0003UG-Dk from Thomas_Schwinge@mentor.com ; Thu, 07 Nov 2013 05:58:45 -0800 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 7 Nov 2013 05:58:45 -0800 Received: from feldtkeller.schwinge.homeip.net (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Thu, 7 Nov 2013 13:58:40 +0000 From: Thomas Schwinge To: Jakub Jelinek CC: Subject: Generally link to libgomp for -ftree-parallelize-loops=* (was: [gomp4 4/9] OpenACC: The runtime library will be implemented in libgomp, too.) In-Reply-To: <20131107081545.GQ27813@tucnak.zalov.cz> References: <878ux1jp2s.fsf@schwinge.name> <1383766943-8863-1-git-send-email-thomas@codesourcery.com> <1383766943-8863-2-git-send-email-thomas@codesourcery.com> <1383766943-8863-3-git-send-email-thomas@codesourcery.com> <1383766943-8863-4-git-send-email-thomas@codesourcery.com> <20131107081545.GQ27813@tucnak.zalov.cz> User-Agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Thu, 7 Nov 2013 14:58:31 +0100 Message-ID: <87wqkkia9k.fsf@schwinge.name> MIME-Version: 1.0 Hi! On Thu, 7 Nov 2013 09:15:45 +0100, Jakub Jelinek wrote: > On Wed, Nov 06, 2013 at 08:42:18PM +0100, thomas@codesourcery.com wrote: > > --- gcc/config/arc/arc.h > > +++ gcc/config/arc/arc.h > > @@ -174,7 +174,7 @@ along with GCC; see the file COPYING3. If not see > > %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ > > %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ > > %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ > > - %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ > > + %{fopenacc|fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ > > Perhaps add here |ftree-parallelize-loops=* too? [...] Like this (for trunk and gomp-4_0-branch)? gcc/ * config/arc/arc.h (LINK_COMMAND_SPEC): For -ftree-parallelize-loops=*, link to libgomp and its dependencies. * config/ia64/hpux.h (LIB_SPEC): Likewise. * config/pa/pa-hpux11.h (LIB_SPEC): Likewise. * config/pa/pa64-hpux.h (LIB_SPEC): Likewise. * gcc.c (GOMP_SELF_SPECS): Update comment about libgomp's dependencies. libgomp/ * libgomp.spec.in: Update comment about libgomp's dependencies. * configure.ac: Likewise. * configure: Regenerate. Grüße, Thomas diff --git gcc/config/arc/arc.h gcc/config/arc/arc.h index 637f7b6..87908d4 100644 --- gcc/config/arc/arc.h +++ gcc/config/arc/arc.h @@ -174,7 +174,8 @@ along with GCC; see the file COPYING3. If not see %(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\ %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\ %{static:} %{L*} %(mfwrap) %(link_libgcc) %o\ - %{fopenmp:%:include(libgomp.spec)%(link_gomp)} %(mflib)\ + %{fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\ + %(mflib)\ %{fprofile-arcs|fprofile-generate|coverage:-lgcov}\ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %(link_gcc_c_sequence)}}\ %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}" diff --git gcc/config/ia64/hpux.h gcc/config/ia64/hpux.h index ca592e4..517132c 100644 --- gcc/config/ia64/hpux.h +++ gcc/config/ia64/hpux.h @@ -92,7 +92,7 @@ do { \ #undef LIB_SPEC #define LIB_SPEC \ "%{!shared: \ - %{mt|pthread:%{fopenmp:-lrt} -lpthread} \ + %{mt|pthread:%{fopenmp|ftree-parallelize-loops=*:-lrt} -lpthread} \ %{p:%{!mlp64:-L/usr/lib/hpux32/libp} \ %{mlp64:-L/usr/lib/hpux64/libp} -lprof} \ %{pg:%{!mlp64:-L/usr/lib/hpux32/libp} \ diff --git gcc/config/pa/pa-hpux11.h gcc/config/pa/pa-hpux11.h index c217398..4da1b09 100644 --- gcc/config/pa/pa-hpux11.h +++ gcc/config/pa/pa-hpux11.h @@ -120,7 +120,8 @@ along with GCC; see the file COPYING3. If not see #undef LIB_SPEC #define LIB_SPEC \ "%{!shared:\ - %{fopenmp:%{static:-a archive_shared} -lrt %{static:-a archive}}\ + %{fopenmp|ftree-parallelize-loops=*:%{static:-a archive_shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a archive_shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}\ diff --git gcc/config/pa/pa64-hpux.h gcc/config/pa/pa64-hpux.h index a3e21d3..9efc137 100644 --- gcc/config/pa/pa64-hpux.h +++ gcc/config/pa/pa64-hpux.h @@ -58,19 +58,22 @@ along with GCC; see the file COPYING3. If not see #if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GNU_LD) #define LIB_SPEC \ "%{!shared:\ - %{!p:%{!pg:%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{!p:%{!pg:%{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ %{p:%{!pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\ -lprof %{static:-a archive}\ - %{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ %{pg:%{static:%{!mhp-ld:-a shared}%{mhp-ld:-a archive_shared}}\ -lgprof %{static:-a archive}\ - %{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ @@ -78,19 +81,22 @@ along with GCC; see the file COPYING3. If not see #else #define LIB_SPEC \ "%{!shared:\ - %{!p:%{!pg:%{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{!p:%{!pg:%{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ %{p:%{!pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\ -lprof %{static:-a archive}\ - %{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ %{pg:%{static:%{mgnu-ld:-a shared}%{!mgnu-ld:-a archive_shared}}\ -lgprof %{static:-a archive}\ - %{fopenmp:%{static:-a shared} -lrt %{static:-a archive}}\ + %{fopenmp|ftree-parallelize-loops=*:%{static:-a shared} -lrt\ + %{static:-a archive}}\ %{mt|pthread:-lpthread} -lc\ %{static:%{!nolibdld:-a shared -ldld -a archive -lc}\ %{!mt:%{!pthread:-a shared -lc -a archive}}}}}\ diff --git gcc/gcc.c gcc/gcc.c index 83607e5..dff7477 100644 --- gcc/gcc.c +++ gcc/gcc.c @@ -924,7 +924,7 @@ static const char *const multilib_defaults_raw[] = MULTILIB_DEFAULTS; #define DRIVER_SELF_SPECS "" #endif -/* Adding -fopenmp should imply pthreads. This is particularly important +/* Linking to libgomp implies pthreads. This is particularly important for targets that use different start files and suchlike. */ #ifndef GOMP_SELF_SPECS #define GOMP_SELF_SPECS "%{fopenmp|ftree-parallelize-loops=*: -pthread}" diff --git libgomp/configure.ac libgomp/configure.ac index e7fbb31..84d250f 100644 --- libgomp/configure.ac +++ libgomp/configure.ac @@ -274,7 +274,7 @@ else fi # Set up the set of libraries that we need to link against for libgomp. -# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp, +# Note that the GOMP_SELF_SPEC in gcc.c may force -pthread, # which will force linkage against -lpthread (or equivalent for the system). # That's not 100% ideal, but about the best we can do easily. if test $enable_shared = yes; then diff --git libgomp/libgomp.spec.in libgomp/libgomp.spec.in index b7319f3..5651603 100644 --- libgomp/libgomp.spec.in +++ libgomp/libgomp.spec.in @@ -1,3 +1,3 @@ # This spec file is read by gcc when linking. It is used to specify the -# standard libraries we need in order to link with -fopenmp. +# standard libraries we need in order to link with libgomp. *link_gomp: @link_gomp@