Bug 1057783 - Add support for little-endian powerpc64, r=kaie
☠☠ backed out by ea4cee936403 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 05 Sep 2014 12:00:14 +0200
changeset 11242 cad641b1475d6731ce7a224be5be28791fea38e7
parent 11241 7ee8791bd370350cbf418ca7c5ac9dd5db2e60de
child 11243 ea4cee936403fc959eb04f14efc6de34f23df6be
push id473
push userkaie@kuix.de
push dateFri, 05 Sep 2014 10:01:55 +0000
reviewerskaie
bugs1057783
Bug 1057783 - Add support for little-endian powerpc64, r=kaie
coreconf/Linux.mk
coreconf/ruleset.mk
manifest.mn
tests/all.sh
tests/cert/cert.sh
tests/common/init.sh
tests/dbupgrade/dbupgrade.sh
--- a/coreconf/Linux.mk
+++ b/coreconf/Linux.mk
@@ -37,17 +37,17 @@ endif
 ifndef INTERNAL_TOOLS
 	CC = $(ANDROID_CC) --sysroot=$(ANDROID_SYSROOT)
 	DEFAULT_COMPILER=$(ANDROID_PREFIX)-gcc
 	ARCHFLAG = --sysroot=$(ANDROID_SYSROOT)
 	DEFINES += -DNO_SYSINFO -DNO_FORK_CHECK -DANDROID
 	CROSS_COMPILE = 1
 endif
 endif
-ifeq ($(OS_TEST),ppc64)
+ifeq (,$(filter-out ppc64 ppc64le,$(OS_TEST)))
 	CPU_ARCH	= ppc
 ifeq ($(USE_64),1)
 	ARCHFLAG	= -m64
 endif
 else
 ifeq ($(OS_TEST),alpha)
         OS_REL_CFLAGS   = -D_ALPHA_
 	CPU_ARCH	= alpha
--- a/coreconf/ruleset.mk
+++ b/coreconf/ruleset.mk
@@ -107,21 +107,25 @@ endif
 ifdef PROGRAMS
     PROGRAMS := $(addprefix $(OBJDIR)/, $(PROGRAMS:%=%$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX)))
 endif
 
 ifndef TARGETS
     TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM)
 endif
 
+# Make both .cpp and .cc work.
+CPPSRCS1 = $(CPPSRCS:.cpp=$(OBJ_SUFFIX))
+CPPSRCS2 = $(CPPSRCS1:.cc=$(OBJ_SUFFIX))
+
 ifndef OBJS
     SIMPLE_OBJS = $(JRI_STUB_CFILES) \
 		$(addsuffix $(OBJ_SUFFIX), $(JMC_GEN)) \
 		$(CSRCS:.c=$(OBJ_SUFFIX)) \
-		$(CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
+		$(CPPSRCS2) \
 		$(ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX)) \
 		$(BUILT_CSRCS:.c=$(OBJ_SUFFIX)) \
 		$(BUILT_CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
 		$(BUILT_ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX))
     OBJS =	$(addprefix $(OBJDIR)/$(PROG_PREFIX), $(SIMPLE_OBJS))
 endif
 
 ifndef BUILT_SRCS
--- a/manifest.mn
+++ b/manifest.mn
@@ -6,8 +6,12 @@ CORE_DEPTH = .
 DEPTH      = .
 
 IMPORTS =	nspr20/v4.8 \
 		$(NULL)
 
 RELEASE = nss
 
 DIRS = coreconf lib cmd
+
+ifdef NSS_BUILD_GTESTS
+DIRS += gtests
+endif
--- a/tests/all.sh
+++ b/tests/all.sh
@@ -30,16 +30,17 @@
 #   ssl.sh       - tests SSL V2 SSL V3 and TLS
 #   ocsp.sh      - OCSP testing
 #   merge.sh     - tests merging old and new shareable databases
 #   pkits.sh     - NIST/PKITS tests 
 #   chains.sh    - PKIX cert chains tests 
 #   dbupgrade.sh - upgrade databases to new shareable version (used
 #                  only in upgrade test cycle)
 #   memleak.sh   - memory leak testing (optional)
+#   ssl_gtests.sh- Gtest based unit tests for ssl (optional)
 #
 # NSS testing is now devided to 4 cycles:
 # ---------------------------------------
 #   standard     - run test suites with defaults settings
 #   pkix         - run test suites with PKIX enabled
 #   upgradedb    - upgrade existing certificate databases to shareable 
 #                  format (creates them if doesn't exist yet) and run 
 #                  test suites with those databases
--- a/tests/cert/cert.sh
+++ b/tests/cert/cert.sh
@@ -940,16 +940,46 @@ cert_ssl()
   fi
 
   echo "$SCRIPTNAME: Creating database for OCSP stapling tests  ==============="
   echo "cp -r ${SERVERDIR} ${STAPLINGDIR}"
   cp -r ${R_SERVERDIR} ${R_STAPLINGDIR}
   pk12u -o ${R_STAPLINGDIR}/ca.p12 -n TestCA -k ${R_PWFILE} -w ${R_PWFILE} -d ${R_CADIR}
   pk12u -i ${R_STAPLINGDIR}/ca.p12 -k ${R_PWFILE} -w ${R_PWFILE} -d ${R_STAPLINGDIR}
 }
