Bug 1660371 - Uplift initial NSPR 4.29 beta snapshot. r=glandium UPGRADE_NSPR_RELEASE

Differential Revision: https://phabricator.services.mozilla.com/D88589
This commit is contained in:
Kai Engert 2020-08-28 21:31:02 +00:00
parent 2f11033294
commit c6ee293115
21 changed files with 2289 additions and 2356 deletions

View File

@ -1 +1 @@
NSPR_4_28_RTM
7dea8f5aab8cb99b739f516d7b937f9da8ae8182

View File

@ -1,5 +1,3 @@
The config.guess and config.sub scripts were downloaded from
http://git.savannah.gnu.org/cgit/config.git/tree/config.guess?id=6947a35648e577c2e3a12d5c88d488c6ea94e1c0
http://git.savannah.gnu.org/cgit/config.git/tree/config.sub?id=6947a35648e577c2e3a12d5c88d488c6ea94e1c0
Our private patches are in the patches/ directory.
http://git.savannah.gnu.org/cgit/config.git/tree/config.guess?id=2593751ef276497e312d7c4ce7fd049614c7bf80
http://git.savannah.gnu.org/cgit/config.git/tree/config.sub?id=2593751ef276497e312d7c4ce7fd049614c7bf80

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +0,0 @@
--- config.sub.orig 2014-03-09 18:34:03 -0700
+++ config.sub 2014-03-14 19:49:48 -0700
@@ -115,7 +115,7 @@
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+ nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | \
kopensolaris*-gnu* | \
@@ -123,10 +123,6 @@
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
*)
basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ $basic_machine != $1 ]
@@ -1367,7 +1363,7 @@
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -mingw32* | -mingw64* | -linux-gnu* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
@@ -1508,6 +1504,9 @@
;;
-nacl*)
;;
+ -android*)
+ os=-android
+ ;;
-none)
;;
*)
@@ -1777,6 +1776,9 @@
-vos*)
vendor=stratus
;;
+ *-android*|*-linuxandroid*)
+ vendor=linux-
+ ;;
esac
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;

View File

@ -10,4 +10,3 @@
*/
#error "Do not include this header file."

121
nsprpub/configure vendored
View File

@ -1467,7 +1467,7 @@ Optional Features:
--enable-cplus Enable some c++ api routines
--enable-macos-target=VER
Set the minimum MacOS version needed at runtime
10.2 for ppc, 10.4 for x86
10.3 for ppc, 10.4 for x86
--disable-os2-high-mem Disable high-memory support on OS/2
--enable-strip Enable stripping of shared libs and programs
@ -2486,7 +2486,7 @@ test -n "$target_alias" &&
program_prefix=${target_alias}-
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=28
MOD_MINOR_VERSION=29
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@ -6458,12 +6458,22 @@ fi
CPU_ARCH=i386
fi
;;
aarch64)
CPU_ARCH=aarch64
;;
*)
CPU_ARCH=ppc
;;
esac
if test "`echo $CC | grep -c '\-arch '`" = "0"; then
CC="$CC -arch $CPU_ARCH"
case "$CPU_ARCH" in
aarch64)
CC="$CC -arch arm64"
;;
*)
CC="$CC -arch $CPU_ARCH"
;;
esac
fi
ac_fn_c_check_header_mongrel "$LINENO" "crt_externs.h" "ac_cv_header_crt_externs_h" "$ac_includes_default"
if test "x$ac_cv_header_crt_externs_h" = xyes; then :
@ -6483,78 +6493,71 @@ fi
PR_MD_CSRCS=darwin.c
PR_MD_ASFILES=os_Darwin.s
# Add Mac OS X support for loading CFM & CFBundle plugins
if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
$as_echo "#define XP_MACOSX 1" >>confdefs.h
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
case "${target_cpu}" in
powerpc*)
export MACOSX_DEPLOYMENT_TARGET=10.3
;;
i*86*)
export MACOSX_DEPLOYMENT_TARGET=10.4
;;
esac
fi
OS_TARGET=MacOSX
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
case "${target_cpu}" in
powerpc*)
export MACOSX_DEPLOYMENT_TARGET=10.2
;;
i*86*)
export MACOSX_DEPLOYMENT_TARGET=10.4
;;
esac
if test "$MACOS_SDK_DIR"; then
if test ! -d "$MACOS_SDK_DIR"; then
as_fn_error $? "SDK not found. When using --with-macos-sdk, you must
specify a valid SDK. SDKs are installed when the optional cross-development
tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
fi
if test "$MACOS_SDK_DIR"; then
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
if test ! -d "$MACOS_SDK_DIR"; then
as_fn_error $? "SDK not found. When using --with-macos-sdk, you must
specify a valid SDK. SDKs are installed when the optional cross-development
tools are selected during the Xcode/Developer Tools installation." "$LINENO" 5
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
fi
SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
fi
SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
else
MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
export NEXT_ROOT=$MACOS_SDK_DIR
if test -n "$CROSS_COMPILE" ; then
HOST_CC="NEXT_ROOT= $HOST_CC"
HOST_CXX="NEXT_ROOT= $HOST_CXX"
fi
if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
else
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
export NEXT_ROOT=$MACOS_SDK_DIR
if test "$GCC_VERSION_FULL" != "4.0.0" ; then
LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
else
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
if test -n "$CROSS_COMPILE" ; then
HOST_CC="NEXT_ROOT= $HOST_CC"
HOST_CXX="NEXT_ROOT= $HOST_CXX"
fi
else
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
if test "$GCC_VERSION_FULL" != "4.0.0" ; then
LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
else
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
fi
fi

