public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Solaris] Fix profiling
@ 2011-05-22 22:25 Eric Botcazou
  2011-05-24 14:52 ` Eric Botcazou
  2011-05-24 15:54 ` Rainer Orth
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Botcazou @ 2011-05-22 22:25 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 480 bytes --]

Hi,

after http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02139.html profiling uses 
TLS support where available.  This breaks on SPARC/Solaris 8 and 9 (at least) 
because the associated libraries aren't linked in.

Tested on SPARC/Solaris 8 and SPARC64/Solaris 9 (the Solaris 10 machine isn't 
in very good shape right now), OK for the mainline?


2011-05-22  Eric Botcazou  <ebotcazou@adacore.com>

	* config/sol2.h (LIB_SPEC): Link TLS support for profiling.


-- 
Eric Botcazou

[-- Attachment #2: p.diff --]
[-- Type: text/x-diff, Size: 487 bytes --]

Index: config/sol2.h
===================================================================
--- config/sol2.h	(revision 174027)
+++ config/sol2.h	(working copy)
@@ -136,6 +136,8 @@ along with GCC; see the file COPYING3.
    %{!symbolic:\
      %{pthreads|pthread:" \
         LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
+     %{fprofile-arcs|fprofile-generate*|coverage:" \
+        LIB_THREAD_LDFLAGS_SPEC " " LIB_TLS_SPEC "} \
      %{p|pg:-ldl} -lc}"
 
 #undef  ENDFILE_SPEC

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Solaris] Fix profiling
  2011-05-22 22:25 [Solaris] Fix profiling Eric Botcazou
@ 2011-05-24 14:52 ` Eric Botcazou
  2011-05-24 15:54 ` Rainer Orth
  1 sibling, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2011-05-24 14:52 UTC (permalink / raw)
  To: gcc-patches

> Tested on SPARC/Solaris 8 and SPARC64/Solaris 9 (the Solaris 10 machine
> isn't in very good shape right now).

Also tested on SPARC/Solaris 10 now.

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Solaris] Fix profiling
  2011-05-22 22:25 [Solaris] Fix profiling Eric Botcazou
  2011-05-24 14:52 ` Eric Botcazou
@ 2011-05-24 15:54 ` Rainer Orth
  2011-05-24 22:29   ` Eric Botcazou
  1 sibling, 1 reply; 4+ messages in thread
From: Rainer Orth @ 2011-05-24 15:54 UTC (permalink / raw)
  To: Eric Botcazou; +Cc: gcc-patches

Hi Eric,

> after http://gcc.gnu.org/ml/gcc-patches/2011-04/msg02139.html profiling uses 
> TLS support where available.  This breaks on SPARC/Solaris 8 and 9 (at least) 
> because the associated libraries aren't linked in.

this is PR gcov-profile/48845.

> Tested on SPARC/Solaris 8 and SPARC64/Solaris 9 (the Solaris 10 machine isn't 
> in very good shape right now), OK for the mainline?
>
>
> 2011-05-22  Eric Botcazou  <ebotcazou@adacore.com>
>
> 	* config/sol2.h (LIB_SPEC): Link TLS support for profiling.

While I've got a testsuite patch to fix this (which also fixes/cleanes
up a couple of other issues in that area), I agree that this should work
out of the box and without the user having to know about such an
implementation detail.

On the other hand, the patch is only necessary for tree profiling,
i.e. with -fprofile-generate, so I'm checking in the following.

Bootstrapped without regressions on i386-pc-solaris2.{[89], 1[01]},
installed on mainline.

Thanks for the patch.

	Rainer


2011-05-22  Eric Botcazou  <ebotcazou@adacore.com>
	    Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	PR gcov-profile/48845
	* config/sol2.h (LIB_SPEC): Link TLS support for tree profiling.

diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -136,6 +136,8 @@ along with GCC; see the file COPYING3.  
    %{!symbolic:\
      %{pthreads|pthread:" \
         LIB_THREAD_LDFLAGS_SPEC " -lpthread " LIB_TLS_SPEC "} \
+     %{fprofile-generate*:" \
+        LIB_THREAD_LDFLAGS_SPEC " " LIB_TLS_SPEC "} \
      %{p|pg:-ldl} -lc}"
 
 #undef  ENDFILE_SPEC

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Solaris] Fix profiling
  2011-05-24 15:54 ` Rainer Orth
@ 2011-05-24 22:29   ` Eric Botcazou
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Botcazou @ 2011-05-24 22:29 UTC (permalink / raw)
  To: Rainer Orth; +Cc: gcc-patches

> this is PR gcov-profile/48845.

Indeed, I totally missed it.

> On the other hand, the patch is only necessary for tree profiling,
> i.e. with -fprofile-generate, so I'm checking in the following.
>
> Bootstrapped without regressions on i386-pc-solaris2.{[89], 1[01]},
> installed on mainline.

Thanks!

-- 
Eric Botcazou

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-24 21:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-22 22:25 [Solaris] Fix profiling Eric Botcazou
2011-05-24 14:52 ` Eric Botcazou
2011-05-24 15:54 ` Rainer Orth
2011-05-24 22:29   ` Eric Botcazou

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).