+
+############################# ssl_gtest ##########################
+# local shell function to create serve certs for SSL gtests
+##################################################################
+cert_ssl_gtests()
+{
+  CERTFAILED=0
+  echo "$SCRIPTNAME: Creating ssl_gtest DB dir"
+  cert_init_cert ${SSLGTESTDIR} "server" 1 ${D_EXT_SERVER}
+  echo "$SCRIPTNAME: Creating database for ssl_gtests"
+  certu -N -d "${SSLGTESTDIR}" --empty-password 2>&1
+  # the ssl server used here is special: is a self-signed server
+  # certificate with name server.
+  echo "$SCRIPTNAME: Creating server cert for ssl_gtests"
+  certu -S -z ${R_NOISE_FILE} -g 2048 -d ${SSLGTESTDIR} -n server -s "CN=server" -t C,C,C -x -m 1 -w -2 -v 120 -Z SHA256 -1 -2 <<CERTSCRIPT
+0
+2
+9
+n
+n
+
+n
+CERTSCRIPT
+
+  if [ "$RET" -ne 0 ]; then
+     echo "return value is $RET"
+     Exit 6 "Fatal - failed to create server cert for ssl_gtests"
+  fi
+}
+
 ############################## cert_stresscerts ################################
 # local shell function to create client certs for SSL stresstest
 ########################################################################
 cert_stresscerts()
 {
 
   ############### Creating Certs for SSL stress test #######################
   #
@@ -1697,16 +1727,17 @@ cert_cleanup()
 }
 
 ################## main #################################################
 
 cert_init 
 cert_all_CA
 cert_extended_ssl 
 cert_ssl 
+cert_ssl_gtests
 cert_smime_client        
 if [ -z "$NSS_TEST_DISABLE_FIPS" ]; then
     cert_fips
 fi
 cert_eccurves
 cert_extensions
 cert_san_and_generic_extensions
 cert_test_password
--- a/tests/common/init.sh
+++ b/tests/common/init.sh
@@ -71,16 +71,17 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOU
 
         IOPR_CADIR=${HOSTDIR}/CA_iopr
         IOPR_SSL_SERVERDIR=${HOSTDIR}/server_ssl_iopr
         IOPR_SSL_CLIENTDIR=${HOSTDIR}/client_ssl_iopr
         IOPR_OCSP_CLIENTDIR=${HOSTDIR}/client_ocsp_iopr
 
         CERT_EXTENSIONS_DIR=${HOSTDIR}/cert_extensions
         STAPLINGDIR=${HOSTDIR}/stapling
+        SSLGTESTDIR=${HOSTDIR}/ssl_gtests
 
         PWFILE=${HOSTDIR}/tests.pw
         NOISE_FILE=${HOSTDIR}/tests_noise
         CORELIST_FILE=${HOSTDIR}/clist
 
         FIPSPWFILE=${HOSTDIR}/tests.fipspw
         FIPSBADPWFILE=${HOSTDIR}/tests.fipsbadpw
         FIPSP12PWFILE=${HOSTDIR}/tests.fipsp12pw
@@ -533,16 +534,17 @@ if [ -z "${INIT_SOURCED}" -o "${INIT_SOU
     R_ALICEDIR=../alicedir
     R_BOBDIR=../bobdir
     R_DAVEDIR=../dave
     R_EVEDIR=../eve
     R_EXT_SERVERDIR=../ext_server
     R_EXT_CLIENTDIR=../ext_client
     R_CERT_EXT=../cert_extensions
     R_STAPLINGDIR=../stapling
+    R_SSLGTESTDIR=../ssl_gtests
 
     #
     # profiles are either paths or domains depending on the setting of
     # MULTIACCESS_DBM
     #
     P_R_CADIR=${R_CADIR}
     P_R_ALICEDIR=${R_ALICEDIR}
     P_R_BOBDIR=${R_BOBDIR}
--- a/tests/dbupgrade/dbupgrade.sh
+++ b/tests/dbupgrade/dbupgrade.sh
@@ -58,17 +58,17 @@ dbupgrade_main()
 	${BINDIR}/certutil -D -n objsigner -d alicedir 2>&1
 	${BINDIR}/certutil -M -n FIPS_PUB_140_Test_Certificate -t "C,C,C" -d fips -f ${FIPSPWFILE} 2>&1
 	${BINDIR}/certutil -L -d fips 2>&1
 	rm -f smime/alicehello.env
 	
 	# test upgrade to the new database
 	echo "nss" > ${PWFILE}
 	html_head "Legacy to shared Library update"
-	dirs="alicedir bobdir CA cert_extensions client clientCA dave eccurves eve ext_client ext_server SDR server serverCA stapling tools/copydir"
+	dirs="alicedir bobdir CA cert_extensions client clientCA dave eccurves eve ext_client ext_server SDR server serverCA ssl_gtests stapling tools/copydir"
 	for i in $dirs
 	do
 		echo $i
 		if [ -d $i ]; then
 			echo "upgrading db $i"
 			${BINDIR}/certutil -G -g 512 -d sql:$i -f ${PWFILE} -z ${NOISE_FILE} 2>&1
 			html_msg $? 0 "Upgrading $i"
 		else