View File

@ -15,7 +15,7 @@ dnl ========================================================
dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=28
MOD_MINOR_VERSION=29
MOD_PATCH_VERSION=0
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
@ -398,7 +398,7 @@ AC_ARG_WITH(macos-sdk,
AC_ARG_ENABLE(macos-target,
[ --enable-macos-target=VER
Set the minimum MacOS version needed at runtime
[10.2 for ppc, 10.4 for x86]],
[10.3 for ppc, 10.4 for x86]],
[_MACOSX_DEPLOYMENT_TARGET=$enableval])
dnl ========================================================
@ -1327,12 +1327,22 @@ case "$target" in
CPU_ARCH=i386
fi
;;
aarch64)
CPU_ARCH=aarch64
;;
*)
CPU_ARCH=ppc
;;
esac
if test "`echo $CC | grep -c '\-arch '`" = "0"; then
CC="$CC -arch $CPU_ARCH"
case "$CPU_ARCH" in
aarch64)
CC="$CC -arch arm64"
;;
*)
CC="$CC -arch $CPU_ARCH"
;;
esac
fi
AC_CHECK_HEADER(crt_externs.h, AC_DEFINE(HAVE_CRT_EXTERNS_H))
DSO_CFLAGS=-fPIC
@ -1346,116 +1356,110 @@ case "$target" in
PR_MD_CSRCS=darwin.c
PR_MD_ASFILES=os_Darwin.s
# Add Mac OS X support for loading CFM & CFBundle plugins
if test -f "${MACOS_SDK_DIR}/System/Library/Frameworks/Carbon.framework/Carbon"; then
AC_DEFINE(XP_MACOSX)
OS_TARGET=MacOSX
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
dnl Use the specified value
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
dnl No value specified on the command line or in the environment,
dnl use the lesser of the library's minimum or the architecture's
dnl minimum.
case "${target_cpu}" in
powerpc*)
dnl Architecture minimum 10.3
export MACOSX_DEPLOYMENT_TARGET=10.3
;;
i*86*)
dnl Architecture minimum 10.4
export MACOSX_DEPLOYMENT_TARGET=10.4
;;
esac
fi
if test -n "$_MACOSX_DEPLOYMENT_TARGET" ; then
dnl Use the specified value
export MACOSX_DEPLOYMENT_TARGET=$_MACOSX_DEPLOYMENT_TARGET
elif test -z "$MACOSX_DEPLOYMENT_TARGET" ; then
dnl No value specified on the command line or in the environment,
dnl use the lesser of the library's minimum or the architecture's
dnl minimum.
case "${target_cpu}" in
powerpc*)
dnl Architecture minimum 10.2
export MACOSX_DEPLOYMENT_TARGET=10.2
;;
i*86*)
dnl Architecture minimum 10.4
export MACOSX_DEPLOYMENT_TARGET=10.4
;;
esac
fi
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
dnl in use. NEXT_ROOT will be set and exported if it's needed for
dnl ld.
dnl MACOS_SDK_DIR will be set to the SDK location whenever one is
dnl in use. NEXT_ROOT will be set and exported if it's needed for
dnl ld.
if test "$MACOS_SDK_DIR"; then
dnl Sync this section with the one in Mozilla's top level.
if test "$MACOS_SDK_DIR"; then
dnl Sync this section with the one in Mozilla's top level.
if test ! -d "$MACOS_SDK_DIR"; then
AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
if test ! -d "$MACOS_SDK_DIR"; then
AC_MSG_ERROR([SDK not found. When using --with-macos-sdk, you must
specify a valid SDK. SDKs are installed when the optional cross-development
tools are selected during the Xcode/Developer Tools installation.])
fi
changequote(,)
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
changequote([,])
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
fi
SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
dnl CPP needs to be set for AC_CHECK_HEADER.
CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
changequote(,)
CC_VERSION=`$CC -v 2>&1 | grep 'gcc version'`
GCC_VERSION_FULL=`echo $CC_VERSION | $PERL -pe 's/^.*gcc version ([^ ]*).*/$1/'`
GCC_VERSION=`echo $GCC_VERSION_FULL | $PERL -pe '(split(/\./))[0]>=4&&s/(^\d*\.\d*).*/$1/;'`
HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
changequote([,])
GCC_VERSION_MAJOR=`echo $GCC_VERSION_FULL | $PERL -pe 's/(^\d*).*/$1/;'`
if test "$GCC_VERSION_MAJOR" -lt "4" ; then
SDK_C_FRAMEWORK="-F${MACOS_SDK_DIR}/System/Library/Frameworks"
if test -d "${MACOS_SDK_DIR}/Library/Frameworks" ; then
SDK_C_FRAMEWORK="$SDK_C_FRAMEWORK -F${MACOS_SDK_DIR}/Library/Frameworks"
fi
SDK_C_INCLUDE="-isystem ${MACOS_SDK_DIR}/usr/include/gcc/darwin/${GCC_VERSION} -isystem ${MACOS_SDK_DIR}/usr/include ${SDK_C_FRAMEWORK}"
CFLAGS="$CFLAGS -nostdinc ${SDK_C_INCLUDE}"
dnl CPP needs to be set for AC_CHECK_HEADER.
CPP="$CPP -nostdinc ${SDK_C_INCLUDE}"
changequote(,)
HOST_DARWIN_MAJOR=`echo "$build_os" | sed -E -e 's/^darwin([0-9]+).*$/\1/'`
changequote([,])
if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
dnl The build host is running Tiger (10.4) or earlier.
dnl ld support for -syslibroot is compiler-agnostic, but
dnl only available on Tiger and later. On Tiger and
dnl earlier build hosts, just rely on NEXT_ROOT, because
dnl it's not been shown to cause any problems.
MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
else
dnl The build host is running Leopard (10.5) or later.
dnl With NEXT_ROOT set, the linker will still not apply
dnl it when resolving dependencies. This causes problems
dnl on Leopard, where an SDK depends on frameworks which
dnl were present in earlier OS releases (and the associated
dnl SDK) but not in Leopard. -syslibroot does not have
dnl this problem, but it results in harmless warnings when
dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
dnl on Leopard because the compiler uses it too.
MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
export NEXT_ROOT=$MACOS_SDK_DIR
if test -n "$CROSS_COMPILE" ; then
dnl NEXT_ROOT will be in the environment, but it
dnl shouldn't be set for the build host. HOST_CXX is
dnl presently unused.
HOST_CC="NEXT_ROOT= $HOST_CC"
HOST_CXX="NEXT_ROOT= $HOST_CXX"
fi
if test "$HOST_DARWIN_MAJOR" -lt 9 ; then
dnl The build host is running Tiger (10.4) or earlier.
dnl ld support for -syslibroot is compiler-agnostic, but
dnl only available on Tiger and later. On Tiger and
dnl earlier build hosts, just rely on NEXT_ROOT, because
dnl it's not been shown to cause any problems.
MACOS_SDK_LIBS="-L${MACOS_SDK_DIR}/usr/lib/gcc/darwin -L${MACOS_SDK_DIR}/usr/lib/gcc/darwin/${GCC_VERSION_FULL} -L${MACOS_SDK_DIR}/usr/lib ${SDK_C_FRAMEWORK}"
else
dnl gcc >= 4.0 uses different paths than above, but knows
dnl how to find them itself.
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
dnl The build host is running Leopard (10.5) or later.
dnl With NEXT_ROOT set, the linker will still not apply
dnl it when resolving dependencies. This causes problems
dnl on Leopard, where an SDK depends on frameworks which
dnl were present in earlier OS releases (and the associated
dnl SDK) but not in Leopard. -syslibroot does not have
dnl this problem, but it results in harmless warnings when
dnl NEXT_ROOT is set. NEXT_ROOT needs to remain set even
dnl on Leopard because the compiler uses it too.
MACOS_SDK_LIBS="-Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
dnl CPP needs to be set for AC_CHECK_HEADER.
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
LDFLAGS="${MACOS_SDK_LIBS} $LDFLAGS"
export NEXT_ROOT=$MACOS_SDK_DIR
dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
dnl has an ld that supports -syslibroot. Don't set
dnl NEXT_ROOT because it will be ignored and cause
dnl warnings when -syslibroot is specified.
if test "$GCC_VERSION_FULL" != "4.0.0" ; then
dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
dnl based on the -isysroot it receives.
LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
else
dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
dnl to be explicit.
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
if test -n "$CROSS_COMPILE" ; then
dnl NEXT_ROOT will be in the environment, but it
dnl shouldn't be set for the build host. HOST_CXX is
dnl presently unused.
HOST_CC="NEXT_ROOT= $HOST_CC"
HOST_CXX="NEXT_ROOT= $HOST_CXX"
fi
else
dnl gcc >= 4.0 uses different paths than above, but knows
dnl how to find them itself.
CFLAGS="$CFLAGS -isysroot ${MACOS_SDK_DIR}"
dnl CPP needs to be set for AC_CHECK_HEADER.
CPP="$CPP -isysroot ${MACOS_SDK_DIR}"
dnl If gcc >= 4.0.0, we're guaranteed to be on Tiger, which
dnl has an ld that supports -syslibroot. Don't set
dnl NEXT_ROOT because it will be ignored and cause
dnl warnings when -syslibroot is specified.
if test "$GCC_VERSION_FULL" != "4.0.0" ; then
dnl gcc > 4.0.0 will pass -syslibroot to ld automatically
dnl based on the -isysroot it receives.
LDFLAGS="$LDFLAGS -isysroot ${MACOS_SDK_DIR}"
else
dnl gcc 4.0.0 doesn't pass -syslibroot to ld, it needs
dnl to be explicit.
LDFLAGS="$LDFLAGS -Wl,-syslibroot,${MACOS_SDK_DIR}"
fi
fi
fi

