public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] HP-UX 10.X reentrant functions
@ 2011-03-10 23:26 John David Anglin
  0 siblings, 0 replies; only message in thread
From: John David Anglin @ 2011-03-10 23:26 UTC (permalink / raw)
  To: gcc-patches

In HP-UX 10, the _r suffix routines are only declared when _REENTRANT
is defined.  Previously, we only defined _REENTRANT when -threads was
specified (DCE thread model).  However, we also need the reentrant
functions in the single thread model for libgfortran.  As far as I
can tell, the reentrant functions work fine without linking with
-lcma.  This similar to the situation on HP-UX 11 where the _REENTRANT
guard has been removed.  The only remaining guard is on `errno'.

In studying this, I learned that libc had been enhanced so that libc_r
was no longer needed on HP-UX 10.  Indeed, libc has a couple of additional
reentrant functions.  In HP-UX 10.30, the library changed to a POSIX 1c
implementations  libc_r was provided in HP-UX 10 for HP-UX 9 compatibility.
So, I've changed the thread linkage to use libc on HP-UX 10.

Tested on hppa1.1.-hp-hpux10.20 with no regressions.  Committed to trunk.

Dave
-- 
J. David Anglin                                  dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

2011-03-10  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* config/pa/pa-hpux10.h (TARGET_OS_CPP_BUILTINS): Define _REENTRANT
	when _HPUX_SOURCE is defined.
	(LIB_SPEC): Use -lc instead of -lc_r when -threads is specified.

Index: config/pa/pa-hpux10.h
===================================================================
--- config/pa/pa-hpux10.h	(revision 170562)
+++ config/pa/pa-hpux10.h	(working copy)
@@ -42,12 +42,14 @@
 	if (c_dialect_cxx ())						\
 	  {								\
 	    builtin_define ("_HPUX_SOURCE");				\
+	    builtin_define ("_REENTRANT");				\
 	    builtin_define ("_INCLUDE_LONGLONG");			\
 	    builtin_define ("__STDCPP__");				\
 	  }								\
 	else if (!flag_iso)						\
 	  {								\
 	    builtin_define ("_HPUX_SOURCE");				\
+	    builtin_define ("_REENTRANT");				\
 	    if (preprocessing_trad_p ())				\
 	      {								\
 		builtin_define ("hp9000s800");				\
@@ -111,7 +113,7 @@
   "%{!shared:\
      %{!p:%{!pg:\
        %{!threads:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}\
-       %{threads:-lcma -lc_r}}}\
+       %{threads:-lcma -lc}}}\
      %{p:%{!pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}\
      %{pg:-lc %{static:%{!nolibdld:-a shared -ldld -a archive -lc}}}}"
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-10 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-10 23:26 [committed] HP-UX 10.X reentrant functions John David Anglin

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).