Bug 362768: implemented NSPR shared library finalization function for AIX. NSPRPUB_PRE_4_2_CLIENT_BRANCH MOZILLA_1_9a2_RC1 MOZILLA_1_9a2_RELEASE SUNBIRD_0_3_1_RC2
authorwtchang%redhat.com
Sat, 20 Jan 2007 20:30:53 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 3800 9a976ebeae257691139141b05c5b8e861e2e65e7
parent 3796 d99e2ad3d92020cfa56258f99c0f5c58328fe9e1
child 3803 5d51fbfcea120d63c5f84de9fd74504a2bb3190d
push idunknown
push userunknown
push dateunknown
bugs362768
Bug 362768: implemented NSPR shared library finalization function for AIX. r=nelsonb Modified files: pr/src/Makefile.in ptthread.c Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
pr/src/Makefile.in
pr/src/pthreads/ptthread.c
--- a/pr/src/Makefile.in
+++ b/pr/src/Makefile.in
@@ -114,16 +114,17 @@ endif	# SunOS
 ifeq ($(OS_ARCH), IRIX)
 ifeq ($(USE_PTHREADS), 1)
 OS_LIBS = -lpthread
 endif
 OS_LIBS += -lc
 endif
 
 ifeq ($(OS_ARCH),AIX)
+DSO_LDOPTS	+= -binitfini::_PR_Fini
 OS_LIBS		= -lodm -lcfg
 ifeq ($(CLASSIC_NSPR),1)
 ifeq ($(OS_RELEASE),4.1)
 OS_LIBS		+= -lsvld -lc
 else
 OS_LIBS		+= -ldl -lc
 endif
 else
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -936,20 +936,29 @@ void _PR_InitThreads(
 
 #ifdef __GNUC__
 /*
  * GCC supports the constructor and destructor attributes as of
  * version 2.5.
  */
 static void _PR_Fini(void) __attribute__ ((destructor));
 #elif defined(__SUNPRO_C)
+/*
+ * Sun Studio compiler
+ */
 #pragma fini(_PR_Fini)
+static void _PR_Fini(void);
 #elif defined(HPUX)
+/*
+ * Current versions of HP C compiler define __HP_cc.
+ * HP C compiler A.11.01.20 doesn't define __HP_cc.
+ */
 #if defined(__ia64) || defined(_LP64)
 #pragma FINI "_PR_Fini"
+static void _PR_Fini(void);
 #else
 /*
  * Only HP-UX 10.x style initializers are supported in 32-bit links.
  * Need to use the +I PR_HPUX10xInit linker option.
  */
 #include <dl.h>
 
 static void _PR_Fini(void);
@@ -969,20 +978,20 @@ void PR_HPUX10xInit(shl_t handle, int lo
     if (loading) {
 	/* ... do some initializations ... */
     } else {
 	_PR_Fini();
     }
 }
 #endif
 #elif defined(AIX)
-/* Need to use the binitfini::_PR_Fini linker option. */
+/* Need to use the -binitfini::_PR_Fini linker option. */
 #endif
 
-static void _PR_Fini(void)
+void _PR_Fini(void)
 {
     void *thred;
     int rv;
 
     if (!_pr_initialized) return;
 
     _PT_PTHREAD_GETSPECIFIC(pt_book.key, thred);
     if (NULL != thred)