View File

@ -40,11 +40,7 @@
#undef HAVE_STACK_GROWING_UP
#define HAVE_DLL
#if defined(__x86_64__) || TARGET_OS_IPHONE
#define USE_DLFCN
#else
#define USE_MACH_DYLD
#endif
#define _PR_HAVE_SOCKADDR_LEN
#define _PR_STAT_HAS_ST_ATIMESPEC
#define _PR_HAVE_LARGE_OFF_T
@ -124,7 +120,16 @@ extern PRInt32 _PR_Darwin_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
#define _MD_ATOMIC_ADD(ptr, val) _PR_Darwin_x86_64_AtomicAdd(ptr, val)
#endif /* __x86_64__ */
#if defined(__arm__) || defined(__aarch64__)
#ifdef __aarch64__
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1)
#define _MD_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1)
#define _MD_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval)
#define _MD_ATOMIC_ADD(ptr, val) __sync_add_and_fetch(ptr, val)
#endif /* __aarch64__ */
#if defined(__arm__)
#define _PR_HAVE_ATOMIC_OPS
#define _MD_INIT_ATOMIC()
#define _MD_ATOMIC_INCREMENT(val) OSAtomicIncrement32(val)
@ -138,7 +143,7 @@ static inline PRInt32 _MD_ATOMIC_SET(PRInt32 *val, PRInt32 newval)
return oldval;
}
#define _MD_ATOMIC_ADD(ptr, val) OSAtomicAdd32(val, ptr)
#endif /* __arm__ || __aarch64__ */
#endif /* __arm__ */
#define USE_SETJMP

