Bug 476448 -KPIC is obsolete in Sun Studio 12 SPARC r=jim

This commit is contained in:
Ginn Chen 2009-02-09 14:21:09 +08:00
parent 21e513ab2a
commit d522f048c8
6 changed files with 106 additions and 52 deletions

View File

@ -561,6 +561,10 @@ OS_TEST=@OS_TEST@
TARGET_DEVICE = @TARGET_DEVICE@ TARGET_DEVICE = @TARGET_DEVICE@
# For Solaris build
SOLARIS_SUNPRO_CC = @SOLARIS_SUNPRO_CC@
SOLARIS_SUNPRO_CXX = @SOLARIS_SUNPRO_CXX@
# For AIX build # For AIX build
AIX_OBJMODEL = @AIX_OBJMODEL@ AIX_OBJMODEL = @AIX_OBJMODEL@

View File

@ -431,11 +431,9 @@ endif
# the Solaris WorkShop template repository cache. it occasionally can get # the Solaris WorkShop template repository cache. it occasionally can get
# out of sync, so targets like clobber should kill it. # out of sync, so targets like clobber should kill it.
# #
ifeq ($(OS_ARCH),SunOS) ifeq ($(SOLARIS_SUNPRO_CXX),1)
ifeq ($(GNU_CXX),)
GARBAGE_DIRS += SunWS_cache GARBAGE_DIRS += SunWS_cache
endif endif
endif
ifeq ($(OS_ARCH),OpenVMS) ifeq ($(OS_ARCH),OpenVMS)
GARBAGE += $(wildcard *.*_defines) GARBAGE += $(wildcard *.*_defines)
@ -1327,7 +1325,7 @@ endif
ifdef MOZ_AUTO_DEPS ifdef MOZ_AUTO_DEPS
ifdef COMPILER_DEPEND ifdef COMPILER_DEPEND
ifeq (__SunOS,$(GNU_CC)_$(GNU_CXX)_$(OS_ARCH)) ifeq ($(SOLARIS_SUNPRO_CC),1)
_MDDEPFILE = $(MDDEPDIR)/$(@F).pp _MDDEPFILE = $(MDDEPDIR)/$(@F).pp
define MAKE_DEPS_AUTO_CC define MAKE_DEPS_AUTO_CC

View File

