diff mbox

Cilk Plus testsuite needs massive cleanup (PR testsuite/70595)

Message ID yddwpngvb6x.fsf@lokon.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth April 29, 2016, 12:41 p.m. UTC
Hi Dominique,

> Any reason why the dg-additional-options "*-lcilkrts" have been removed?
> AFAICT they are needed for darwin.

-fcilkplus does (and should) include -lcilkrts when linking.  It
certainly does on Solaris and Linux.  Everything else is a usability
nightmare: you don't need to link Fortran programs with

$ gfortran -lgfortran -lquadmath

do you?

gcc.c (LINK_COMMAND_SPEC) has

%{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\

and the generated libcilkrts.spec on Darwin has

*link_cilkrts: -lcilkrts %{static: }

Unfortunately, the darwin.h almost-copy of LINK_COMMAND_SPEC lacks
this.  We should really find a way to better modularize this (and other)
specs to avoid this error-prone duplication.

The following patch (completely untested) adds the above line to its
darwin.h counterpart.  I'll give it a whirl myself in this weekend's
bootstraps.  Sorry about the breakage.

	Rainer


2016-04-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/darwin.h (LINK_COMMAND_SPEC_A): Handle -fcilkplus.

Comments

Mike Stump April 29, 2016, 6:15 p.m. UTC | #1
On Apr 29, 2016, at 5:41 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
> --- a/gcc/config/darwin.h
> +++ b/gcc/config/darwin.h
> @@ -179,6 +179,7 @@ extern GTY(()) int darwin_ms_struct;
>     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
>     %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
>       %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
> +    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
>     %{fgnu-tm: \
>       %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
>     %{!nostdlib:%{!nodefaultlibs:\

Ok.
Mike Stump April 29, 2016, 6:19 p.m. UTC | #2
On Apr 29, 2016, at 5:41 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
> --- a/gcc/config/darwin.h
> +++ b/gcc/config/darwin.h
> @@ -179,6 +179,7 @@ extern GTY(()) int darwin_ms_struct;
>    %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
>    %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
>      %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
> +    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
>    %{fgnu-tm: \
>      %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
>    %{!nostdlib:%{!nodefaultlibs:\

Ok.
Ilya Verbin June 14, 2016, 6:09 p.m. UTC | #3
On Fri, Apr 29, 2016 at 11:19:47 -0700, Mike Stump wrote:
> On Apr 29, 2016, at 5:41 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
> > diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
> > --- a/gcc/config/darwin.h
> > +++ b/gcc/config/darwin.h
> > @@ -179,6 +179,7 @@ extern GTY(()) int darwin_ms_struct;
> >    %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
> >    %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
> >      %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
> > +    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
> >    %{fgnu-tm: \
> >      %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
> >    %{!nostdlib:%{!nodefaultlibs:\
> 
> Ok.

Is it OK to backport this patch to gcc-6-branch?
I've re-tested it on macOS with gcc 6.

  -- Ilya
Jeff Law June 14, 2016, 8:52 p.m. UTC | #4
On 06/14/2016 12:09 PM, Ilya Verbin wrote:
> On Fri, Apr 29, 2016 at 11:19:47 -0700, Mike Stump wrote:
>> On Apr 29, 2016, at 5:41 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>>> diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
>>> --- a/gcc/config/darwin.h
>>> +++ b/gcc/config/darwin.h
>>> @@ -179,6 +179,7 @@ extern GTY(()) int darwin_ms_struct;
>>>    %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
>>>    %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
>>>      %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
>>> +    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
>>>    %{fgnu-tm: \
>>>      %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
>>>    %{!nostdlib:%{!nodefaultlibs:\
>>
>> Ok.
>
> Is it OK to backport this patch to gcc-6-branch?
> I've re-tested it on macOS with gcc 6.
Yes.  This is fine.

jeff
Mike Stump June 15, 2016, 5:14 p.m. UTC | #5
On Jun 14, 2016, at 11:09 AM, Ilya Verbin <iverbin@gmail.com> wrote:
> 
> On Fri, Apr 29, 2016 at 11:19:47 -0700, Mike Stump wrote:
>> On Apr 29, 2016, at 5:41 AM, Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> wrote:
>>> diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
>>> --- a/gcc/config/darwin.h
>>> +++ b/gcc/config/darwin.h
>>> @@ -179,6 +179,7 @@ extern GTY(()) int darwin_ms_struct;
>>>   %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
>>>   %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
>>>     %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
>>> +    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
>>>   %{fgnu-tm: \
>>>     %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
>>>   %{!nostdlib:%{!nodefaultlibs:\
>> 
>> Ok.
> 
> Is it OK to backport this patch to gcc-6-branch?

Ok.
diff mbox

Patch

# HG changeset patch
# Parent  297a270669c098610ed0f7333b9a11ab4d3ef2bd
Handle -fcilkplus in Mac OS X LINK_COMMAND_SPEC

diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -179,6 +179,7 @@  extern GTY(()) int darwin_ms_struct;
     %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate*|coverage:-lgcov} \
     %{fopenacc|fopenmp|%:gt(%{ftree-parallelize-loops=*:%*} 1): \
       %{static|static-libgcc|static-libstdc++|static-libgfortran: libgomp.a%s; : -lgomp } } \
+    %{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
     %{fgnu-tm: \
       %{static|static-libgcc|static-libstdc++|static-libgfortran: libitm.a%s; : -litm } } \
     %{!nostdlib:%{!nodefaultlibs:\