View File

@ -31,11 +31,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
#define PR_VERSION "4.28"
#define PR_VERSION "4.29 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 28
#define PR_VMINOR 29
#define PR_VPATCH 0
#define PR_BETA PR_FALSE
#define PR_BETA PR_TRUE
/*
** PRVersionCheck

View File

@ -159,10 +159,6 @@ ifeq ($(OS_TARGET),Android)
OS_LIBS += -llog
endif
ifeq ($(OS_TARGET),MacOSX)
OS_LIBS = -framework CoreServices -framework CoreFoundation
endif
EXTRA_LIBS += $(OS_LIBS)
#

View File

@ -7,11 +7,6 @@
#include <string.h>
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>
#endif
#ifdef XP_UNIX
#ifdef USE_DLFCN
#include <dlfcn.h>
@ -36,8 +31,6 @@
#endif
#elif defined(USE_HPSHL)
#include <dl.h>
#elif defined(USE_MACH_DYLD)
#include <mach-o/dyld.h>
#endif
#endif /* XP_UNIX */
@ -46,8 +39,7 @@
/*
* On these platforms, symbols have a leading '_'.
*/
#if (defined(DARWIN) && defined(USE_MACH_DYLD)) \
|| defined(XP_OS2) \
#if defined(XP_OS2) \
|| ((defined(OPENBSD) || defined(NETBSD)) && !defined(__ELF__))
#define NEED_LEADING_UNDERSCORE
#endif
@ -70,19 +62,9 @@ struct PRLibrary {
#endif
#endif
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
CFragConnectionID connection;
CFBundleRef bundle;
Ptr main;
CFMutableDictionaryRef wrappers;
const struct mach_header* image;
#endif
#ifdef XP_UNIX
#if defined(USE_HPSHL)
shl_t dlh;
#elif defined(USE_MACH_DYLD)
NSModule dlh;
#else
void* dlh;
#endif
@ -170,7 +152,7 @@ void _PR_InitLinker(void)
#elif defined(USE_HPSHL)
h = NULL;
/* don't abort with this NULL */
#elif defined(USE_MACH_DYLD) || defined(NO_DLOPEN_NULL)
#elif defined(NO_DLOPEN_NULL)
h = NULL; /* XXXX toshok */ /* XXXX vlad */
#else
#error no dll strategy
@ -270,7 +252,7 @@ PR_GetLibraryPath(void)
#endif
#if defined(XP_UNIX)
#if defined(USE_DLFCN) || defined(USE_MACH_DYLD)
#if defined(USE_DLFCN)
{
char *p=NULL;
int len;
@ -428,203 +410,6 @@ PR_LoadLibrary(const char *name)
return PR_LoadLibraryWithFlags(libSpec, 0);
}
#if defined(USE_MACH_DYLD)
static NSModule
pr_LoadMachDyldModule(const char *name)
{
NSObjectFileImage ofi;
NSModule h = NULL;
if (NSCreateObjectFileImageFromFile(name, &ofi)
== NSObjectFileImageSuccess) {
h = NSLinkModule(ofi, name, NSLINKMODULE_OPTION_PRIVATE
| NSLINKMODULE_OPTION_RETURN_ON_ERROR);
if (h == NULL) {
NSLinkEditErrors linkEditError;
int errorNum;
const char *fileName;
const char *errorString;
NSLinkEditError(&linkEditError, &errorNum, &fileName, &errorString);
PR_LOG(_pr_linker_lm, PR_LOG_MIN,
("LoadMachDyldModule error %d:%d for file %s:\n%s",
linkEditError, errorNum, fileName, errorString));
}
if (NSDestroyObjectFileImage(ofi) == FALSE) {
if (h) {
(void)NSUnLinkModule(h, NSUNLINKMODULE_OPTION_NONE);
h = NULL;
}
}
}
return h;
}
#endif
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
/*
** macLibraryLoadProc is a function definition for a Mac shared library
** loading method. The "name" param is the same full or partial pathname
** that was passed to pr_LoadLibraryByPathName. The function must fill
** in the fields of "lm" which apply to its library type. Returns
** PR_SUCCESS if successful.
*/
typedef PRStatus (*macLibraryLoadProc)(const char *name, PRLibrary *lm);
#ifdef __ppc__
/*
** CFM and its TVectors only exist on PowerPC. Other OS X architectures
** only use Mach-O as a native binary format.
*/
static void* TV2FP(CFMutableDictionaryRef dict, const char* name, void *tvp)
{
static uint32 glue[6] = { 0x3D800000, 0x618C0000, 0x800C0000, 0x804C0004, 0x7C0903A6, 0x4E800420 };
uint32* newGlue = NULL;
if (tvp != NULL) {
CFStringRef nameRef = CFStringCreateWithCString(NULL, name, kCFStringEncodingASCII);
if (nameRef) {
CFMutableDataRef glueData = (CFMutableDataRef) CFDictionaryGetValue(dict, nameRef);
if (glueData == NULL) {
glueData = CFDataCreateMutable(NULL, sizeof(glue));
if (glueData != NULL) {
newGlue = (uint32*) CFDataGetMutableBytePtr(glueData);
memcpy(newGlue, glue, sizeof(glue));
newGlue[0] |= ((UInt32)tvp >> 16);
newGlue[1] |= ((UInt32)tvp & 0xFFFF);
MakeDataExecutable(newGlue, sizeof(glue));
CFDictionaryAddValue(dict, nameRef, glueData);
CFRelease(glueData);
PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("TV2FP: created wrapper for CFM function %s().", name));
}
} else {
PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("TV2FP: found wrapper for CFM function %s().", name));
newGlue = (uint32*) CFDataGetMutableBytePtr(glueData);
}
CFRelease(nameRef);
}
}
return newGlue;
}
static PRStatus
pr_LoadViaCFM(const char *name, PRLibrary *lm)
{
OSErr err;
Str255 errName;
FSRef ref;
FSSpec fileSpec;
Boolean tempUnusedBool;
/*
* Make an FSSpec from the path name and call GetDiskFragment.
*/
/* Use direct conversion of POSIX path to FSRef to FSSpec. */
err = FSPathMakeRef((const UInt8*)name, &ref, NULL);
if (err != noErr) {
return PR_FAILURE;
}
err = FSGetCatalogInfo(&ref, kFSCatInfoNone, NULL, NULL,
&fileSpec, NULL);
if (err != noErr) {
return PR_FAILURE;
}
/* Resolve an alias if this was one */
err = ResolveAliasFile(&fileSpec, true, &tempUnusedBool,
&tempUnusedBool);
if (err != noErr) {
return PR_FAILURE;
}
/* Finally, try to load the library */
err = GetDiskFragment(&fileSpec, 0, kCFragGoesToEOF, fileSpec.name,
kLoadCFrag, &lm->connection, &lm->main, errName);
if (err == noErr && lm->connection) {
/*
* if we're a mach-o binary, need to wrap all CFM function
* pointers. need a hash-table of already seen function
* pointers, etc.
*/
lm->wrappers = CFDictionaryCreateMutable(NULL, 16,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
if (lm->wrappers) {
lm->main = TV2FP(lm->wrappers, "main", lm->main);
} else {
err = memFullErr;
}
}
return (err == noErr) ? PR_SUCCESS : PR_FAILURE;
}
#endif /* __ppc__ */
/*
** Creates a CFBundleRef if the pathname refers to a Mac OS X bundle
** directory. The caller is responsible for calling CFRelease() to
** deallocate.
*/
static PRStatus
pr_LoadCFBundle(const char *name, PRLibrary *lm)
{
CFURLRef bundleURL;
CFBundleRef bundle = NULL;
char pathBuf[PATH_MAX];
const char *resolvedPath;
CFStringRef pathRef;
/* Takes care of relative paths and symlinks */
resolvedPath = realpath(name, pathBuf);
if (!resolvedPath) {
return PR_FAILURE;
}
pathRef = CFStringCreateWithCString(NULL, pathBuf, kCFStringEncodingUTF8);
if (pathRef) {
bundleURL = CFURLCreateWithFileSystemPath(NULL, pathRef,
kCFURLPOSIXPathStyle, true);
if (bundleURL) {
bundle = CFBundleCreate(NULL, bundleURL);
CFRelease(bundleURL);
}
CFRelease(pathRef);
}
lm->bundle = bundle;
return (bundle != NULL) ? PR_SUCCESS : PR_FAILURE;
}
static PRStatus
pr_LoadViaDyld(const char *name, PRLibrary *lm)
{
lm->dlh = pr_LoadMachDyldModule(name);
if (lm->dlh == NULL) {
lm->image = NSAddImage(name, NSADDIMAGE_OPTION_RETURN_ON_ERROR
| NSADDIMAGE_OPTION_WITH_SEARCHING);
if (lm->image == NULL) {
NSLinkEditErrors linkEditError;
int errorNum;
const char *fileName;
const char *errorString;
NSLinkEditError(&linkEditError, &errorNum, &fileName, &errorString);
PR_LOG(_pr_linker_lm, PR_LOG_MIN,
("LoadMachDyldModule error %d:%d for file %s:\n%s",
linkEditError, errorNum, fileName, errorString));
}
}
return (lm->dlh != NULL || lm->image != NULL) ? PR_SUCCESS : PR_FAILURE;
}
#endif /* XP_MACOSX && USE_MACH_DYLD */
/*
** Dynamically load a library. Only load libraries once, so scan the load
** map first.
@ -733,36 +518,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
}
#endif /* WIN32 */
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
{
int i;
PRStatus status;
static const macLibraryLoadProc loadProcs[] = {
#ifdef __ppc__
pr_LoadViaDyld, pr_LoadCFBundle, pr_LoadViaCFM
#else /* __ppc__ */
pr_LoadViaDyld, pr_LoadCFBundle
#endif /* __ppc__ */
};
for (i = 0; i < sizeof(loadProcs) / sizeof(loadProcs[0]); i++) {
if ((status = loadProcs[i](name, lm)) == PR_SUCCESS) {
break;
}
}
if (status != PR_SUCCESS) {
oserr = cfragNoLibraryErr;
PR_DELETE(lm);
goto unlock;
}
lm->name = strdup(name);
lm->next = pr_loadmap;
pr_loadmap = lm;
}
#endif
#if defined(XP_UNIX) && !(defined(XP_MACOSX) && defined(USE_MACH_DYLD))
#if defined(XP_UNIX)
#ifdef HAVE_DLL
{
#if defined(USE_DLFCN)
@ -847,8 +603,6 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
}
/* No equivalent of PR_LD_GLOBAL and PR_LD_LOCAL. */
h = shl_load(name, shl_flags, 0L);
#elif defined(USE_MACH_DYLD)
NSModule h = pr_LoadMachDyldModule(name);
#else
#error Configuration error
#endif
@ -863,7 +617,7 @@ pr_LoadLibraryByPathname(const char *name, PRIntn flags)
pr_loadmap = lm;
}
#endif /* HAVE_DLL */
#endif /* XP_UNIX && !(XP_MACOSX && USE_MACH_DYLD) */
#endif /* XP_UNIX */
lm->refCount = 1;
@ -922,10 +676,6 @@ PR_UnloadLibrary(PRLibrary *lib)
result = dlclose(lib->dlh);
#elif defined(USE_HPSHL)
result = shl_unload(lib->dlh);
#elif defined(USE_MACH_DYLD)
if (lib->dlh) {
result = NSUnLinkModule(lib->dlh, NSUNLINKMODULE_OPTION_NONE) ? 0 : -1;
}
#else
#error Configuration error
#endif
@ -938,20 +688,6 @@ PR_UnloadLibrary(PRLibrary *lib)
}
#endif /* XP_PC */
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
/* Close the connection */
if (lib->connection) {
CloseConnection(&(lib->connection));
}
if (lib->bundle) {
CFRelease(lib->bundle);
}
if (lib->wrappers) {
CFRelease(lib->wrappers);
}
/* No way to unload an image (lib->image) */
#endif
/* unlink from library search list */
if (pr_loadmap == lib) {
pr_loadmap = pr_loadmap->next;
@ -1041,53 +777,6 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
f = GetProcAddress(lm->dlh, name);
#endif /* WIN32 */
#if defined(XP_MACOSX) && defined(USE_MACH_DYLD)
/* add this offset to skip the leading underscore in name */
#define SYM_OFFSET 1
if (lm->bundle) {
CFStringRef nameRef = CFStringCreateWithCString(NULL, name + SYM_OFFSET, kCFStringEncodingASCII);
if (nameRef) {
f = CFBundleGetFunctionPointerForName(lm->bundle, nameRef);
CFRelease(nameRef);
}
}
if (lm->connection) {
Ptr symAddr;
CFragSymbolClass symClass;
Str255 pName;
PR_LOG(_pr_linker_lm, PR_LOG_MIN, ("Looking up symbol: %s", name + SYM_OFFSET));
c2pstrcpy(pName, name + SYM_OFFSET);
f = (FindSymbol(lm->connection, pName, &symAddr, &symClass) == noErr) ? symAddr : NULL;
#ifdef __ppc__
/* callers expect mach-o function pointers, so must wrap tvectors with glue. */
if (f && symClass == kTVectorCFragSymbol) {
f = TV2FP(lm->wrappers, name + SYM_OFFSET, f);
}
#endif /* __ppc__ */
if (f == NULL && strcmp(name + SYM_OFFSET, "main") == 0) {
f = lm->main;
}
}
if (lm->image) {
NSSymbol symbol;
symbol = NSLookupSymbolInImage(lm->image, name,
NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
| NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR);
if (symbol != NULL) {
f = NSAddressOfSymbol(symbol);
}
else {
f = NULL;
}
}
#undef SYM_OFFSET
#endif /* XP_MACOSX && USE_MACH_DYLD */
#ifdef XP_UNIX
#ifdef HAVE_DLL
#ifdef USE_DLFCN
@ -1096,17 +785,6 @@ pr_FindSymbolInLib(PRLibrary *lm, const char *name)
if (shl_findsym(&lm->dlh, name, TYPE_PROCEDURE, &f) == -1) {
f = NULL;
}
#elif defined(USE_MACH_DYLD)
if (lm->dlh) {
NSSymbol symbol;
symbol = NSLookupSymbolInModule(lm->dlh, name);
if (symbol != NULL) {
f = NSAddressOfSymbol(symbol);
}
else {
f = NULL;
}
}
#endif
#endif /* HAVE_DLL */
#endif /* XP_UNIX */
@ -1289,23 +967,6 @@ PR_GetLibraryFilePathname(const char *name, PRFuncPtr addr)
strcpy(result, dli.dli_fname);
}
return result;
#elif defined(USE_MACH_DYLD)
char *result;
const char *image_name;
int i, count = _dyld_image_count();
for (i = 0; i < count; i++) {
image_name = _dyld_get_image_name(i);
if (strstr(image_name, name) != NULL) {
result = PR_Malloc(strlen(image_name)+1);
if (result != NULL) {
strcpy(result, image_name);
}
return result;
}
}
PR_SetError(PR_LIBRARY_NOT_LOADED_ERROR, 0);
return NULL;
#elif defined(AIX)
char *result;
#define LD_INFO_INCREMENT 64