@ -1100,6 +1100,21 @@ linux*)
;; ;;
solaris*) solaris*)
HOST_OS_ARCH=SunOS HOST_OS_ARCH=SunOS
SOLARIS_SUNPRO_CC=
SOLARIS_SUNPRO_CXX=
if test -z "$GNU_CC"; then
if test "`$_SUBDIR_CC -V 2>&1 | grep -c 'Sun C '`" != "0"; then
SOLARIS_SUNPRO_CC=1
fi
fi
if test -z "$GNU_CXX"; then
if test "`$_SUBDIR_CXX -V 2>&1 | grep -c 'Sun C++ '`" != "0"; then
SOLARIS_SUNPRO_CXX=1
fi
fi
AC_SUBST(SOLARIS_SUNPRO_CC)
AC_SUBST(SOLARIS_SUNPRO_CXX)
;; ;;
BSD_386) BSD_386)
HOST_OS_ARCH=BSD HOST_OS_ARCH=BSD
@ -1370,6 +1385,24 @@ if test "$GNU_CC"; then
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT' _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1 _USE_CPP_INCLUDE_FLAG=1
elif test "$SOLARIS_SUNPRO_CC"; then
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
DSO_LDOPTS='-shared'
if test "$GNU_LD"; then
# Don't allow undefined symbols in libraries
DSO_LDOPTS="$DSO_LDOPTS -z defs"
fi
DSO_CFLAGS=''
if test "$CPU_ARCH" = "sparc"; then
# for Sun Studio on Solaris/SPARC
DSO_PIC_CFLAGS='-xcode=pic32'
else
DSO_PIC_CFLAGS='-KPIC'
fi
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else else
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@' MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@' MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
@ -2456,21 +2489,13 @@ dnl the qsort routine under solaris is faulty
# libraries one level up (e.g. libnspr4.so) # libraries one level up (e.g. libnspr4.so)
LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'" LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
MOZ_MEMORY=1 MOZ_MEMORY=1
if test -z "$GNU_CC"; then if test "$SOLARIS_SUNPRO_CC"; then
LIBS="-lCrun -lCstd $LIBS" LIBS="-lCrun -lCstd $LIBS"
NS_USE_NATIVE=1 NS_USE_NATIVE=1
MOZ_FIX_LINK_PATHS= MOZ_FIX_LINK_PATHS=
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
if test "$CPU_ARCH" != "sparc"; then
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all" CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath" CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
else
# Do not use -xbuiltin on SPARC to get around a bug of compiler
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%none"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%none -features=tmplife -norunpath"
fi
LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS" LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
_SAVE_LDFLAGS=$LDFLAGS _SAVE_LDFLAGS=$LDFLAGS
@ -2498,17 +2523,17 @@ dnl the qsort routine under solaris is faulty
TARGET_COMPILER_ABI="sunc" TARGET_COMPILER_ABI="sunc"
CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'` CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'` CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
AC_MSG_CHECKING([for Forte compiler version >= WS6U2]) AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([], AC_TRY_COMPILE([],
[#if (__SUNPRO_CC < 0x530) [#if (__SUNPRO_CC < 0x590)
#error "Denied" #error "Denied"
#endif], #endif],
_BAD_COMPILER=,_BAD_COMPILER=1) _BAD_COMPILER=,_BAD_COMPILER=1)
if test -n "$_BAD_COMPILER"; then if test -n "$_BAD_COMPILER"; then
_res="no" _res="no"
AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .]) AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
else else
_res="yes" _res="yes"
fi fi
@ -2948,7 +2973,7 @@ EOF
fi # GNU_CC fi # GNU_CC
# visibility hidden flag for Sun Studio on Solaris # visibility hidden flag for Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
VISIBILITY_FLAGS='-xldscope=hidden' VISIBILITY_FLAGS='-xldscope=hidden'
fi # Sun Studio on Solaris fi # Sun Studio on Solaris
@ -3307,7 +3332,7 @@ then
*-*-solaris*) *-*-solaris*)
AC_DEFINE(_REENTRANT) AC_DEFINE(_REENTRANT)
if test ! "$GNU_CC"; then if test "$SOLARIS_SUNPRO_CC"; then
CFLAGS="$CFLAGS -mt" CFLAGS="$CFLAGS -mt"
CXXFLAGS="$CXXFLAGS -mt" CXXFLAGS="$CXXFLAGS -mt"
fi fi
@ -7007,7 +7032,7 @@ if test -n "$INTEL_CC"; then
fi fi
dnl Sun Studio on Solaris dnl Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application" PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application" PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
if test "$CPU_ARCH" != "sparc"; then if test "$CPU_ARCH" != "sparc"; then
@ -7197,7 +7222,7 @@ MOZ_ARG_DISABLE_BOOL(md,
_cpp_md_flag=1 _cpp_md_flag=1
fi fi
dnl Default is to use -xM if using Sun Studio on Solaris dnl Default is to use -xM if using Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
_cpp_md_flag=1 _cpp_md_flag=1
fi]) fi])
if test "$_cpp_md_flag"; then if test "$_cpp_md_flag"; then
@ -7208,7 +7233,7 @@ if test "$_cpp_md_flag"; then
_DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)' _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
fi fi
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
_DEPEND_CFLAGS= _DEPEND_CFLAGS=
fi fi
else else

View File

@ -312,6 +312,10 @@ OS_TEST=@OS_TEST@
TARGET_DEVICE = @TARGET_DEVICE@ TARGET_DEVICE = @TARGET_DEVICE@
# For Solaris build
SOLARIS_SUNPRO_CC = @SOLARIS_SUNPRO_CC@
SOLARIS_SUNPRO_CXX = @SOLARIS_SUNPRO_CXX@
# For AIX build # For AIX build
AIX_OBJMODEL = @AIX_OBJMODEL@ AIX_OBJMODEL = @AIX_OBJMODEL@

View File

@ -431,11 +431,9 @@ endif
# the Solaris WorkShop template repository cache. it occasionally can get # the Solaris WorkShop template repository cache. it occasionally can get
# out of sync, so targets like clobber should kill it. # out of sync, so targets like clobber should kill it.
# #
ifeq ($(OS_ARCH),SunOS) ifeq ($(SOLARIS_SUNPRO_CXX),1)
ifeq ($(GNU_CXX),)
GARBAGE_DIRS += SunWS_cache GARBAGE_DIRS += SunWS_cache
endif endif
endif
ifeq ($(OS_ARCH),OpenVMS) ifeq ($(OS_ARCH),OpenVMS)
GARBAGE += $(wildcard *.*_defines) GARBAGE += $(wildcard *.*_defines)
@ -1327,7 +1325,7 @@ endif
ifdef MOZ_AUTO_DEPS ifdef MOZ_AUTO_DEPS
ifdef COMPILER_DEPEND ifdef COMPILER_DEPEND
ifeq (__SunOS,$(GNU_CC)_$(GNU_CXX)_$(OS_ARCH)) ifeq ($(SOLARIS_SUNPRO_CC),1)
_MDDEPFILE = $(MDDEPDIR)/$(@F).pp _MDDEPFILE = $(MDDEPDIR)/$(@F).pp
define MAKE_DEPS_AUTO_CC define MAKE_DEPS_AUTO_CC

View File

@ -1017,6 +1017,21 @@ linux*)
;; ;;
solaris*) solaris*)
HOST_OS_ARCH=SunOS HOST_OS_ARCH=SunOS
SOLARIS_SUNPRO_CC=
SOLARIS_SUNPRO_CXX=
if test -z "$GNU_CC"; then
if test "`$_SUBDIR_CC -V 2>&1 | grep -c 'Sun C '`" != "0"; then
SOLARIS_SUNPRO_CC=1
fi
fi
if test -z "$GNU_CXX"; then
if test "`$_SUBDIR_CXX -V 2>&1 | grep -c 'Sun C++ '`" != "0"; then
SOLARIS_SUNPRO_CXX=1
fi
fi
AC_SUBST(SOLARIS_SUNPRO_CC)
AC_SUBST(SOLARIS_SUNPRO_CXX)
;; ;;
BSD_386) BSD_386)
HOST_OS_ARCH=BSD HOST_OS_ARCH=BSD
@ -1288,6 +1303,24 @@ if test "$GNU_CC"; then
_DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT' _DEFINES_CFLAGS='-include $(DEPTH)/mozilla-config.h -DMOZILLA_CLIENT'
_USE_CPP_INCLUDE_FLAG=1 _USE_CPP_INCLUDE_FLAG=1
elif test "$SOLARIS_SUNPRO_CC"; then
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
DSO_LDOPTS='-shared'
if test "$GNU_LD"; then
# Don't allow undefined symbols in libraries
DSO_LDOPTS="$DSO_LDOPTS -z defs"
fi
DSO_CFLAGS=''
if test "$CPU_ARCH" = "sparc"; then
# for Sun Studio on Solaris/SPARC
DSO_PIC_CFLAGS='-xcode=pic32'
else
DSO_PIC_CFLAGS='-KPIC'
fi
_DEFINES_CFLAGS='$(ACDEFINES) -D_MOZILLA_CONFIG_H_ -DMOZILLA_CLIENT'
else else
MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@' MKSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@' MKCSHLIB='$(LD) $(DSO_LDOPTS) -h $@ -o $@'
@ -2271,21 +2304,13 @@ dnl the qsort routine under solaris is faulty
# $ORIGIN/.. is for shared libraries under components/ to locate shared # $ORIGIN/.. is for shared libraries under components/ to locate shared
# libraries one level up (e.g. libnspr4.so) # libraries one level up (e.g. libnspr4.so)
LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'" LDFLAGS="$LDFLAGS -z ignore -R '\$\$ORIGIN:\$\$ORIGIN/..'"
if test -z "$GNU_CC"; then if test "$SOLARIS_SUNPRO_CC"; then
LIBS="-lCrun -lCstd $LIBS" LIBS="-lCrun -lCstd $LIBS"
NS_USE_NATIVE=1 NS_USE_NATIVE=1
MOZ_FIX_LINK_PATHS= MOZ_FIX_LINK_PATHS=
AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES) AC_DEFINE(NSCAP_DISABLE_DEBUG_PTR_TYPES)
if test "$CPU_ARCH" != "sparc"; then
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all" CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%all"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath" CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%all -features=tmplife -norunpath"
else
# Do not use -xbuiltin on SPARC to get around a bug of compiler
CFLAGS="$CFLAGS -xlibmieee -xstrconst -xbuiltin=%none"
CXXFLAGS="$CXXFLAGS -xlibmieee -xbuiltin=%none -features=tmplife -norunpath"
fi
LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS" LDFLAGS="-xildoff -z lazyload -z combreloc $LDFLAGS"
if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then if test -z "$CROSS_COMPILE" && test -f /usr/lib/ld/map.noexstk; then
_SAVE_LDFLAGS=$LDFLAGS _SAVE_LDFLAGS=$LDFLAGS
@ -2313,17 +2338,17 @@ dnl the qsort routine under solaris is faulty
TARGET_COMPILER_ABI="sunc" TARGET_COMPILER_ABI="sunc"
CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'` CC_VERSION=`$CC -V 2>&1 | grep '^cc:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'` CXX_VERSION=`$CXX -V 2>&1 | grep '^CC:' 2>/dev/null | $AWK -F\: '{ print $2 }'`
AC_MSG_CHECKING([for Forte compiler version >= WS6U2]) AC_MSG_CHECKING([for Sun C++ compiler version >= 5.9])
AC_LANG_SAVE AC_LANG_SAVE
AC_LANG_CPLUSPLUS AC_LANG_CPLUSPLUS
AC_TRY_COMPILE([], AC_TRY_COMPILE([],
[#if (__SUNPRO_CC < 0x530) [#if (__SUNPRO_CC < 0x590)
#error "Denied" #error "Denied"
#endif], #endif],
_BAD_COMPILER=,_BAD_COMPILER=1) _BAD_COMPILER=,_BAD_COMPILER=1)
if test -n "$_BAD_COMPILER"; then if test -n "$_BAD_COMPILER"; then
_res="no" _res="no"
AC_MSG_ERROR([Forte version WS6U2 or higher is required to build. Your compiler version is $CC_VERSION .]) AC_MSG_ERROR([Sun C++ 5.9 (Sun Studio 12) or higher is required to build. Your compiler version is $CXX_VERSION .])
else else
_res="yes" _res="yes"
fi fi
@ -2855,7 +2880,7 @@ EOF
fi # GNU_CC fi # GNU_CC
# visibility hidden flag for Sun Studio on Solaris # visibility hidden flag for Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
VISIBILITY_FLAGS='-xldscope=hidden' VISIBILITY_FLAGS='-xldscope=hidden'
fi # Sun Studio on Solaris fi # Sun Studio on Solaris
@ -3109,7 +3134,7 @@ then
*-*-solaris*) *-*-solaris*)
AC_DEFINE(_REENTRANT) AC_DEFINE(_REENTRANT)
if test ! "$GNU_CC"; then if test "$SOLARIS_SUNPRO_CC"; then
CFLAGS="$CFLAGS -mt" CFLAGS="$CFLAGS -mt"
CXXFLAGS="$CXXFLAGS -mt" CXXFLAGS="$CXXFLAGS -mt"
fi fi
@ -4612,7 +4637,7 @@ if test -n "$INTEL_CC"; then
fi fi
dnl Sun Studio on Solaris dnl Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application" PROFILE_GEN_CFLAGS="-xprofile=collect:$_objdir/$enable_application"
PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application" PROFILE_GEN_LDFLAGS="-xprofile=collect:$_objdir/$enable_application"
if test "$CPU_ARCH" != "sparc"; then if test "$CPU_ARCH" != "sparc"; then
@ -4816,7 +4841,7 @@ MOZ_ARG_DISABLE_BOOL(md,
_cpp_md_flag=1 _cpp_md_flag=1
fi fi
dnl Default is to use -xM if using Sun Studio on Solaris dnl Default is to use -xM if using Sun Studio on Solaris
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
_cpp_md_flag=1 _cpp_md_flag=1
fi]) fi])
if test "$_cpp_md_flag"; then if test "$_cpp_md_flag"; then
@ -4827,7 +4852,7 @@ if test "$_cpp_md_flag"; then
_DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)' _DEPEND_CFLAGS='$(filter-out %/.pp,-Wp,-MD,$(MDDEPDIR)/$(basename $(@F)).pp)'
fi fi
dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk dnl Sun Studio on Solaris use -xM instead of -MD, see config/rules.mk
if test -z "$GNU_CC" && test -z "$GNU_CXX" && test "$OS_ARCH" = "SunOS"; then if test "$SOLARIS_SUNPRO_CC"; then
_DEPEND_CFLAGS= _DEPEND_CFLAGS=
fi fi
else else