diff mbox

[Solaris] Fix profiling

Message ID ydd39k4tal8.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth May 24, 2011, 2:52 p.m. UTC
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.

Comments

Eric Botcazou May 24, 2011, 9:27 p.m. UTC | #1
> 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!
diff mbox

Patch

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