View File

@ -68,4 +68,4 @@ _PR_ia64_AtomicSet:
.endp _PR_ia64_AtomicSet#
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous
.section .note.GNU-stack, "", @progbits

View File

@ -72,4 +72,4 @@ _PR_ppc_AtomicAdd:
.Lfe4: .size _PR_ppc_AtomicAdd,.Lfe4-_PR_ppc_AtomicAdd
# Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous
.section .note.GNU-stack, "", @progbits

View File

@ -82,4 +82,4 @@ _PR_x86_AtomicAdd:
ret
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous
.section .note.GNU-stack, "", @progbits

View File

@ -71,4 +71,4 @@ _PR_x86_64_AtomicAdd:
.size _PR_x86_64_AtomicAdd, .-_PR_x86_64_AtomicAdd
// Magic indicating no need for an executable stack
.section .note.GNU-stack, "", @progbits ; .previous
.section .note.GNU-stack, "", @progbits

View File

@ -304,17 +304,6 @@ static double private_mem[PRIVATE_mem], *pmem_next = private_mem;
#else /* ifndef Bad_float_h */
#include "float.h"
/*
* MacOS 10.2 defines the macro FLT_ROUNDS to an internal function
* which does not exist on 10.1. We can safely #define it to 1 here
* to allow 10.2 builds to run on 10.1, since we can't use fesetround()
* (which does not exist on 10.1 either).
*/
#if defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2)
#undef FLT_ROUNDS
#define FLT_ROUNDS 1
#endif /* DT < 10.2 */
#endif /* Bad_float_h */
#ifndef __MATH_H__

