| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 #@ Untrusted Toolchain Manager | 6 #@ Untrusted Toolchain Manager |
| 7 #@------------------------------------------------------------------- | 7 #@------------------------------------------------------------------- |
| 8 #@ This script builds the ARM and PNaCl untrusted toolchains. | 8 #@ This script builds the ARM and PNaCl untrusted toolchains. |
| 9 #@ It MUST be run from the native_client/ directory. | 9 #@ It MUST be run from the native_client/ directory. |
| 10 # | 10 # |
| 11 ###################################################################### | 11 ###################################################################### |
| 12 # Directory Layout Description | 12 # Directory Layout Description |
| 13 ###################################################################### | 13 ###################################################################### |
| 14 # | 14 # |
| 15 # All directories are relative to BASE which is | 15 # All directories are relative to BASE which is |
| 16 # On Linux X86-64: native_client/toolchain/pnacl_linux_x86_64/ | 16 # On Linux X86-64: native_client/toolchain/pnacl_linux_x86_64/ |
| 17 # On Linux X86-32: native_client/toolchain/pnacl_linux_i686/ | 17 # On Linux X86-32: native_client/toolchain/pnacl_linux_i686/ |
| 18 # On Mac X86-32 : native_client/toolchain/pnacl_darwin_i386/ | 18 # On Mac X86-32 : native_client/toolchain/pnacl_darwin_i386/ |
| 19 # | 19 # |
| 20 ###################################################################### | 20 ###################################################################### |
| 21 # Config | 21 # Config |
| 22 ###################################################################### | 22 ###################################################################### |
| 23 | 23 |
| 24 set -o nounset | 24 set -o nounset |
| 25 set -o errexit | 25 set -o errexit |
| 26 | 26 |
| 27 # The script is located in "native_client/tools/llvm". | 27 # The script is located in "native_client/pnacl". |
| 28 # Set pwd to native_client/ | 28 # Set pwd to native_client/ |
| 29 cd "$(dirname "$0")"/../.. | 29 cd "$(dirname "$0")"/.. |
| 30 if [[ $(basename "$(pwd)") != "native_client" ]] ; then | 30 if [[ $(basename "$(pwd)") != "native_client" ]] ; then |
| 31 echo "ERROR: cannot find native_client/ directory" | 31 echo "ERROR: cannot find native_client/ directory" |
| 32 exit -1 | 32 exit -1 |
| 33 fi | 33 fi |
| 34 |
| 35 source pnacl/scripts/common-tools.sh |
| 36 |
| 34 readonly NACL_ROOT="$(pwd)" | 37 readonly NACL_ROOT="$(pwd)" |
| 35 | 38 |
| 36 source tools/llvm/common-tools.sh | 39 SetScriptPath "${NACL_ROOT}/pnacl/build.sh" |
| 37 | |
| 38 SetScriptPath "${NACL_ROOT}/tools/llvm/utman.sh" | |
| 39 SetLogDirectory "${NACL_ROOT}/toolchain/hg-log" | 40 SetLogDirectory "${NACL_ROOT}/toolchain/hg-log" |
| 40 | 41 |
| 41 # NOTE: gcc and llvm have to be synchronized | 42 # NOTE: gcc and llvm have to be synchronized |
| 42 # we have chosen toolchains which both are based on gcc-4.2.1 | 43 # we have chosen toolchains which both are based on gcc-4.2.1 |
| 43 | 44 |
| 44 # For different levels of make parallelism change this in your env | 45 # For different levels of make parallelism change this in your env |
| 45 readonly UTMAN_CONCURRENCY=${UTMAN_CONCURRENCY:-8} | 46 readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8} |
| 46 readonly UTMAN_MERGE_TESTING=${UTMAN_MERGE_TESTING:-false} | 47 readonly PNACL_MERGE_TESTING=${PNACL_MERGE_TESTING:-false} |
| 47 UTMAN_PRUNE=${UTMAN_PRUNE:-false} | 48 PNACL_PRUNE=${PNACL_PRUNE:-false} |
| 48 UTMAN_BUILD_ARM=true | 49 PNACL_BUILD_ARM=true |
| 49 | 50 |
| 50 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then | 51 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then |
| 51 # We don't yet support building ARM tools for mac or windows. | 52 # We don't yet support building ARM tools for mac or windows. |
| 52 UTMAN_BUILD_ARM=false | 53 PNACL_BUILD_ARM=false |
| 53 fi | 54 fi |
| 54 | 55 |
| 55 # Set the library mode | 56 # Set the library mode |
| 56 readonly LIBMODE=${LIBMODE:-newlib} | 57 readonly LIBMODE=${LIBMODE:-newlib} |
| 57 | 58 |
| 58 LIBMODE_NEWLIB=false | 59 LIBMODE_NEWLIB=false |
| 59 LIBMODE_GLIBC=false | 60 LIBMODE_GLIBC=false |
| 60 if [ ${LIBMODE} == "newlib" ]; then | 61 if [ ${LIBMODE} == "newlib" ]; then |
| 61 LIBMODE_NEWLIB=true | 62 LIBMODE_NEWLIB=true |
| 62 elif [ ${LIBMODE} == "glibc" ]; then | 63 elif [ ${LIBMODE} == "glibc" ]; then |
| 63 LIBMODE_GLIBC=true | 64 LIBMODE_GLIBC=true |
| 64 UTMAN_BUILD_ARM=false | 65 PNACL_BUILD_ARM=false |
| 65 else | 66 else |
| 66 Fatal "Unknown library mode ${LIBMODE}" | 67 Fatal "Unknown library mode ${LIBMODE}" |
| 67 fi | 68 fi |
| 68 readonly LIBMODE_NEWLIB | 69 readonly LIBMODE_NEWLIB |
| 69 readonly LIBMODE_GLIBC | 70 readonly LIBMODE_GLIBC |
| 70 | 71 |
| 71 readonly SB_JIT=${SB_JIT:-false} | 72 readonly SB_JIT=${SB_JIT:-false} |
| 72 | 73 |
| 73 # TODO(pdox): Decide what the target should really permanently be | 74 # TODO(pdox): Decide what the target should really permanently be |
| 74 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi | 75 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi |
| 75 readonly BINUTILS_TARGET=arm-pc-nacl | 76 readonly BINUTILS_TARGET=arm-pc-nacl |
| 76 readonly REAL_CROSS_TARGET=pnacl | 77 readonly REAL_CROSS_TARGET=pnacl |
| 77 readonly NACL64_TARGET=x86_64-nacl | 78 readonly NACL64_TARGET=x86_64-nacl |
| 78 | 79 |
| 79 readonly DRIVER_DIR="${NACL_ROOT}/pnacl/driver" | 80 readonly DRIVER_DIR="${NACL_ROOT}/pnacl/driver" |
| 80 readonly ARM_ARCH=armv7-a | 81 readonly ARM_ARCH=armv7-a |
| 81 readonly ARM_FPU=vfp | 82 readonly ARM_FPU=vfp |
| 82 | 83 |
| 83 | 84 |
| 84 readonly NNACL_BASE="${NACL_ROOT}/toolchain/${SCONS_BUILD_PLATFORM}_x86" | 85 readonly NNACL_BASE="${NACL_ROOT}/toolchain/${SCONS_BUILD_PLATFORM}_x86" |
| 85 readonly NNACL_NEWLIB_ROOT="${NNACL_BASE}_newlib" | 86 readonly NNACL_NEWLIB_ROOT="${NNACL_BASE}_newlib" |
| 86 readonly NNACL_GLIBC_ROOT="${NNACL_BASE}" | 87 readonly NNACL_GLIBC_ROOT="${NNACL_BASE}" |
| 87 | 88 |
| 88 readonly MAKE_OPTS="-j${UTMAN_CONCURRENCY} VERBOSE=1" | 89 readonly MAKE_OPTS="-j${PNACL_CONCURRENCY} VERBOSE=1" |
| 89 | 90 |
| 90 readonly NONEXISTENT_PATH="/going/down/the/longest/road/to/nowhere" | 91 readonly NONEXISTENT_PATH="/going/down/the/longest/road/to/nowhere" |
| 91 | 92 |
| 92 # For speculative build status output. ( see status function ) | 93 # For speculative build status output. ( see status function ) |
| 93 # Leave this blank, it will be filled during processing. | 94 # Leave this blank, it will be filled during processing. |
| 94 SPECULATIVE_REBUILD_SET="" | 95 SPECULATIVE_REBUILD_SET="" |
| 95 | 96 |
| 96 readonly PNACL_ROOT="${NACL_ROOT}/pnacl" | 97 readonly PNACL_ROOT="${NACL_ROOT}/pnacl" |
| 97 readonly PNACL_SUPPORT="${PNACL_ROOT}/support" | 98 readonly PNACL_SUPPORT="${PNACL_ROOT}/support" |
| 98 | 99 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 " " \ | 437 " " \ |
| 437 " hg/${name} needs to be updated to the stable revision " \ | 438 " hg/${name} needs to be updated to the stable revision " \ |
| 438 " but has local modifications. " \ | 439 " but has local modifications. " \ |
| 439 " " \ | 440 " " \ |
| 440 " If your repository is behind stable, update it using: " \ | 441 " If your repository is behind stable, update it using: " \ |
| 441 " " \ | 442 " " \ |
| 442 " cd hg/${name}; hg update ${rev} " \ | 443 " cd hg/${name}; hg update ${rev} " \ |
| 443 " (you may need to resolve conflicts) " \ | 444 " (you may need to resolve conflicts) " \ |
| 444 " " \ | 445 " " \ |
| 445 " If your repository is ahead of stable, then modify: " \ | 446 " If your repository is ahead of stable, then modify: " \ |
| 446 " ${defstr}_REV (in tools/llvm/utman.sh) " \ | 447 " ${defstr}_REV (in pnacl/build.sh) " \ |
| 447 " to suppress this error message. " | 448 " to suppress this error message. " |
| 448 exit -1 | 449 exit -1 |
| 449 } | 450 } |
| 450 | 451 |
| 451 svn-assert-safe-to-update() { | 452 svn-assert-safe-to-update() { |
| 452 local name="$1" | 453 local name="$1" |
| 453 local dir="$2" | 454 local dir="$2" |
| 454 local rev="$3" | 455 local rev="$3" |
| 455 local defstr=$(echo "${name}" | tr '[a-z]-' '[A-Z]_') | 456 local defstr=$(echo "${name}" | tr '[a-z]-' '[A-Z]_') |
| 456 | 457 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 467 " " \ | 468 " " \ |
| 468 " hg/${name} needs to be updated to the stable revision " \ | 469 " hg/${name} needs to be updated to the stable revision " \ |
| 469 " but has local modifications. " \ | 470 " but has local modifications. " \ |
| 470 " " \ | 471 " " \ |
| 471 " If your repository is behind stable, update it using: " \ | 472 " If your repository is behind stable, update it using: " \ |
| 472 " " \ | 473 " " \ |
| 473 " cd hg/${name}; svn update -r ${rev} " \ | 474 " cd hg/${name}; svn update -r ${rev} " \ |
| 474 " (you may need to resolve conflicts) " \ | 475 " (you may need to resolve conflicts) " \ |
| 475 " " \ | 476 " " \ |
| 476 " If your repository is ahead of stable, then modify: " \ | 477 " If your repository is ahead of stable, then modify: " \ |
| 477 " ${defstr}_REV (in tools/llvm/utman.sh) " \ | 478 " ${defstr}_REV (in pnacl/build.sh) " \ |
| 478 " to suppress this error message. " | 479 " to suppress this error message. " |
| 479 exit -1 | 480 exit -1 |
| 480 } | 481 } |
| 481 | 482 |
| 482 hg-bot-sanity() { | 483 hg-bot-sanity() { |
| 483 local name="$1" | 484 local name="$1" |
| 484 local dir="$2" | 485 local dir="$2" |
| 485 | 486 |
| 486 if ! ${UTMAN_BUILDBOT} ; then | 487 if ! ${PNACL_BUILDBOT} ; then |
| 487 return 0 | 488 return 0 |
| 488 fi | 489 fi |
| 489 | 490 |
| 490 if ! hg-on-branch "${dir}" pnacl-sfi || | 491 if ! hg-on-branch "${dir}" pnacl-sfi || |
| 491 hg-has-changes "${dir}" || | 492 hg-has-changes "${dir}" || |
| 492 hg-has-untracked "${dir}" ; then | 493 hg-has-untracked "${dir}" ; then |
| 493 Banner "WARNING: hg/${name} is in an illegal state." \ | 494 Banner "WARNING: hg/${name} is in an illegal state." \ |
| 494 " Wiping and trying again." | 495 " Wiping and trying again." |
| 495 rm -rf "${dir}" | 496 rm -rf "${dir}" |
| 496 hg-checkout-${name} | 497 hg-checkout-${name} |
| 497 fi | 498 fi |
| 498 } | 499 } |
| 499 | 500 |
| 500 svn-bot-sanity() { | 501 svn-bot-sanity() { |
| 501 local name="$1" | 502 local name="$1" |
| 502 local dir="$2" | 503 local dir="$2" |
| 503 | 504 |
| 504 if ! ${UTMAN_BUILDBOT} ; then | 505 if ! ${PNACL_BUILDBOT} ; then |
| 505 return 0 | 506 return 0 |
| 506 fi | 507 fi |
| 507 | 508 |
| 508 if svn-has-changes "${dir}" ; then | 509 if svn-has-changes "${dir}" ; then |
| 509 Banner "WARNING: hg/${name} is in an illegal state." \ | 510 Banner "WARNING: hg/${name} is in an illegal state." \ |
| 510 " Wiping and trying again." | 511 " Wiping and trying again." |
| 511 rm -rf "${dir}" | 512 rm -rf "${dir}" |
| 512 svn-checkout-${name} | 513 svn-checkout-${name} |
| 513 fi | 514 fi |
| 514 } | 515 } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 if svn-at-revision "${dir}" "${rev}" ; then | 550 if svn-at-revision "${dir}" "${rev}" ; then |
| 550 StepBanner "SVN-UPDATE" "Repo ${name} already at ${rev}" | 551 StepBanner "SVN-UPDATE" "Repo ${name} already at ${rev}" |
| 551 else | 552 else |
| 552 StepBanner "SVN-UPDATE" "Updating ${name} to ${rev}" | 553 StepBanner "SVN-UPDATE" "Updating ${name} to ${rev}" |
| 553 svn-update "${dir}" ${rev} | 554 svn-update "${dir}" ${rev} |
| 554 fi | 555 fi |
| 555 } | 556 } |
| 556 | 557 |
| 557 hg-update-upstream() { | 558 hg-update-upstream() { |
| 558 llvm-unlink-clang | 559 llvm-unlink-clang |
| 559 if ! ${UTMAN_MERGE_TESTING} ; then | 560 if ! ${PNACL_MERGE_TESTING} ; then |
| 560 hg-update-common "upstream" ${UPSTREAM_REV} "${TC_SRC_UPSTREAM}" | 561 hg-update-common "upstream" ${UPSTREAM_REV} "${TC_SRC_UPSTREAM}" |
| 561 fi | 562 fi |
| 562 llvm-link-clang | 563 llvm-link-clang |
| 563 } | 564 } |
| 564 | 565 |
| 565 svn-update-llvm-master() { | 566 svn-update-llvm-master() { |
| 566 svn-update-common "llvm-master" ${LLVM_MASTER_REV} "${TC_SRC_LLVM_MASTER}" | 567 svn-update-common "llvm-master" ${LLVM_MASTER_REV} "${TC_SRC_LLVM_MASTER}" |
| 567 } | 568 } |
| 568 | 569 |
| 569 svn-update-llvm-gcc-master() { | 570 svn-update-llvm-gcc-master() { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 svn-checkout-clang | 650 svn-checkout-clang |
| 650 svn-checkout-dragonegg | 651 svn-checkout-dragonegg |
| 651 hg-checkout-binutils | 652 hg-checkout-binutils |
| 652 hg-checkout-newlib | 653 hg-checkout-newlib |
| 653 hg-checkout-compiler-rt | 654 hg-checkout-compiler-rt |
| 654 hg-checkout-google-perftools | 655 hg-checkout-google-perftools |
| 655 git-sync | 656 git-sync |
| 656 } | 657 } |
| 657 | 658 |
| 658 hg-checkout-upstream() { | 659 hg-checkout-upstream() { |
| 659 if ! ${UTMAN_MERGE_TESTING} ; then | 660 if ! ${PNACL_MERGE_TESTING} ; then |
| 660 hg-checkout ${REPO_UPSTREAM} "${TC_SRC_UPSTREAM}" ${UPSTREAM_REV} | 661 hg-checkout ${REPO_UPSTREAM} "${TC_SRC_UPSTREAM}" ${UPSTREAM_REV} |
| 661 fi | 662 fi |
| 662 llvm-link-clang | 663 llvm-link-clang |
| 663 } | 664 } |
| 664 | 665 |
| 665 svn-checkout-llvm-master() { | 666 svn-checkout-llvm-master() { |
| 666 svn-checkout "${REPO_LLVM_MASTER}" "${TC_SRC_LLVM_MASTER}" ${LLVM_MASTER_REV} | 667 svn-checkout "${REPO_LLVM_MASTER}" "${TC_SRC_LLVM_MASTER}" ${LLVM_MASTER_REV} |
| 667 } | 668 } |
| 668 | 669 |
| 669 svn-checkout-llvm-gcc-master() { | 670 svn-checkout-llvm-gcc-master() { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 #@ everything - Build and install untrusted SDK. no translator | 814 #@ everything - Build and install untrusted SDK. no translator |
| 814 everything() { | 815 everything() { |
| 815 everything-hg | 816 everything-hg |
| 816 | 817 |
| 817 everything-post-hg | 818 everything-post-hg |
| 818 } | 819 } |
| 819 | 820 |
| 820 #@ everything - Checkout everything from the repositories | 821 #@ everything - Checkout everything from the repositories |
| 821 everything-hg() { | 822 everything-hg() { |
| 822 mkdir -p "${INSTALL_ROOT}" | 823 mkdir -p "${INSTALL_ROOT}" |
| 823 if ${UTMAN_IN_CROS_CHROOT}; then | 824 if ${PNACL_IN_CROS_CHROOT}; then |
| 824 # TODO: http://code.google.com/p/nativeclient/issues/detail?id=2295 | 825 # TODO: http://code.google.com/p/nativeclient/issues/detail?id=2295 |
| 825 Banner "You are running in a ChromiumOS Chroot." \ | 826 Banner "You are running in a ChromiumOS Chroot." \ |
| 826 " You should make sure that the PNaCl sources are properly checked out " \ | 827 " You should make sure that the PNaCl sources are properly checked out " \ |
| 827 " And updated outside of the chroot" | 828 " And updated outside of the chroot" |
| 828 else | 829 else |
| 829 checkout-all | 830 checkout-all |
| 830 StepBanner "Updating upstreaming repository" | 831 StepBanner "Updating upstreaming repository" |
| 831 update-all | 832 update-all |
| 832 fi | 833 fi |
| 833 } | 834 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 855 # complete, so that sdk sanity checks don't fail | 856 # complete, so that sdk sanity checks don't fail |
| 856 misc-tools | 857 misc-tools |
| 857 verify | 858 verify |
| 858 } | 859 } |
| 859 | 860 |
| 860 #@ everything-translator - Build and install untrusted SDK AND translator | 861 #@ everything-translator - Build and install untrusted SDK AND translator |
| 861 everything-translator() { | 862 everything-translator() { |
| 862 | 863 |
| 863 everything | 864 everything |
| 864 # Building the sandboxed tools requires the SDK | 865 # Building the sandboxed tools requires the SDK |
| 865 if ${UTMAN_PRUNE}; then | 866 if ${PNACL_PRUNE}; then |
| 866 prune | 867 prune |
| 867 fi | 868 fi |
| 868 sdk | 869 sdk |
| 869 install-translators srpc | 870 install-translators srpc |
| 870 if ${UTMAN_PRUNE}; then | 871 if ${PNACL_PRUNE}; then |
| 871 prune-translator-install srpc | 872 prune-translator-install srpc |
| 872 track-translator-size ${SBTC_BUILD_WITH_PNACL} | 873 track-translator-size ${SBTC_BUILD_WITH_PNACL} |
| 873 fi | 874 fi |
| 874 } | 875 } |
| 875 | 876 |
| 876 glibc() { | 877 glibc() { |
| 877 StepBanner "GLIBC" "Copying glibc from NNaCl toolchain" | 878 StepBanner "GLIBC" "Copying glibc from NNaCl toolchain" |
| 878 | 879 |
| 879 mkdir -p "${INSTALL_LIB_X8632}" | 880 mkdir -p "${INSTALL_LIB_X8632}" |
| 880 mkdir -p "${INSTALL_LIB_X8664}" | 881 mkdir -p "${INSTALL_LIB_X8664}" |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1055 echo "Error: untrusted_sdk needs a tarball name." >&2 | 1056 echo "Error: untrusted_sdk needs a tarball name." >&2 |
| 1056 exit 1 | 1057 exit 1 |
| 1057 fi | 1058 fi |
| 1058 | 1059 |
| 1059 clean | 1060 clean |
| 1060 everything-translator | 1061 everything-translator |
| 1061 | 1062 |
| 1062 # Remove the SDK so it doesn't end up in the tarball | 1063 # Remove the SDK so it doesn't end up in the tarball |
| 1063 sdk-clean | 1064 sdk-clean |
| 1064 | 1065 |
| 1065 if ${UTMAN_PRUNE}; then | 1066 if ${PNACL_PRUNE}; then |
| 1066 prune | 1067 prune |
| 1067 fi | 1068 fi |
| 1068 tarball $1 | 1069 tarball $1 |
| 1069 } | 1070 } |
| 1070 | 1071 |
| 1071 #+ prune - Prune toolchain | 1072 #+ prune - Prune toolchain |
| 1072 prune() { | 1073 prune() { |
| 1073 StepBanner "PRUNE" "Pruning toolchain" | 1074 StepBanner "PRUNE" "Pruning toolchain" |
| 1074 # ACCEPTABLE_SIZE should be much lower for real release, | 1075 # ACCEPTABLE_SIZE should be much lower for real release, |
| 1075 # but we are currently doing a debug build and not pruning | 1076 # but we are currently doing a debug build and not pruning |
| (...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 local src="${TC_SRC_COMPILER_RT}/compiler-rt/lib" | 1862 local src="${TC_SRC_COMPILER_RT}/compiler-rt/lib" |
| 1862 mkdir -p "${TC_BUILD_COMPILER_RT}" | 1863 mkdir -p "${TC_BUILD_COMPILER_RT}" |
| 1863 spushd "${TC_BUILD_COMPILER_RT}" | 1864 spushd "${TC_BUILD_COMPILER_RT}" |
| 1864 StepBanner "COMPILER-RT (LIBGCC)" | 1865 StepBanner "COMPILER-RT (LIBGCC)" |
| 1865 for arch in arm x86-32 x86-64; do | 1866 for arch in arm x86-32 x86-64; do |
| 1866 StepBanner "compiler rt" "build ${arch}" | 1867 StepBanner "compiler rt" "build ${arch}" |
| 1867 rm -rf "${arch}" | 1868 rm -rf "${arch}" |
| 1868 mkdir -p "${arch}" | 1869 mkdir -p "${arch}" |
| 1869 spushd "${arch}" | 1870 spushd "${arch}" |
| 1870 RunWithLog libgcc.${arch}.make \ | 1871 RunWithLog libgcc.${arch}.make \ |
| 1871 make -j ${UTMAN_CONCURRENCY} -f ${src}/Makefile-pnacl libgcc.a \ | 1872 make -j ${PNACL_CONCURRENCY} -f ${src}/Makefile-pnacl libgcc.a \ |
| 1872 CC="${PNACL_CC}" \ | 1873 CC="${PNACL_CC}" \ |
| 1873 AR="${PNACL_AR}" \ | 1874 AR="${PNACL_AR}" \ |
| 1874 "SRC_DIR=${src}" \ | 1875 "SRC_DIR=${src}" \ |
| 1875 "CFLAGS=-arch ${arch} --pnacl-allow-translate -O3 -fPIC" | 1876 "CFLAGS=-arch ${arch} --pnacl-allow-translate -O3 -fPIC" |
| 1876 spopd | 1877 spopd |
| 1877 done | 1878 done |
| 1878 | 1879 |
| 1879 StepBanner "compiler rt" "install all" | 1880 StepBanner "compiler rt" "install all" |
| 1880 ls -l */libgcc.a | 1881 ls -l */libgcc.a |
| 1881 | 1882 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2009 | 2010 |
| 2010 # Install bitcode library | 2011 # Install bitcode library |
| 2011 mkdir -p "${INSTALL_LIB}" | 2012 mkdir -p "${INSTALL_LIB}" |
| 2012 cp "${objdir}/src/.libs/libstdc++.a" "${INSTALL_LIB}" | 2013 cp "${objdir}/src/.libs/libstdc++.a" "${INSTALL_LIB}" |
| 2013 | 2014 |
| 2014 spopd | 2015 spopd |
| 2015 } | 2016 } |
| 2016 | 2017 |
| 2017 #+ misc-tools - Build and install sel_ldr and validator for ARM. | 2018 #+ misc-tools - Build and install sel_ldr and validator for ARM. |
| 2018 misc-tools() { | 2019 misc-tools() { |
| 2019 if ${UTMAN_BUILD_ARM} ; then | 2020 if ${PNACL_BUILD_ARM} ; then |
| 2020 StepBanner "MISC-ARM" "Building sel_ldr (ARM)" | 2021 StepBanner "MISC-ARM" "Building sel_ldr (ARM)" |
| 2021 | 2022 |
| 2022 # TODO(robertm): revisit some of these options | 2023 # TODO(robertm): revisit some of these options |
| 2023 RunWithLog arm_sel_ldr \ | 2024 RunWithLog arm_sel_ldr \ |
| 2024 ./scons MODE=opt-host \ | 2025 ./scons MODE=opt-host \ |
| 2025 platform=arm \ | 2026 platform=arm \ |
| 2026 sdl=none \ | 2027 sdl=none \ |
| 2027 naclsdk_validate=0 \ | 2028 naclsdk_validate=0 \ |
| 2028 sysinfo=0 \ | 2029 sysinfo=0 \ |
| 2029 sel_ldr | 2030 sel_ldr |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 spopd | 2633 spopd |
| 2633 } | 2634 } |
| 2634 | 2635 |
| 2635 #+ google-perftools-make - Make tcmalloc-minimal in bitcode | 2636 #+ google-perftools-make - Make tcmalloc-minimal in bitcode |
| 2636 google-perftools-make() { | 2637 google-perftools-make() { |
| 2637 local objdir="${TC_BUILD_GOOGLE_PERFTOOLS}" | 2638 local objdir="${TC_BUILD_GOOGLE_PERFTOOLS}" |
| 2638 spushd "${objdir}" | 2639 spushd "${objdir}" |
| 2639 StepBanner "GOOGLE-PERFTOOLS" "Make" | 2640 StepBanner "GOOGLE-PERFTOOLS" "Make" |
| 2640 ts-touch-open "${objdir}" | 2641 ts-touch-open "${objdir}" |
| 2641 RunWithLog google-perftools.make \ | 2642 RunWithLog google-perftools.make \ |
| 2642 make -j ${UTMAN_CONCURRENCY} | 2643 make -j ${PNACL_CONCURRENCY} |
| 2643 ts-touch-commit "${objdir}" | 2644 ts-touch-commit "${objdir}" |
| 2644 spopd | 2645 spopd |
| 2645 } | 2646 } |
| 2646 | 2647 |
| 2647 #+ google-perftools-install - Install libtcmalloc_minimal.a into toolchain | 2648 #+ google-perftools-install - Install libtcmalloc_minimal.a into toolchain |
| 2648 google-perftools-install() { | 2649 google-perftools-install() { |
| 2649 StepBanner "GOOGLE-PERFTOOLS" "Install" | 2650 StepBanner "GOOGLE-PERFTOOLS" "Install" |
| 2650 spushd "${TC_BUILD_GOOGLE_PERFTOOLS}" | 2651 spushd "${TC_BUILD_GOOGLE_PERFTOOLS}" |
| 2651 RunWithLog google-perftools.install \ | 2652 RunWithLog google-perftools.install \ |
| 2652 make install | 2653 make install |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3162 | 3163 |
| 3163 ${PNACL_AR} rc "${dest}"/libcrt_platform.a ${objs} | 3164 ${PNACL_AR} rc "${dest}"/libcrt_platform.a ${objs} |
| 3164 done | 3165 done |
| 3165 } | 3166 } |
| 3166 | 3167 |
| 3167 ######################################################################### | 3168 ######################################################################### |
| 3168 # < SDK > | 3169 # < SDK > |
| 3169 ######################################################################### | 3170 ######################################################################### |
| 3170 SCONS_COMMON=(./scons | 3171 SCONS_COMMON=(./scons |
| 3171 MODE=nacl | 3172 MODE=nacl |
| 3172 -j${UTMAN_CONCURRENCY} | 3173 -j${PNACL_CONCURRENCY} |
| 3173 bitcode=1 | 3174 bitcode=1 |
| 3174 sdl=none | 3175 sdl=none |
| 3175 disable_nosys_linker_warnings=1 | 3176 disable_nosys_linker_warnings=1 |
| 3176 naclsdk_validate=0 | 3177 naclsdk_validate=0 |
| 3177 --verbose) | 3178 --verbose) |
| 3178 | 3179 |
| 3179 sdk() { | 3180 sdk() { |
| 3180 StepBanner "SDK" | 3181 StepBanner "SDK" |
| 3181 sdk-clean | 3182 sdk-clean |
| 3182 sdk-headers | 3183 sdk-headers |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3307 echo "" | 3308 echo "" |
| 3308 echo "*******************************************************************" | 3309 echo "*******************************************************************" |
| 3309 echo "* ERROR *" | 3310 echo "* ERROR *" |
| 3310 echo "* The NewLib include directory has local modifications *" | 3311 echo "* The NewLib include directory has local modifications *" |
| 3311 echo "*******************************************************************" | 3312 echo "*******************************************************************" |
| 3312 echo "* The NewLib include directory should not be modified directly. *" | 3313 echo "* The NewLib include directory should not be modified directly. *" |
| 3313 echo "* Instead, modifications should be done from: *" | 3314 echo "* Instead, modifications should be done from: *" |
| 3314 echo "* src/trusted/service_runtime/include *" | 3315 echo "* src/trusted/service_runtime/include *" |
| 3315 echo "* *" | 3316 echo "* *" |
| 3316 echo "* To destroy the local changes to newlib, run: *" | 3317 echo "* To destroy the local changes to newlib, run: *" |
| 3317 echo "* tools/llvm/utman.sh newlib-nacl-headers-clean *" | 3318 echo "* pnacl/build.sh newlib-nacl-headers-clean *" |
| 3318 echo "*******************************************************************" | 3319 echo "*******************************************************************" |
| 3319 echo "" | 3320 echo "" |
| 3320 if ${UTMAN_BUILDBOT} ; then | 3321 if ${PNACL_BUILDBOT} ; then |
| 3321 newlib-nacl-headers-clean | 3322 newlib-nacl-headers-clean |
| 3322 else | 3323 else |
| 3323 exit -1 | 3324 exit -1 |
| 3324 fi | 3325 fi |
| 3325 fi | 3326 fi |
| 3326 } | 3327 } |
| 3327 | 3328 |
| 3328 #+------------------------------------------------------------------------- | 3329 #+------------------------------------------------------------------------- |
| 3329 #+ driver - Install driver scripts. | 3330 #+ driver - Install driver scripts. |
| 3330 driver() { | 3331 driver() { |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3703 # | 3704 # |
| 3704 # UTILITIES | 3705 # UTILITIES |
| 3705 # | 3706 # |
| 3706 ###################################################################### | 3707 ###################################################################### |
| 3707 ###################################################################### | 3708 ###################################################################### |
| 3708 | 3709 |
| 3709 #@------------------------------------------------------------------------- | 3710 #@------------------------------------------------------------------------- |
| 3710 #@ show-config | 3711 #@ show-config |
| 3711 show-config() { | 3712 show-config() { |
| 3712 Banner "Config Settings:" | 3713 Banner "Config Settings:" |
| 3713 echo "UTMAN_BUILDBOT: ${UTMAN_BUILDBOT}" | 3714 echo "PNACL_BUILDBOT: ${PNACL_BUILDBOT}" |
| 3714 echo "UTMAN_CONCURRENCY: ${UTMAN_CONCURRENCY}" | 3715 echo "PNACL_CONCURRENCY: ${PNACL_CONCURRENCY}" |
| 3715 echo "UTMAN_DEBUG: ${UTMAN_DEBUG}" | 3716 echo "PNACL_DEBUG: ${PNACL_DEBUG}" |
| 3716 echo "UTMAN_PRUNE: ${UTMAN_PRUNE}" | 3717 echo "PNACL_PRUNE: ${PNACL_PRUNE}" |
| 3717 echo "UTMAN_VERBOSE: ${UTMAN_VERBOSE}" | 3718 echo "PNACL_VERBOSE: ${PNACL_VERBOSE}" |
| 3718 echo "LIBMODE: ${LIBMODE}" | 3719 echo "LIBMODE: ${LIBMODE}" |
| 3719 Banner "Your Environment:" | 3720 Banner "Your Environment:" |
| 3720 env | grep UTMAN | 3721 env | grep PNACL |
| 3721 } | 3722 } |
| 3722 | 3723 |
| 3723 #@ help - Usage information. | 3724 #@ help - Usage information. |
| 3724 help() { | 3725 help() { |
| 3725 Usage | 3726 Usage |
| 3726 } | 3727 } |
| 3727 | 3728 |
| 3728 #@ help-full - Usage information including internal functions. | 3729 #@ help-full - Usage information including internal functions. |
| 3729 help-full() { | 3730 help-full() { |
| 3730 Usage2 | 3731 Usage2 |
| 3731 } | 3732 } |
| 3732 | 3733 |
| 3733 has-trusted-toolchain() { | 3734 has-trusted-toolchain() { |
| 3734 if [ -f toolchain/linux_arm-trusted/ld_script_arm_trusted ]; then | 3735 if [ -f ${NACL_ROOT}/toolchain/linux_arm-trusted/ld_script_arm_trusted ]; then |
| 3735 return 0 | 3736 return 0 |
| 3736 else | 3737 else |
| 3737 return 1 | 3738 return 1 |
| 3738 fi | 3739 fi |
| 3739 } | 3740 } |
| 3740 | 3741 |
| 3741 check-for-trusted() { | 3742 check-for-trusted() { |
| 3742 if ! ${UTMAN_BUILD_ARM} ; then | 3743 if ! ${PNACL_BUILD_ARM} ; then |
| 3743 return | 3744 return |
| 3744 fi | 3745 fi |
| 3745 | 3746 |
| 3746 if ! has-trusted-toolchain; then | 3747 if ! has-trusted-toolchain; then |
| 3747 echo '*******************************************************************' | 3748 echo '*******************************************************************' |
| 3748 echo '* The ARM trusted toolchain does not appear to be installed yet *' | 3749 echo '* The ARM trusted toolchain does not appear to be installed yet *' |
| 3749 echo '* It is needed to run ARM tests. *' | 3750 echo '* It is needed to run ARM tests. *' |
| 3750 echo '* *' | 3751 echo '* *' |
| 3751 echo '* To download and install the trusted toolchain, run: *' | 3752 echo '* To download and install the trusted toolchain, run: *' |
| 3752 echo '* *' | 3753 echo '* *' |
| 3753 echo '* $ tools/llvm/utman.sh download-trusted *' | 3754 echo '* $ pnacl/build.sh download-trusted *' |
| 3754 echo '* *' | 3755 echo '* *' |
| 3755 echo '* To compile the trusted toolchain, use: *' | 3756 echo '* To compile the trusted toolchain, use: *' |
| 3756 echo '* *' | 3757 echo '* *' |
| 3757 echo '* $ tools/llvm/trusted-toolchain-creator.sh trusted_sdk *' | 3758 echo '* $ tools/llvm/trusted-toolchain-creator.sh trusted_sdk *' |
| 3758 echo '* (warning: this takes a while) *' | 3759 echo '* (warning: this takes a while) *' |
| 3759 echo '*******************************************************************' | 3760 echo '*******************************************************************' |
| 3760 | 3761 |
| 3761 # If building on the bots, do not continue since it needs to run ARM tests. | 3762 # If building on the bots, do not continue since it needs to run ARM tests. |
| 3762 if ${UTMAN_BUILDBOT} ; then | 3763 if ${PNACL_BUILDBOT} ; then |
| 3763 echo "Building on bots --> need ARM trusted toolchain to run tests!" | 3764 echo "Building on bots --> need ARM trusted toolchain to run tests!" |
| 3764 exit -1 | 3765 exit -1 |
| 3765 elif trusted-tc-confirm ; then | 3766 elif trusted-tc-confirm ; then |
| 3766 echo "Continuing without ARM trusted toolchain" | 3767 echo "Continuing without ARM trusted toolchain" |
| 3767 UTMAN_BUILD_ARM=false | 3768 PNACL_BUILD_ARM=false |
| 3768 else | 3769 else |
| 3769 echo "Okay, stopping." | 3770 echo "Okay, stopping." |
| 3770 exit -1 | 3771 exit -1 |
| 3771 fi | 3772 fi |
| 3772 fi | 3773 fi |
| 3773 } | 3774 } |
| 3774 | 3775 |
| 3775 trusted-tc-confirm() { | 3776 trusted-tc-confirm() { |
| 3776 echo | 3777 echo |
| 3777 echo "Do you wish to continue without the ARM trusted TC (skip ARM testing)?" | 3778 echo "Do you wish to continue without the ARM trusted TC (skip ARM testing)?" |
| 3778 echo "" | 3779 echo "" |
| 3779 confirm-yes "Continue" | 3780 confirm-yes "Continue" |
| 3780 return $? | 3781 return $? |
| 3781 } | 3782 } |
| 3782 | 3783 |
| 3783 DebugRun() { | 3784 DebugRun() { |
| 3784 if ${UTMAN_DEBUG} || ${UTMAN_BUILDBOT}; then | 3785 if ${PNACL_DEBUG} || ${PNACL_BUILDBOT}; then |
| 3785 "$@" | 3786 "$@" |
| 3786 fi | 3787 fi |
| 3787 } | 3788 } |
| 3788 | 3789 |
| 3789 ###################################################################### | 3790 ###################################################################### |
| 3790 # Generate chromium perf bot logs for tracking the size of | 3791 # Generate chromium perf bot logs for tracking the size of |
| 3791 # translator binaries. | 3792 # translator binaries. |
| 3792 | 3793 |
| 3793 track-translator-size() { | 3794 track-translator-size() { |
| 3794 local platforms="$@" | 3795 local platforms="$@" |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3933 | 3934 |
| 3934 if [ "$(type -t $1)" != "function" ]; then | 3935 if [ "$(type -t $1)" != "function" ]; then |
| 3935 #Usage | 3936 #Usage |
| 3936 echo "ERROR: unknown function '$1'." >&2 | 3937 echo "ERROR: unknown function '$1'." >&2 |
| 3937 echo "For help, try:" | 3938 echo "For help, try:" |
| 3938 echo " $0 help" | 3939 echo " $0 help" |
| 3939 exit 1 | 3940 exit 1 |
| 3940 fi | 3941 fi |
| 3941 | 3942 |
| 3942 "$@" | 3943 "$@" |
| OLD | NEW |