Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / native_client / buildbot / buildbot_spec2k.sh
index 24a0168..55d8fc7 100755 (executable)
@@ -14,7 +14,7 @@ set -o errexit
 readonly CLOBBER=${CLOBBER:-yes}
 readonly SCONS_TRUSTED="./scons --mode=opt-host -j8"
 readonly SCONS_NACL="./scons --mode=opt-host,nacl -j8"
-readonly SPEC_HARNESS=${SPEC_HARNESS:-${HOME}/cpu2000-redhat64-ia32}/
+readonly SPEC_HARNESS=${SPEC_HARNESS:-$(pwd)/out/cpu2000}/
 
 readonly TRYBOT_TESTS="176.gcc 179.art 181.mcf 197.parser 252.eon 254.gap"
 readonly TRYBOT_X86_64_ZERO_BASED_SANDBOX_TESTS="176.gcc"
@@ -34,7 +34,7 @@ readonly QEMU_TOOL="$(pwd)/toolchain/linux_x86/arm_trusted/run_under_qemu_arm"
 
 # Note: the tool for updating the canned nexes lives at:
 #        tools/canned_nexe_tool.sh
-readonly CANNED_NEXE_REV=1001
+readonly CANNED_NEXE_REV=1002
 
 # If true, terminate script when first error is encountered.
 readonly FAIL_FAST=${FAIL_FAST:-false}
@@ -64,12 +64,31 @@ handle-error() {
 # SCRIPT ACTION
 ######################################################################
 
-clobber() {
+clobber-scons() {
   if [ "${CLOBBER}" == "yes" ] ; then
     rm -rf scons-out
   fi
 }
 
+clobber-harness() {
+  if [ "${CLOBBER}" == "yes" ] ; then
+    rm -rf out
+  fi
+}
+
+clobber() {
+  clobber-scons
+  clobber-harness
+}
+
+download-spec2k-harness() {
+  echo "@@@BUILD_STEP Download spec2k harness@@@"
+  mkdir -p out
+  ${NATIVE_PYTHON} ${GSUTIL} cp -a public-read \
+    gs://nativeclient-private/cpu2000.tar.bz2 out/cpu2000.tar.bz2
+  tar xvj -C out -f out/cpu2000.tar.bz2
+}
+
 # Make up for the toolchain tarballs not quite being a full SDK
 # Also clean the SPEC dir (that step is here because it should
 # not be run on hw bots which download rather than build binaries)
@@ -163,7 +182,7 @@ download-validator-test-nexes() {
       "${arch}_giant" giant_nexe.tar.bz2
   # This generates "CannedNexes/" in the current directory
   rm -rf CannedNexes
-  tar jxf  giant_nexe.tar.bz2
+  tar jxf giant_nexe.tar.bz2
 }
 
 get-validator() {
@@ -245,6 +264,7 @@ measure-validator-speed() {
 
 pnacl-trybot-arm-buildonly() {
   clobber
+  download-spec2k-harness
   build-prerequisites "arm" "bitcode" "arm-ncval-core"
   ${BUILDBOT_PNACL} archive-for-hw-bots "${NAME_ARM_TRY_UPLOAD}" try
   build-tests SetupPnaclPexeOpt "${TRYBOT_TESTS}" 0 1
@@ -271,6 +291,7 @@ pnacl-trybot-arm-hw() {
 
 pnacl-trybot-x8632() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-32" "bitcode"
   build-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 1 1
   run-tests SetupPnaclX8632Opt "${TRYBOT_TESTS}" 1 1
@@ -288,7 +309,11 @@ pnacl-trybot-x8632() {
 }
 
 pnacl-x86-64-zero-based-sandbox() {
-  clobber
+  # Clobber scons and rebuild sel_ldr with zero-based sandbox support.
+  # If sel_ldr was built to a different directory and the test
+  # runner knew where to find that separate sel_ldr, then we wouldn't
+  # need to clobber here.
+  clobber-scons
   export NACL_ENABLE_INSECURE_ZERO_BASED_SANDBOX=1
   build-prerequisites "x86-64" "bitcode" "x86_64_zero_based_sandbox=1"
   build-tests SetupPnaclX8664ZBSOpt \
@@ -299,6 +324,7 @@ pnacl-x86-64-zero-based-sandbox() {
 
 pnacl-trybot-x8664() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-64" "bitcode"
   build-tests SetupPnaclX8664Opt "${TRYBOT_TESTS}" 1 1
   run-tests SetupPnaclX8664Opt "${TRYBOT_TESTS}" 1 1
@@ -318,6 +344,7 @@ pnacl-trybot-x8664() {
 
 pnacl-arm-buildonly() {
   clobber
+  download-spec2k-harness
   build-prerequisites "arm" "bitcode"
   ${BUILDBOT_PNACL} archive-for-hw-bots "${NAME_ARM_UPLOAD}" regular
   build-tests SetupPnaclPexeOpt all 0 1
@@ -346,6 +373,7 @@ pnacl-arm-hw() {
 
 pnacl-x8664() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-64" "bitcode"
   local setups="SetupPnaclX8664Opt \
                SetupPnaclTranslatorX8664Opt \
@@ -362,6 +390,7 @@ pnacl-x8664() {
 
 pnacl-x8632() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-32" "bitcode"
   local setups="SetupPnaclX8632Opt \
                 SetupPnaclTranslatorX8632Opt \
@@ -377,6 +406,7 @@ pnacl-x8632() {
 
 nacl-x8632() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-32" ""
   local setups="SetupNaclX8632 \
                 SetupNaclX8632Opt"
@@ -389,6 +419,7 @@ nacl-x8632() {
 
 nacl-x8664() {
   clobber
+  download-spec2k-harness
   build-prerequisites "x86-64" ""
   local setups="SetupNaclX8664 \
                 SetupNaclX8664Opt"