Bug 125819: fixed problems compiling using gcc on OSF1. The patch is

contributed by Chris Seawood <seawood@netscape.com>.
Modified Files: configure configure.in unix.c uxrng.c
This commit is contained in:
wtc%netscape.com 2002-06-14 03:24:33 +00:00
Родитель 9f37b07140
Коммит 9a3a8118ee
4 изменённых файлов: 47 добавлений и 16 удалений

28
nsprpub/configure поставляемый
Просмотреть файл

@ -4147,19 +4147,30 @@ EOF
#define _REENTRANT 1
EOF
if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
USE_NSPR_THREADS=1
fi
if test -z "$GNU_CC"; then
CC="$CC -std1 -ieee_with_inexact"
if test "$OS_RELEASE" != "V2.0"; then
CC="$CC -readonly_strings"
fi
_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:4153: checking for machine/builtins.h" >&5
echo "configure:4164: 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 4158 "configure"
#line 4169 "configure"
#include "confdefs.h"
#include <machine/builtins.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
{ (eval echo configure:4163: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
{ (eval echo configure:4174: \"$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*
@ -4183,17 +4194,6 @@ else
echo "$ac_t""no" 1>&6
fi
if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
USE_NSPR_THREADS=1
fi
if test -z "$GNU_CC"; then
CC="$CC -std1 -ieee_with_inexact"
if test "$OS_RELEASE" != "V2.0"; then
CC="$CC -readonly_strings"
fi
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
fi
if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then

Просмотреть файл

@ -1454,7 +1454,6 @@ mips-sony-newsos*)
AC_DEFINE(XP_UNIX)
AC_DEFINE(OSF1)
AC_DEFINE(_REENTRANT)
AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
if echo "$OS_RELEASE" | egrep -c '(V2.0|V3.2)' 2>/dev/null ; then
USE_NSPR_THREADS=1
@ -1466,6 +1465,7 @@ mips-sony-newsos*)
CC="$CC -readonly_strings"
fi
_OPTIMIZE_FLAGS="$_OPTIMIZE_FLAGS -Olimit 4000"
AC_CHECK_HEADER(machine/builtins.h, AC_DEFINE(OSF1_HAVE_MACHINE_BUILTINS_H))
fi
if echo $OS_RELEASE | egrep -c '(V2.0|V3.2)' 2>/dev/null; then

Просмотреть файл

@ -2727,6 +2727,28 @@ static void* _MD_Unix_mmap64(
} /* _MD_Unix_mmap64 */
#endif /* defined(_PR_NO_LARGE_FILES) || defined(SOLARIS2_5) */
#if defined(OSF1) && defined(__GNUC__)
/*
* On OSF1 V5.0A, <sys/stat.h> defines stat and fstat as
* macros when compiled under gcc, so it is rather tricky to
* take the addresses of the real functions the macros expend
* to. A simple solution is to define forwarder functions
* and take the addresses of the forwarder functions instead.
*/
static int stat_forwarder(const char *path, struct stat *buffer)
{
return stat(path, buffer);
}
static int fstat_forwarder(int filedes, struct stat *buffer)
{
return fstat(filedes, buffer);
}
#endif
static void _PR_InitIOV(void)
{
#if defined(SOLARIS2_5)
@ -2771,8 +2793,13 @@ static void _PR_InitIOV(void)
#elif defined(_PR_HAVE_LARGE_OFF_T)
_md_iovector._open64 = open;
_md_iovector._mmap64 = mmap;
#if defined(OSF1) && defined(__GNUC__)
_md_iovector._fstat64 = fstat_forwarder;
_md_iovector._stat64 = stat_forwarder;
#else
_md_iovector._fstat64 = fstat;
_md_iovector._stat64 = stat;
#endif
_md_iovector._lseek64 = lseek;
#else
#error "I don't know yet"

Просмотреть файл

@ -101,7 +101,11 @@ GetHighResClock(void *buf, size_t maxbytes)
{
unsigned long t;
#ifdef __GNUC__
__asm__("rpcc %0" : "=r" (t));
#else
t = asm("rpcc %v0");
#endif
return _pr_CopyLowBits(buf, maxbytes, &t, sizeof(t));
}