summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcls%seawood.org <devnull@localhost>2005-06-01 14:10:53 +0000
committercls%seawood.org <devnull@localhost>2005-06-01 14:10:53 +0000
commit0b270d4b837280fd6d036384c5f485ed3ce29d40 (patch)
tree87dd910d037674db4f1ab9af99275933f34a4ed3
parent67c861af661826f19ed0fc8834340728d46432bd (diff)
downloadnspr-hg-0b270d4b837280fd6d036384c5f485ed3ce29d40.tar.gz
Sync with NSPR 4.6
Bug #295761 a=shaver
-rwxr-xr-xadmin/repackage.sh8
-rwxr-xr-xconfigure155
-rw-r--r--configure.in107
-rw-r--r--pr/include/md/_unix_errors.h82
-rw-r--r--pr/include/prinit.h4
-rw-r--r--pr/src/md/unix/uxwrap.c2
-rw-r--r--pr/src/pthreads/ptthread.c27
-rw-r--r--pr/tests/bigfile3.c1
-rw-r--r--pr/tests/env.c1
-rw-r--r--pr/tests/initclk.c1
-rw-r--r--pr/tests/layer.c1
-rw-r--r--pr/tests/nbconn.c1
-rw-r--r--pr/tests/ntioto.c5
-rw-r--r--pr/tests/op_filnf.c7
-rw-r--r--pr/tests/prpoll.c4
-rw-r--r--pr/tests/randseed.c7
-rw-r--r--pr/tests/sel_spd.c2
-rw-r--r--pr/tests/vercheck.c11
18 files changed, 229 insertions, 197 deletions
diff --git a/admin/repackage.sh b/admin/repackage.sh
index 2e0126d6..d25b15a5 100755
--- a/admin/repackage.sh
+++ b/admin/repackage.sh
@@ -64,10 +64,10 @@
#
# ------------------------------------------------------------------
-FROMTOP=/share/builds/components/nspr20/v4.5
-TOTOP=./v4.5
-NSPRDIR=nspr-4.5
-SOURCETAG=NSPR_4_5_RTM
+FROMTOP=/share/builds/components/nspr20/v4.6
+TOTOP=./v4.6
+NSPRDIR=nspr-4.6
+SOURCETAG=NSPR_4_6_RTM
#
# enumerate Unix object directories on /s/b/c
diff --git a/configure b/configure
index 5850f8c0..aa42becb 100755
--- a/configure
+++ b/configure
@@ -2682,75 +2682,76 @@ else
fi
if test "$GNU_CC"; then
- echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
+ echo $ac_n "checking for visibility(hidden) attribute""... $ac_c" 1>&6
echo "configure:2687: checking for visibility(hidden) attribute" >&5
if eval "test \"`echo '$''{'ac_cv_visibility_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
- int foo __attribute__ ((visibility ("hidden"))) = 1;
+ int foo __attribute__ ((visibility ("hidden"))) = 1;
EOF
- ac_cv_visibility_attribute=no
- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
- ac_cv_visibility_hidden=yes
- fi
- fi
- rm -f conftest.cs
-
+ ac_cv_visibility_hidden=no
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '\.hidden.*foo' conftest.s >/dev/null; then
+ ac_cv_visibility_hidden=yes
+ fi
+ fi
+ rm -f conftest.cs
+
fi
echo "$ac_t""$ac_cv_visibility_hidden" 1>&6
- if test "$ac_cv_visibility_hidden" = "yes"; then
- cat >> confdefs.h <<\EOF
+ if test "$ac_cv_visibility_hidden" = "yes"; then
+ cat >> confdefs.h <<\EOF
#define HAVE_VISIBILITY_HIDDEN_ATTRIBUTE 1
EOF
- echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
+ echo $ac_n "checking for visibility pragma support""... $ac_c" 1>&6
echo "configure:2711: checking for visibility pragma support" >&5
if eval "test \"`echo '$''{'ac_cv_visibility_pragma'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
#pragma GCC visibility push(hidden)
- int foo_hidden = 1;
+ int foo_hidden = 1;
#pragma GCC visibility push(default)
- int foo_default = 1;
+ int foo_default = 1;
EOF
- ac_cv_visibility_pragma=no
- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
- if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
- if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
- ac_cv_visibility_pragma=yes
- fi
- fi
- fi
- rm -f conftest.cs
-
+ ac_cv_visibility_pragma=no
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
+ if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
+ ac_cv_visibility_pragma=yes
+ fi
+ fi
+ fi
+ rm -f conftest.cs
+
fi
echo "$ac_t""$ac_cv_visibility_pragma" 1>&6
- if test "$ac_cv_visibility_pragma" = "yes"; then
- cat >> confdefs.h <<\EOF
+ if test "$ac_cv_visibility_pragma" = "yes"; then
+ cat >> confdefs.h <<\EOF
#define HAVE_VISIBILITY_PRAGMA 1
EOF
- # To work around a build problem on Linux x86-64 (Bugzilla bug
- # 293438), we use the -fvisibility=hidden flag. This flag is less
- # optimal than #pragma GCC visibility push(hidden) because the flag
- # assumes that symbols defined outside the current source file have
- # the default visibility. This has the advantage that we don't need
- # to wrap system header files, but has the disadvantage that calls
- # to hidden symbols defined in other source files cannot be
- # optimized by the compiler. The -fvisibility=hidden flag does
- # hide and export symbols correctly.
- #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
- #WRAP_SYSTEM_INCLUDES=1
- VISIBILITY_FLAGS="-fvisibility=hidden"
- WRAP_SYSTEM_INCLUDES=
- fi
- fi
-fi # GNU_CC
+ # To work around a build problem on Linux x86-64 (Bugzilla bug
+ # 293438), we use the -fvisibility=hidden flag. This flag is less
+ # optimal than #pragma GCC visibility push(hidden) because the flag
+ # assumes that symbols defined outside the current source file have
+ # the default visibility. This has the advantage that we don't need
+ # to wrap system header files, but has the disadvantage that calls
+ # to hidden symbols defined in other source files cannot be
+ # optimized by the compiler. The -fvisibility=hidden flag does
+ # hide and export symbols correctly.
+ #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+ #WRAP_SYSTEM_INCLUDES=1
+ VISIBILITY_FLAGS="-fvisibility=hidden"
+ WRAP_SYSTEM_INCLUDES=
+ fi
+ fi
+fi # GNU_CC
+
fi # SKIP_COMPILER_CHECKS
if test -z "$SKIP_PATH_CHECKS"; then
@@ -2759,7 +2760,7 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2763: checking for $ac_word" >&5
+echo "configure:2764: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3004,17 +3005,17 @@ EOF
DSO_LDOPTS='-brtl -bnortllib -bM:SRE -bnoentry -bexpall -blibpath:/usr/lib:/lib'
ac_safe=`echo "sys/atomic_op.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for sys/atomic_op.h""... $ac_c" 1>&6
-echo "configure:3008: checking for sys/atomic_op.h" >&5
+echo "configure:3009: checking for sys/atomic_op.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3013 "configure"
+#line 3014 "configure"
#include "confdefs.h"
#include <sys/atomic_op.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3018: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3019: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -3171,7 +3172,7 @@ EOF
_DEBUG_FLAGS='-gdwarf-2 -O0'
MKSHLIB='$(CCC) $(DSO_LDOPTS) -o $@'
echo $ac_n "checking for gethostbyaddr in -lbind""... $ac_c" 1>&6
-echo "configure:3175: checking for gethostbyaddr in -lbind" >&5
+echo "configure:3176: checking for gethostbyaddr in -lbind" >&5
ac_lib_var=`echo bind'_'gethostbyaddr | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -3179,7 +3180,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lbind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3183 "configure"
+#line 3184 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -3190,7 +3191,7 @@ int main() {
gethostbyaddr()
; return 0; }
EOF
-if { (eval echo configure:3194: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3195: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -4030,6 +4031,11 @@ EOF
DLLFLAGS="$DLLFLAGS -DEBUG"
LDFLAGS="$LDFLAGS -DEBUG"
fi
+
+ OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
+ if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
+ OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
+ fi
if test "$OS_TARGET" = "WINNT"; then
CFLAGS="$CFLAGS -GT"
@@ -4079,11 +4085,6 @@ EOF
OBJDIR_SUFFIX=OBJD
fi
- OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
- if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
- OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
- fi
-
case "$OS_TARGET" in
WINNT)
MDCPUCFG_H=_winnt.cfg
@@ -4421,17 +4422,17 @@ EOF
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
ac_safe=`echo "machine/builtins.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for machine/builtins.h""... $ac_c" 1>&6
-echo "configure:4425: checking for machine/builtins.h" >&5
+echo "configure:4426: checking for machine/builtins.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4430 "configure"
+#line 4431 "configure"
#include "confdefs.h"
#include <machine/builtins.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4435: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4436: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -4973,7 +4974,7 @@ case $target in
;;
*)
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:4977: checking for dlopen in -ldl" >&5
+echo "configure:4978: checking for dlopen in -ldl" >&5
ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -4981,7 +4982,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4985 "configure"
+#line 4986 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
@@ -4992,7 +4993,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:4996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4997: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes"
else
@@ -5009,17 +5010,17 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
ac_safe=`echo "dlfcn.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for dlfcn.h""... $ac_c" 1>&6
-echo "configure:5013: checking for dlfcn.h" >&5
+echo "configure:5014: checking for dlfcn.h" >&5
if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5018 "configure"
+#line 5019 "configure"
#include "confdefs.h"
#include <dlfcn.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5023: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5024: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
rm -rf conftest*
@@ -5052,13 +5053,13 @@ esac
if test $ac_cv_prog_gcc = yes; then
echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6
-echo "configure:5056: checking whether ${CC-cc} needs -traditional" >&5
+echo "configure:5057: checking whether ${CC-cc} needs -traditional" >&5
if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_pattern="Autoconf.*'x'"
cat > conftest.$ac_ext <<EOF
-#line 5062 "configure"
+#line 5063 "configure"
#include "confdefs.h"
#include <sgtty.h>
Autoconf TIOCGETP
@@ -5076,7 +5077,7 @@ rm -f conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat > conftest.$ac_ext <<EOF
-#line 5080 "configure"
+#line 5081 "configure"
#include "confdefs.h"
#include <termio.h>
Autoconf TCGETA
@@ -5100,12 +5101,12 @@ fi
for ac_func in lchown strerror
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5104: checking for $ac_func" >&5
+echo "configure:5105: checking for $ac_func" >&5
if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5109 "configure"
+#line 5110 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5128,7 +5129,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5132: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5133: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5169,7 +5170,7 @@ hpux*)
if test -z "$GNU_CC"; then
echo $ac_n "checking for +Olit support""... $ac_c" 1>&6
-echo "configure:5173: checking for +Olit support" >&5
+echo "configure:5174: checking for +Olit support" >&5
if eval "test \"`echo '$''{'ac_cv_hpux_usable_olit_option'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5203,7 +5204,7 @@ esac
echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6
-echo "configure:5207: checking for pthread_create in -lpthreads" >&5
+echo "configure:5208: checking for pthread_create in -lpthreads" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@@ -5225,7 +5226,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:5229: checking for pthread_create in -lpthread" >&5
+echo "configure:5230: checking for pthread_create in -lpthread" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@@ -5247,7 +5248,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6
-echo "configure:5251: checking for pthread_create in -lc_r" >&5
+echo "configure:5252: checking for pthread_create in -lc_r" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@@ -5269,7 +5270,7 @@ echo "
echo "$ac_t""no" 1>&6
echo $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6
-echo "configure:5273: checking for pthread_create in -lc" >&5
+echo "configure:5274: checking for pthread_create in -lc" >&5
echo "
#include <pthread.h>
void *foo(void *v) { return v; }
@@ -5421,7 +5422,7 @@ if test -n "$USE_PTHREADS"; then
rm -f conftest*
ac_cv_have_dash_pthread=no
echo $ac_n "checking whether ${CC-cc} accepts -pthread""... $ac_c" 1>&6
-echo "configure:5425: checking whether ${CC-cc} accepts -pthread" >&5
+echo "configure:5426: checking whether ${CC-cc} accepts -pthread" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthread -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
@@ -5444,7 +5445,7 @@ echo "configure:5425: checking whether ${CC-cc} accepts -pthread" >&5
ac_cv_have_dash_pthreads=no
if test "$ac_cv_have_dash_pthread" = "no"; then
echo $ac_n "checking whether ${CC-cc} accepts -pthreads""... $ac_c" 1>&6
-echo "configure:5448: checking whether ${CC-cc} accepts -pthreads" >&5
+echo "configure:5449: checking whether ${CC-cc} accepts -pthreads" >&5
echo 'int main() { return 0; }' | cat > conftest.c
${CC-cc} -pthreads -o conftest conftest.c > conftest.out 2>&1
if test $? -eq 0; then
diff --git a/configure.in b/configure.in
index 0172f4a9..04862258 100644
--- a/configure.in
+++ b/configure.in
@@ -489,64 +489,63 @@ else
AC_MSG_RESULT([no])
fi
-dnl Check for .hidden assembler directive and visibility attribute.
-dnl Borrowed from glibc configure.in
dnl ===============================================================
dnl Check for .hidden assembler directive and visibility attribute.
dnl Borrowed from glibc configure.in
dnl ===============================================================
if test "$GNU_CC"; then
- AC_CACHE_CHECK(for visibility(hidden) attribute,
- ac_cv_visibility_hidden,
- [cat > conftest.c <<EOF
- int foo __attribute__ ((visibility ("hidden"))) = 1;
+ AC_CACHE_CHECK(for visibility(hidden) attribute,
+ ac_cv_visibility_hidden,
+ [cat > conftest.c <<EOF
+ int foo __attribute__ ((visibility ("hidden"))) = 1;
EOF
- ac_cv_visibility_attribute=no
- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
- if grep '\.hidden.*foo' conftest.s >/dev/null; then
- ac_cv_visibility_hidden=yes
- fi
- fi
- rm -f conftest.[cs]
- ])
- if test "$ac_cv_visibility_hidden" = "yes"; then
- AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
- AC_CACHE_CHECK(for visibility pragma support,
- ac_cv_visibility_pragma,
- [cat > conftest.c <<EOF
+ ac_cv_visibility_hidden=no
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '\.hidden.*foo' conftest.s >/dev/null; then
+ ac_cv_visibility_hidden=yes
+ fi
+ fi
+ rm -f conftest.[cs]
+ ])
+ if test "$ac_cv_visibility_hidden" = "yes"; then
+ AC_DEFINE(HAVE_VISIBILITY_HIDDEN_ATTRIBUTE)
+ AC_CACHE_CHECK(for visibility pragma support,
+ ac_cv_visibility_pragma,
+ [cat > conftest.c <<EOF
#pragma GCC visibility push(hidden)
- int foo_hidden = 1;
+ int foo_hidden = 1;
#pragma GCC visibility push(default)
- int foo_default = 1;
+ int foo_default = 1;
EOF
- ac_cv_visibility_pragma=no
- if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
- if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
- if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
- ac_cv_visibility_pragma=yes
- fi
- fi
- fi
- rm -f conftest.[cs]
- ])
- if test "$ac_cv_visibility_pragma" = "yes"; then
- AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
- # To work around a build problem on Linux x86-64 (Bugzilla bug
- # 293438), we use the -fvisibility=hidden flag. This flag is less
- # optimal than #pragma GCC visibility push(hidden) because the flag
- # assumes that symbols defined outside the current source file have
- # the default visibility. This has the advantage that we don't need
- # to wrap system header files, but has the disadvantage that calls
- # to hidden symbols defined in other source files cannot be
- # optimized by the compiler. The -fvisibility=hidden flag does
- # hide and export symbols correctly.
- #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
- #WRAP_SYSTEM_INCLUDES=1
- VISIBILITY_FLAGS="-fvisibility=hidden"
- WRAP_SYSTEM_INCLUDES=
- fi
- fi
-fi # GNU_CC
+ ac_cv_visibility_pragma=no
+ if ${CC-cc} -Werror -S conftest.c -o conftest.s >/dev/null 2>&1; then
+ if grep '\.hidden.*foo_hidden' conftest.s >/dev/null; then
+ if ! grep '\.hidden.*foo_default' conftest.s > /dev/null; then
+ ac_cv_visibility_pragma=yes
+ fi
+ fi
+ fi
+ rm -f conftest.[cs]
+ ])
+ if test "$ac_cv_visibility_pragma" = "yes"; then
+ AC_DEFINE(HAVE_VISIBILITY_PRAGMA)
+ # To work around a build problem on Linux x86-64 (Bugzilla bug
+ # 293438), we use the -fvisibility=hidden flag. This flag is less
+ # optimal than #pragma GCC visibility push(hidden) because the flag
+ # assumes that symbols defined outside the current source file have
+ # the default visibility. This has the advantage that we don't need
+ # to wrap system header files, but has the disadvantage that calls
+ # to hidden symbols defined in other source files cannot be
+ # optimized by the compiler. The -fvisibility=hidden flag does
+ # hide and export symbols correctly.
+ #VISIBILITY_FLAGS='-I$(dist_includedir)/system_wrappers -include $(topsrcdir)/config/gcc_hidden.h'
+ #WRAP_SYSTEM_INCLUDES=1
+ VISIBILITY_FLAGS="-fvisibility=hidden"
+ WRAP_SYSTEM_INCLUDES=
+ fi
+ fi
+fi # GNU_CC
+
fi # SKIP_COMPILER_CHECKS
dnl ========================================================
@@ -1406,6 +1405,11 @@ case "$target" in
DLLFLAGS="$DLLFLAGS -DEBUG"
LDFLAGS="$LDFLAGS -DEBUG"
fi
+
+ OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
+ if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
+ OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
+ fi
if test "$OS_TARGET" = "WINNT"; then
CFLAGS="$CFLAGS -GT"
@@ -1443,11 +1447,6 @@ case "$target" in
OBJDIR_SUFFIX=OBJD
fi
- OS_DLLFLAGS="-nologo -DLL -SUBSYSTEM:WINDOWS"
- if test "$MSC_VER" -le "1200" -a -z "$MOZ_DEBUG_SYMBOLS"; then
- OS_DLLFLAGS="$OS_DLLFLAGS -PDB:NONE"
- fi
-
case "$OS_TARGET" in
WINNT)
MDCPUCFG_H=_winnt.cfg
diff --git a/pr/include/md/_unix_errors.h b/pr/include/md/_unix_errors.h
index 28cfc35f..a44cbb31 100644
--- a/pr/include/md/_unix_errors.h
+++ b/pr/include/md/_unix_errors.h
@@ -43,127 +43,127 @@
PR_BEGIN_EXTERN_C
-NSPR_API(void) _MD_unix_map_default_error(int err);
+extern void _MD_unix_map_default_error(int err);
#define _PR_MD_MAP_DEFAULT_ERROR _MD_unix_map_default_error
-NSPR_API(void) _MD_unix_map_opendir_error(int err);
+extern void _MD_unix_map_opendir_error(int err);
#define _PR_MD_MAP_OPENDIR_ERROR _MD_unix_map_opendir_error
-NSPR_API(void) _MD_unix_map_closedir_error(int err);
+extern void _MD_unix_map_closedir_error(int err);
#define _PR_MD_MAP_CLOSEDIR_ERROR _MD_unix_map_closedir_error
-NSPR_API(void) _MD_unix_readdir_error(int err);
+extern void _MD_unix_readdir_error(int err);
#define _PR_MD_MAP_READDIR_ERROR _MD_unix_readdir_error
-NSPR_API(void) _MD_unix_map_unlink_error(int err);
+extern void _MD_unix_map_unlink_error(int err);
#define _PR_MD_MAP_UNLINK_ERROR _MD_unix_map_unlink_error
-NSPR_API(void) _MD_unix_map_stat_error(int err);
+extern void _MD_unix_map_stat_error(int err);
#define _PR_MD_MAP_STAT_ERROR _MD_unix_map_stat_error
-NSPR_API(void) _MD_unix_map_fstat_error(int err);
+extern void _MD_unix_map_fstat_error(int err);
#define _PR_MD_MAP_FSTAT_ERROR _MD_unix_map_fstat_error
-NSPR_API(void) _MD_unix_map_rename_error(int err);
+extern void _MD_unix_map_rename_error(int err);
#define _PR_MD_MAP_RENAME_ERROR _MD_unix_map_rename_error
-NSPR_API(void) _MD_unix_map_access_error(int err);
+extern void _MD_unix_map_access_error(int err);
#define _PR_MD_MAP_ACCESS_ERROR _MD_unix_map_access_error
-NSPR_API(void) _MD_unix_map_mkdir_error(int err);
+extern void _MD_unix_map_mkdir_error(int err);
#define _PR_MD_MAP_MKDIR_ERROR _MD_unix_map_mkdir_error
-NSPR_API(void) _MD_unix_map_rmdir_error(int err);
+extern void _MD_unix_map_rmdir_error(int err);
#define _PR_MD_MAP_RMDIR_ERROR _MD_unix_map_rmdir_error
-NSPR_API(void) _MD_unix_map_read_error(int err);
+extern void _MD_unix_map_read_error(int err);
#define _PR_MD_MAP_READ_ERROR _MD_unix_map_read_error
-NSPR_API(void) _MD_unix_map_write_error(int err);
+extern void _MD_unix_map_write_error(int err);
#define _PR_MD_MAP_WRITE_ERROR _MD_unix_map_write_error
-NSPR_API(void) _MD_unix_map_lseek_error(int err);
+extern void _MD_unix_map_lseek_error(int err);
#define _PR_MD_MAP_LSEEK_ERROR _MD_unix_map_lseek_error
-NSPR_API(void) _MD_unix_map_fsync_error(int err);
+extern void _MD_unix_map_fsync_error(int err);
#define _PR_MD_MAP_FSYNC_ERROR _MD_unix_map_fsync_error
-NSPR_API(void) _MD_unix_map_close_error(int err);
+extern void _MD_unix_map_close_error(int err);
#define _PR_MD_MAP_CLOSE_ERROR _MD_unix_map_close_error
-NSPR_API(void) _MD_unix_map_socket_error(int err);
+extern void _MD_unix_map_socket_error(int err);
#define _PR_MD_MAP_SOCKET_ERROR _MD_unix_map_socket_error
-NSPR_API(void) _MD_unix_map_socketavailable_error(int err);
+extern void _MD_unix_map_socketavailable_error(int err);
#define _PR_MD_MAP_SOCKETAVAILABLE_ERROR _MD_unix_map_socketavailable_error
-NSPR_API(void) _MD_unix_map_recv_error(int err);
+extern void _MD_unix_map_recv_error(int err);
#define _PR_MD_MAP_RECV_ERROR _MD_unix_map_recv_error
-NSPR_API(void) _MD_unix_map_recvfrom_error(int err);
+extern void _MD_unix_map_recvfrom_error(int err);
#define _PR_MD_MAP_RECVFROM_ERROR _MD_unix_map_recvfrom_error
-NSPR_API(void) _MD_unix_map_send_error(int err);
+extern void _MD_unix_map_send_error(int err);
#define _PR_MD_MAP_SEND_ERROR _MD_unix_map_send_error
-NSPR_API(void) _MD_unix_map_sendto_error(int err);
+extern void _MD_unix_map_sendto_error(int err);
#define _PR_MD_MAP_SENDTO_ERROR _MD_unix_map_sendto_error
-NSPR_API(void) _MD_unix_map_writev_error(int err);
+extern void _MD_unix_map_writev_error(int err);
#define _PR_MD_MAP_WRITEV_ERROR _MD_unix_map_writev_error
-NSPR_API(void) _MD_unix_map_accept_error(int err);
+extern void _MD_unix_map_accept_error(int err);
#define _PR_MD_MAP_ACCEPT_ERROR _MD_unix_map_accept_error
-NSPR_API(void) _MD_unix_map_connect_error(int err);
+extern void _MD_unix_map_connect_error(int err);
#define _PR_MD_MAP_CONNECT_ERROR _MD_unix_map_connect_error
-NSPR_API(void) _MD_unix_map_bind_error(int err);
+extern void _MD_unix_map_bind_error(int err);
#define _PR_MD_MAP_BIND_ERROR _MD_unix_map_bind_error
-NSPR_API(void) _MD_unix_map_listen_error(int err);
+extern void _MD_unix_map_listen_error(int err);
#define _PR_MD_MAP_LISTEN_ERROR _MD_unix_map_listen_error
-NSPR_API(void) _MD_unix_map_shutdown_error(int err);
+extern void _MD_unix_map_shutdown_error(int err);
#define _PR_MD_MAP_SHUTDOWN_ERROR _MD_unix_map_shutdown_error
-NSPR_API(void) _MD_unix_map_socketpair_error(int err);
+extern void _MD_unix_map_socketpair_error(int err);
#define _PR_MD_MAP_SOCKETPAIR_ERROR _MD_unix_map_socketpair_error
-NSPR_API(void) _MD_unix_map_getsockname_error(int err);
+extern void _MD_unix_map_getsockname_error(int err);
#define _PR_MD_MAP_GETSOCKNAME_ERROR _MD_unix_map_getsockname_error
-NSPR_API(void) _MD_unix_map_getpeername_error(int err);
+extern void _MD_unix_map_getpeername_error(int err);
#define _PR_MD_MAP_GETPEERNAME_ERROR _MD_unix_map_getpeername_error
-NSPR_API(void) _MD_unix_map_getsockopt_error(int err);
+extern void _MD_unix_map_getsockopt_error(int err);
#define _PR_MD_MAP_GETSOCKOPT_ERROR _MD_unix_map_getsockopt_error
-NSPR_API(void) _MD_unix_map_setsockopt_error(int err);
+extern void _MD_unix_map_setsockopt_error(int err);
#define _PR_MD_MAP_SETSOCKOPT_ERROR _MD_unix_map_setsockopt_error
-NSPR_API(void) _MD_unix_map_open_error(int err);
+extern void _MD_unix_map_open_error(int err);
#define _PR_MD_MAP_OPEN_ERROR _MD_unix_map_open_error
-NSPR_API(void) _MD_unix_map_mmap_error(int err);
+extern void _MD_unix_map_mmap_error(int err);
#define _PR_MD_MAP_MMAP_ERROR _MD_unix_map_mmap_error
-NSPR_API(void) _MD_unix_map_gethostname_error(int err);
+extern void _MD_unix_map_gethostname_error(int err);
#define _PR_MD_MAP_GETHOSTNAME_ERROR _MD_unix_map_gethostname_error
-NSPR_API(void) _MD_unix_map_select_error(int err);
+extern void _MD_unix_map_select_error(int err);
#define _PR_MD_MAP_SELECT_ERROR _MD_unix_map_select_error
-NSPR_API(void) _MD_unix_map_poll_error(int err);
+extern void _MD_unix_map_poll_error(int err);
#define _PR_MD_MAP_POLL_ERROR _MD_unix_map_poll_error
-NSPR_API(void) _MD_unix_map_poll_revents_error(int err);
+extern void _MD_unix_map_poll_revents_error(int err);
#define _PR_MD_MAP_POLL_REVENTS_ERROR _MD_unix_map_poll_revents_error
-NSPR_API(void) _MD_unix_map_flock_error(int err);
+extern void _MD_unix_map_flock_error(int err);
#define _PR_MD_MAP_FLOCK_ERROR _MD_unix_map_flock_error
-NSPR_API(void) _MD_unix_map_lockf_error(int err);
+extern void _MD_unix_map_lockf_error(int err);
#define _PR_MD_MAP_LOCKF_ERROR _MD_unix_map_lockf_error
PR_END_EXTERN_C
diff --git a/pr/include/prinit.h b/pr/include/prinit.h
index cfe5db29..70b4567d 100644
--- a/pr/include/prinit.h
+++ b/pr/include/prinit.h
@@ -63,11 +63,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
-#define PR_VERSION "4.6 Beta"
+#define PR_VERSION "4.6"
#define PR_VMAJOR 4
#define PR_VMINOR 6
#define PR_VPATCH 0
-#define PR_BETA PR_TRUE
+#define PR_BETA PR_FALSE
/*
** PRVersionCheck
diff --git a/pr/src/md/unix/uxwrap.c b/pr/src/md/unix/uxwrap.c
index 8f69de86..ef226a6b 100644
--- a/pr/src/md/unix/uxwrap.c
+++ b/pr/src/md/unix/uxwrap.c
@@ -345,7 +345,7 @@ int poll(struct pollfd filedes[], int nfds, int timeout)
#elif defined(NETBSD)
int poll(struct pollfd *filedes, nfds_t nfds, int timeout)
#elif defined(OPENBSD)
-int poll(struct pollfd *filedes, int nfds, int timeout)
+int poll(struct pollfd filedes[], nfds_t nfds, int timeout)
#elif defined(FREEBSD)
int poll(struct pollfd *filedes, unsigned nfds, int timeout)
#else
diff --git a/pr/src/pthreads/ptthread.c b/pr/src/pthreads/ptthread.c
index 35dd13eb..4cd70dcc 100644
--- a/pr/src/pthreads/ptthread.c
+++ b/pr/src/pthreads/ptthread.c
@@ -209,7 +209,10 @@ static void *_pt_root(void *arg)
thred->suspend = 0;
thred->prev = pt_book.last;
- pt_book.last->next = thred;
+ if (pt_book.last)
+ pt_book.last->next = thred;
+ else
+ pt_book.first = thred;
thred->next = NULL;
pt_book.last = thred;
PR_Unlock(pt_book.ml);
@@ -233,7 +236,10 @@ static void *_pt_root(void *arg)
pt_book.system -= 1;
else if (--pt_book.user == pt_book.this_many)
PR_NotifyAllCondVar(pt_book.cv);
- thred->prev->next = thred->next;
+ if (NULL == thred->prev)
+ pt_book.first = thred->next;
+ else
+ thred->prev->next = thred->next;
if (NULL == thred->next)
pt_book.last = thred->prev;
else
@@ -288,7 +294,10 @@ static PRThread* pt_AttachThread(void)
/* then put it into the list */
thred->prev = pt_book.last;
- pt_book.last->next = thred;
+ if (pt_book.last)
+ pt_book.last->next = thred;
+ else
+ pt_book.first = thred;
thred->next = NULL;
pt_book.last = thred;
PR_Unlock(pt_book.ml);
@@ -790,10 +799,13 @@ static void _pt_thread_death(void *arg)
{
PRThread *thred = (PRThread*)arg;
- if (thred->state & PT_THREAD_FOREIGN)
+ if (thred->state & (PT_THREAD_FOREIGN|PT_THREAD_PRIMORD))
{
PR_Lock(pt_book.ml);
- thred->prev->next = thred->next;
+ if (NULL == thred->prev)
+ pt_book.first = thred->next;
+ else
+ thred->prev->next = thred->next;
if (NULL == thred->next)
pt_book.last = thred->prev;
else
@@ -915,6 +927,7 @@ void _PR_InitThreads(
PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
{
PRThread *me = PR_CurrentThread();
+ int rv;
PR_LOG(_pr_thread_lm, PR_LOG_MIN, ("PR_Cleanup: shutting down NSPR"));
PR_ASSERT(me->state & PT_THREAD_PRIMORD);
if (me->state & PT_THREAD_PRIMORD)
@@ -933,6 +946,9 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
/* Close all the fd's before calling _PR_CleanupIO */
_PR_CleanupIO();
+ _pt_thread_death(me);
+ rv = pthread_setspecific(pt_book.key, NULL);
+ PR_ASSERT(0 == rv);
/*
* I am not sure if it's safe to delete the cv and lock here,
* since there may still be "system" threads around. If this
@@ -944,7 +960,6 @@ PR_IMPLEMENT(PRStatus) PR_Cleanup(void)
PR_DestroyCondVar(pt_book.cv); pt_book.cv = NULL;
PR_DestroyLock(pt_book.ml); pt_book.ml = NULL;
}
- _pt_thread_death(me);
PR_DestroyLock(_pr_sleeplock);
_pr_sleeplock = NULL;
_PR_CleanupLayerCache();
diff --git a/pr/tests/bigfile3.c b/pr/tests/bigfile3.c
index 6fa25ca6..3cb806ff 100644
--- a/pr/tests/bigfile3.c
+++ b/pr/tests/bigfile3.c
@@ -39,6 +39,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#ifdef _WIN32
#include <windows.h>
#endif
diff --git a/pr/tests/env.c b/pr/tests/env.c
index 7f82fe08..ff2ba937 100644
--- a/pr/tests/env.c
+++ b/pr/tests/env.c
@@ -45,6 +45,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
PRIntn debug = 0;
PRIntn verbose = 0;
diff --git a/pr/tests/initclk.c b/pr/tests/initclk.c
index ba306d20..6540519e 100644
--- a/pr/tests/initclk.c
+++ b/pr/tests/initclk.c
@@ -49,6 +49,7 @@
#include "prinrval.h"
#include "prlog.h"
#include <stdio.h>
+#include <stdlib.h>
/* The timeouts, in milliseconds */
#define SHORT_TIMEOUT 1000
diff --git a/pr/tests/layer.c b/pr/tests/layer.c
index 7eae46a2..cb914ba0 100644
--- a/pr/tests/layer.c
+++ b/pr/tests/layer.c
@@ -46,6 +46,7 @@
#include "prwin16.h"
#include <stdlib.h>
+#include <string.h>
/*
** Testing layering of I/O
diff --git a/pr/tests/nbconn.c b/pr/tests/nbconn.c
index d2fe6093..099150a5 100644
--- a/pr/tests/nbconn.c
+++ b/pr/tests/nbconn.c
@@ -59,6 +59,7 @@
#include "nspr.h"
#include "plgetopt.h"
#include <stdio.h>
+#include <string.h>
#ifdef XP_MAC
#define printf PR_LogPrint
diff --git a/pr/tests/ntioto.c b/pr/tests/ntioto.c
index 44e2a608..0dc0072a 100644
--- a/pr/tests/ntioto.c
+++ b/pr/tests/ntioto.c
@@ -136,10 +136,11 @@ static void AcceptThread(void *arg)
ACCEPT_READ_DATASIZE,
PR_SecondsToInterval(1));
- if ( bytesRead == -1 && PR_GetError() == PR_IO_TIMEOUT_ERROR )
+ if ( bytesRead == -1 && PR_GetError() == PR_IO_TIMEOUT_ERROR ) {
if ( debug ) printf("AcceptRead timed out\n");
- else
+ } else {
if ( debug ) printf("Oops! read: %d, error: %d\n", bytesRead, PR_GetError());
+ }
while( state != AllDone ) {
PR_Lock( ml );
diff --git a/pr/tests/op_filnf.c b/pr/tests/op_filnf.c
index aeb2014d..5f676250 100644
--- a/pr/tests/op_filnf.c
+++ b/pr/tests/op_filnf.c
@@ -77,7 +77,7 @@ int main(int argc, char **argv)
PR_STDIO_INIT();
t1 = PR_Open("/usr/tmp/ttools/err03.tmp", PR_TRUNCATE | PR_RDWR, 0666);
- if (t1 == NULL)
+ if (t1 == NULL) {
if (PR_GetError() == PR_FILE_NOT_FOUND_ERROR) {
printf ("error code is %d \n", PR_GetError());
printf ("PASS\n");
@@ -88,4 +88,9 @@ int main(int argc, char **argv)
printf ("FAIL\n");
return 1;
}
+ }
+ PR_Close(t1);
+ printf ("opened a file that should not exist\n");
+ printf ("FAIL\n");
+ return 1;
}
diff --git a/pr/tests/prpoll.c b/pr/tests/prpoll.c
index 5e4893f9..9058981b 100644
--- a/pr/tests/prpoll.c
+++ b/pr/tests/prpoll.c
@@ -43,6 +43,10 @@
#include <io.h> /* for close() */
#endif
+#ifdef XP_UNIX
+#include <unistd.h> /* for close() */
+#endif
+
#include "prinit.h"
#include "prio.h"
#include "prlog.h"
diff --git a/pr/tests/randseed.c b/pr/tests/randseed.c
index df80bb8f..fc1fbaeb 100644
--- a/pr/tests/randseed.c
+++ b/pr/tests/randseed.c
@@ -46,11 +46,12 @@
** ... more? ... histogram distribution of random numbers
*/
-#include <plgetopt.h>
-#include <nspr.h>
-#include <prrng.h>
+#include "plgetopt.h"
+#include "nspr.h"
+#include "prrng.h"
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
/*
** Test harness infrastructure
diff --git a/pr/tests/sel_spd.c b/pr/tests/sel_spd.c
index 6760e640..c3b79652 100644
--- a/pr/tests/sel_spd.c
+++ b/pr/tests/sel_spd.c
@@ -455,7 +455,7 @@ int main(int argc, char **argv)
{
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
int opt;
- extern char *optarg;
+ PR_IMPORT_DATA(char *) optarg;
#endif
#if defined(XP_UNIX) || defined(XP_OS2_EMX)
diff --git a/pr/tests/vercheck.c b/pr/tests/vercheck.c
index eed5006a..d1fdb96e 100644
--- a/pr/tests/vercheck.c
+++ b/pr/tests/vercheck.c
@@ -52,13 +52,14 @@
#include <stdlib.h>
/*
- * This release (4.5) is backward compatible with the
- * 4.0.x, 4.1.x, 4.2.x, 4.3.x, and 4.4.x releases. It, of course,
+ * This release (4.6) is backward compatible with the
+ * 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, and 4.5.x releases. It, of course,
* is compatible with itself.
*/
static char *compatible_version[] = {
"4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
- "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1", PR_VERSION
+ "4.2", "4.2.1", "4.2.2", "4.3", "4.4", "4.4.1",
+ "4.5", "4.5.1", PR_VERSION
};
/*
@@ -73,8 +74,8 @@ static char *incompatible_version[] = {
"3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1",
- "4.5.3",
- "4.6", "4.6.1",
+ "4.6.3",
+ "4.7", "4.7.1",
"10.0", "11.1", "12.14.20"
};