| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 # Run toolchain torture tests and llvm testsuite tests. | 6 # Run toolchain torture tests and llvm testsuite tests. |
| 7 # For now, run on linux64, build and run unsandboxed newlib tests | 7 # For now, run on linux64, build and run unsandboxed newlib tests |
| 8 # for all 3 architectures. | 8 # for all 3 architectures. |
| 9 # Note: This script builds the toolchain from scratch but does | 9 # Note: This script builds the toolchain from scratch but does |
| 10 # not build the translators and hence the translators | 10 # not build the translators and hence the translators |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 # by uncommenting below: | 50 # by uncommenting below: |
| 51 # export BUILD_ARCH="x86_32" | 51 # export BUILD_ARCH="x86_32" |
| 52 # export HOST_ARCH="x86_32" | 52 # export HOST_ARCH="x86_32" |
| 53 # TODO(pnacl-team): Figure out what to do about this. | 53 # TODO(pnacl-team): Figure out what to do about this. |
| 54 # Export this so that the test scripts know where to find the toolchain. | 54 # Export this so that the test scripts know where to find the toolchain. |
| 55 export TOOLCHAIN_BASE_DIR=linux_x86 | 55 export TOOLCHAIN_BASE_DIR=linux_x86 |
| 56 export PNACL_TOOLCHAIN_DIR=${TOOLCHAIN_BASE_DIR}/pnacl_newlib | 56 export PNACL_TOOLCHAIN_DIR=${TOOLCHAIN_BASE_DIR}/pnacl_newlib |
| 57 export PNACL_TOOLCHAIN_LABEL=pnacl_linux_x86 | 57 export PNACL_TOOLCHAIN_LABEL=pnacl_linux_x86 |
| 58 # This picks the TC which we just built, even if scons doesn't know | 58 # This picks the TC which we just built, even if scons doesn't know |
| 59 # how to find a 64-bit host toolchain. | 59 # how to find a 64-bit host toolchain. |
| 60 readonly SCONS_PICK_TC="pnaclsdk_mode=custom:toolchain/${PNACL_TOOLCHAIN_DIR}" | 60 readonly SCONS_PICK_TC="pnacl_newlib_dir=toolchain/${PNACL_TOOLCHAIN_DIR}" |
| 61 | 61 |
| 62 # download-old-tc - | 62 # download-old-tc - |
| 63 # Download the archived frontend toolchain, if we haven't already | 63 # Download the archived frontend toolchain, if we haven't already |
| 64 download-old-tc() { | 64 download-old-tc() { |
| 65 local dst=$1 | 65 local dst=$1 |
| 66 | 66 |
| 67 if [[ -f "${dst}/${ARCHIVED_TOOLCHAIN_REV}.stamp" ]]; then | 67 if [[ -f "${dst}/${ARCHIVED_TOOLCHAIN_REV}.stamp" ]]; then |
| 68 echo "Using existing tarball for archived frontend" | 68 echo "Using existing tarball for archived frontend" |
| 69 else | 69 else |
| 70 mkdir -p "${dst}" | 70 mkdir -p "${dst}" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 # If the correct cached frontend is in place, the hash will match and the | 219 # If the correct cached frontend is in place, the hash will match and the |
| 220 # download will be a no-op. Otherwise the downloader will fix it. | 220 # download will be a no-op. Otherwise the downloader will fix it. |
| 221 download-old-tc toolchain/${TOOLCHAIN_BASE_DIR}/archived_tc | 221 download-old-tc toolchain/${TOOLCHAIN_BASE_DIR}/archived_tc |
| 222 | 222 |
| 223 # Save the current toolchain. | 223 # Save the current toolchain. |
| 224 mkdir -p toolchain/${TOOLCHAIN_BASE_DIR}/current_tc | 224 mkdir -p toolchain/${TOOLCHAIN_BASE_DIR}/current_tc |
| 225 rm -rf toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/* | 225 rm -rf toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/* |
| 226 mv toolchain/${PNACL_TOOLCHAIN_DIR} \ | 226 mv toolchain/${PNACL_TOOLCHAIN_DIR} \ |
| 227 toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/${PNACL_TOOLCHAIN_LABEL} | 227 toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/${PNACL_TOOLCHAIN_LABEL} |
| 228 | 228 |
| 229 # Link the old frontend into place. If we just use pnaclsdk_mode to select a | 229 # Link the old frontend into place. If we select a different toolchain, |
| 230 # different toolchain, SCons will attempt to rebuild the IRT. | 230 # SCons will attempt to rebuild the IRT. |
| 231 ln -s archived_tc/${PNACL_TOOLCHAIN_LABEL} toolchain/${PNACL_TOOLCHAIN_DIR} | 231 ln -s archived_tc/${PNACL_TOOLCHAIN_LABEL} toolchain/${PNACL_TOOLCHAIN_DIR} |
| 232 | 232 |
| 233 # Build the pexes with the old frontend. | 233 # Build the pexes with the old frontend. |
| 234 ${SCONS_COMMON} ${SCONS_PICK_TC} \ | 234 ${SCONS_COMMON} ${SCONS_PICK_TC} \ |
| 235 do_not_run_tests=1 ${flags} ${targets} || handle-error | 235 do_not_run_tests=1 ${flags} ${targets} || handle-error |
| 236 | 236 |
| 237 # Put the current toolchain back in place. | 237 # Put the current toolchain back in place. |
| 238 rm toolchain/${PNACL_TOOLCHAIN_DIR} | 238 rm toolchain/${PNACL_TOOLCHAIN_DIR} |
| 239 mv toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/${PNACL_TOOLCHAIN_LABEL} \ | 239 mv toolchain/${TOOLCHAIN_BASE_DIR}/current_tc/${PNACL_TOOLCHAIN_LABEL} \ |
| 240 toolchain/${PNACL_TOOLCHAIN_DIR} | 240 toolchain/${PNACL_TOOLCHAIN_DIR} |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 done | 363 done |
| 364 } | 364 } |
| 365 | 365 |
| 366 | 366 |
| 367 if [ $# = 0 ]; then | 367 if [ $# = 0 ]; then |
| 368 # NOTE: this is used for manual testing only | 368 # NOTE: this is used for manual testing only |
| 369 tc-test-bot "x86-64 x86-32 arm" | 369 tc-test-bot "x86-64 x86-32 arm" |
| 370 else | 370 else |
| 371 "$@" | 371 "$@" |
| 372 fi | 372 fi |
| OLD | NEW |