fixup commit for tag 'NSS_3_11_1_RTM_FORTE6' NSS_3_11_1_BRANCH NSS_3_11_1_RTM_FORTE6
authorcvs2hg
Fri, 05 May 2006 23:45:23 +0000
branchNSS_3_11_1_BRANCH
changeset 6988 c0f8f5bce56f2e6127ddbbb777bc0bac5e93be8f
parent 6975 001b191ba77503f2babe21caed114fbc522795a3
child 6999 a8ea89fe30e8235d3d45471dc325c15d6a75a8e6
push idunknown
push userunknown
push dateunknown
fixup commit for tag 'NSS_3_11_1_RTM_FORTE6'
security/nss/lib/freebl/Makefile
--- a/security/nss/lib/freebl/Makefile
+++ b/security/nss/lib/freebl/Makefile
@@ -127,17 +127,17 @@ endif
 
 ifeq ($(OS_TARGET),Linux)
 ifeq ($(CPU_ARCH),x86_64)
     ASFILES  = arcfour-amd64-gas.s mpi_amd64_gas.s
     ASFLAGS += -march=opteron -m64 -fPIC
     DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY
     DEFINES += -DNSS_USE_COMBA
     DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
-#    DEFINES += -DMPI_AMD64_ADD
+#   DEFINES += -DMPI_AMD64_ADD
     MPI_SRCS += mpi_amd64.c mp_comba.c
 endif
 ifeq ($(CPU_ARCH),x86)
     ASFILES  = mpi_x86.s
     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_ASSEMBLY_SQUARE 
     DEFINES += -DMP_ASSEMBLY_DIV_2DX1D
     DEFINES += -DMP_CHAR_STORE_SLOW -DMP_IS_LITTLE_ENDIAN
     # The floating point ECC code doesn't work on Linux x86 (bug 311432).
@@ -248,16 +248,28 @@ ifeq ($(CPU_ARCH),sparc)
 	endif
 	ifdef USE_ABI64_FPU
 	    # this builds for Sparc v9a pure 64-bit architecture
 	    # It uses floating point, and 32-bit word size
 	    ARCHFLAG += -mcpu=v9 -Wa,-xarch=v9a
 	    SOLARIS_AS_FLAGS = -xarch=v9a -K PIC
 	endif
     else # NS_USE_GCC
+	# FPU_TARGET_OPTIMIZER specifies the target processor and cache
+	# properties of the ABI32_FPU and ABI64_FPU architectures for use
+	# by the optimizer.
+	ifeq (,$(findstring Sun WorkShop 6,$(shell $(CC) -V 2>&1)))
+	    # if the compiler is not Forte 6
+	    FPU_TARGET_OPTIMIZER = -xcache=64/32/4:1024/64/4 -xchip=ultra3
+	else
+	    # Forte 6 C compiler generates incorrect code for rijndael.c
+	    # if -xchip=ultra3 is used (Bugzilla bug 333925).  So we revert
+	    # to what we used in NSS 3.10.
+	    FPU_TARGET_OPTIMIZER = -xchip=ultra2
+	endif
 	ifdef USE_ABI32_INT32
 	    #ARCHFLAG=-xarch=v8 set in coreconf/sunOS5.mk
 	endif
 	ifdef USE_ABI32_INT64
 	    # this builds for Sparc v8+a ABI32_FPU architecture, 64-bit registers, 
 	    # 32-bit ABI, it uses 64-bit words, integer arithmetic,
 	    # no FPU (non-VIS cpus).
 	    # These flags were suggested by the compiler group for building
@@ -268,17 +280,17 @@ ifeq ($(CPU_ARCH),sparc)
 	endif
 	ifdef USE_ABI32_FPU
 	    # this builds for Sparc v8+a ABI32_FPU architecture, 64-bit registers, 
 	    # 32-bit ABI, it uses FPU code, and 32-bit word size.
 	    # these flags were determined by running cc -### -fast and copying
 	    # the generated flag settings
 	    SOL_CFLAGS += -D__MATHERR_ERRNO_DONTCARE -fns -fsimple=2 -fsingle
 	    SOL_CFLAGS += -xalias_level=basic -xbuiltin=%all
-	    SOL_CFLAGS += -xcache=64/32/4:1024/64/4 -xchip=ultra3 -xdepend
+	    SOL_CFLAGS += $(FPU_TARGET_OPTIMIZER) -xdepend
 	    SOL_CFLAGS += -xlibmil -xmemalign=8s -xO5
 	    ARCHFLAG = -xarch=v8plusa
 	    SOLARIS_AS_FLAGS = -xarch=v8plusa -K PIC
 	endif
 	ifdef USE_ABI64_INT
 	    # this builds for Sparc v9a pure 64-bit architecture,
 	    # no FPU (non-VIS cpus). For building with SunStudio 10.
  	    SOL_CFLAGS += -xO4 -xtarget=generic
@@ -286,17 +298,17 @@ ifeq ($(CPU_ARCH),sparc)
 	    SOLARIS_AS_FLAGS = -xarch=v9 -K PIC
 	endif
 	ifdef USE_ABI64_FPU
 	    # this builds for Sparc v9a pure 64-bit architecture
 	    # It uses floating point, and 32-bit word size.
 	    # See comment for USE_ABI32_FPU.
 	    SOL_CFLAGS += -D__MATHERR_ERRNO_DONTCARE -fns -fsimple=2 -fsingle
 	    SOL_CFLAGS += -xalias_level=basic -xbuiltin=%all
-	    SOL_CFLAGS += -xcache=64/32/4:1024/64/4 -xchip=ultra3 -xdepend
+	    SOL_CFLAGS += $(FPU_TARGET_OPTIMIZER) -xdepend
 	    SOL_CFLAGS += -xlibmil -xmemalign=8s -xO5
 	    ARCHFLAG = -xarch=v9a
 	    SOLARIS_AS_FLAGS = -xarch=v9a -K PIC
 	endif
     endif # NS_USE_GCC
 
     ### set flags for both GCC and Sun cc
     ifdef USE_ABI32_INT32