View File

@ -166,9 +166,7 @@ static PRBool _pr_have_inet6_if = PR_FALSE;
#undef DEBUG_QUERY_IFS
#if defined(AIX) \
|| (defined(DARWIN) && (!defined(HAVE_GETIFADDRS) \
|| (defined(XP_MACOSX) && (!defined(MAC_OS_X_VERSION_10_2) || \
MAC_OS_X_VERSION_MIN_REQUIRED < MAC_OS_X_VERSION_10_2))))
|| (defined(DARWIN) && !defined(HAVE_GETIFADDRS))
/*
* Use SIOCGIFCONF ioctl on platforms that don't have routing

View File

@ -16,6 +16,10 @@
#include <errno.h>
#include <string.h>
#if defined(XP_UNIX)
#include <unistd.h>
#endif
#ifdef DEBUG
#define PORT_INC_DO +100
#else

View File

@ -17,6 +17,10 @@
#include <pthread.h>
#endif
#if defined(XP_UNIX)
#include <unistd.h>
#endif
#if defined(XP_OS2)
#define INCL_DOSFILEMGR
#include <os2.h>

View File

@ -41,7 +41,7 @@ static char *compatible_version[] = {
"4.10.5", "4.10.6", "4.10.7", "4.10.8", "4.10.9",
"4.10.10", "4.11", "4.12", "4.13", "4.14", "4.15",
"4.16", "4.17", "4.18", "4.19", "4.20", "4.21", "4.22",
"4.23", "4.24", "4.25", "4,26", "4.27",
"4.23", "4.24", "4.25", "4,26", "4.27", "4.28",
PR_VERSION
};
@ -57,8 +57,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.28.1",
"4.29", "4.29.1",
"4.29.1",
"4.30", "4.30.1",
"10.0", "11.1", "12.14.20"
};