This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] Don't link libgcc_s against libc on hppa*-*-hpux*.


The enclosed patch changes how we build libgcc_s.  I've removed
linking libgcc_s against HP libc based on the recommendations in
<http://docs.hp.com/en/1896/pthreads.html>.  The issue is that
libc contains pthread stubs and we have a dependency in the dwarf2
unwind code on pthreads, but we don't want to force linking against
libpthreads.  The situation is complicated in that the dynamic
loader may pick the stub or real pthread function depending on
shared library loading and search policy.  The default search
techniques are different for the 32 and 64 bit targets.

The problem also affect libtool but I don't have a fix for that.

This issue came up in testing the new libjava port.

Tested on hppa2.0w-hp-hpux11.11 and hppa64-hp-hpux11.11.

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

2006-05-18  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>

	* pa/t-hpux-shlib (SHLIB_LINK): Remove `-lc'.
	* pa/pa-hpux11.h (LIB_SPEC): Update comment.

Index: config/pa/t-hpux-shlib
===================================================================
--- config/pa/t-hpux-shlib	(revision 113893)
+++ config/pa/t-hpux-shlib	(working copy)
@@ -8,8 +8,7 @@
 SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
 
 SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -shared  -nodefaultlibs \
-	-o $(SHLIB_DIR)/$(SHLIB_NAME).tmp @multilib_flags@ \
-	$(SHLIB_OBJS) -lc && \
+	-o $(SHLIB_DIR)/$(SHLIB_NAME).tmp @multilib_flags@ $(SHLIB_OBJS) && \
         rm -f $(SHLIB_DIR)/$(SHLIB_SONAME) && \
 	if [ -f $(SHLIB_DIR)/$(SHLIB_NAME) ]; then \
 	  mv -f $(SHLIB_DIR)/$(SHLIB_NAME) $(SHLIB_DIR)/$(SHLIB_NAME).backup; \
Index: config/pa/pa-hpux11.h
===================================================================
--- config/pa/pa-hpux11.h	(revision 113893)
+++ config/pa/pa-hpux11.h	(working copy)
@@ -129,7 +129,10 @@
    %{static:-a archive} %{shared:-b}"
 #endif
 
-/* hpux 11 has posix threads.  */
+/* HP-UX 11 has posix threads.  HP libc contains pthread stubs so that
+   non-threaded applications can be linked with a thread-safe libc
+   without a subsequent loss of performance.  For more details, see
+   <http://docs.hp.com/en/1896/pthreads.html>.  */
 #undef LIB_SPEC
 #define LIB_SPEC \
   "%{!shared:\


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]