| 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 # All directories are relative to BASE which is | 14 # All directories are relative to BASE which is |
| 15 # currently native_client/toolchain/linux_arm-untrusted | 15 # On Linux X86-64: native_client/toolchain/pnacl_linux_x86_64/ |
| 16 # On Linux X86-32: native_client/toolchain/pnacl_linux_i686/ |
| 17 # On Mac X86-32 : native_client/toolchain/pnacl_darwin_i386/ |
| 16 # | 18 # |
| 17 # TODO(robertm): arm layout needs to be described | |
| 18 | |
| 19 # /x86-32sfi-lib [experimental] x86 sandboxed libraries and object files | 19 # /x86-32sfi-lib [experimental] x86 sandboxed libraries and object files |
| 20 # /x86-32sfi-tools [experimental] x86-32 crosstool binaries for building | 20 # /x86-32sfi-tools [experimental] x86-32 crosstool binaries for building |
| 21 # and linking x86-32 nexes | 21 # and linking x86-32 nexes |
| 22 # | 22 # |
| 23 ###################################################################### | 23 ###################################################################### |
| 24 # Config | 24 # Config |
| 25 ###################################################################### | 25 ###################################################################### |
| 26 | 26 |
| 27 set -o nounset | 27 set -o nounset |
| 28 set -o errexit | 28 set -o errexit |
| (...skipping 18 matching lines...) Expand all Loading... |
| 47 UTMAN_BUILD_ARM=false | 47 UTMAN_BUILD_ARM=false |
| 48 fi | 48 fi |
| 49 | 49 |
| 50 # TODO(pdox): Decide what the target should really permanently be | 50 # TODO(pdox): Decide what the target should really permanently be |
| 51 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi | 51 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi |
| 52 readonly CROSS_TARGET_X86_32=i686-none-linux-gnu | 52 readonly CROSS_TARGET_X86_32=i686-none-linux-gnu |
| 53 readonly CROSS_TARGET_X86_64=x86_64-none-linux-gnu | 53 readonly CROSS_TARGET_X86_64=x86_64-none-linux-gnu |
| 54 readonly BINUTILS_TARGET=arm-pc-nacl | 54 readonly BINUTILS_TARGET=arm-pc-nacl |
| 55 readonly REAL_CROSS_TARGET=pnacl | 55 readonly REAL_CROSS_TARGET=pnacl |
| 56 | 56 |
| 57 readonly INSTALL_ROOT="$(pwd)/toolchain/linux_arm-untrusted" | 57 readonly INSTALL_ROOT="$(pwd)/toolchain/pnacl_${BUILD_PLATFORM}_${BUILD_ARCH}" |
| 58 readonly INSTALL_BIN="${INSTALL_ROOT}/bin" | 58 readonly INSTALL_BIN="${INSTALL_ROOT}/bin" |
| 59 readonly ARM_ARCH=armv7-a | 59 readonly ARM_ARCH=armv7-a |
| 60 readonly ARM_FPU=vfp | 60 readonly ARM_FPU=vfp |
| 61 readonly INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET_ARM}" | 61 readonly INSTALL_DIR="${INSTALL_ROOT}/${CROSS_TARGET_ARM}" |
| 62 readonly LDSCRIPTS_DIR="${INSTALL_ROOT}/ldscripts" | 62 readonly LDSCRIPTS_DIR="${INSTALL_ROOT}/ldscripts" |
| 63 readonly GCC_VER="4.2.1" | 63 readonly GCC_VER="4.2.1" |
| 64 | 64 |
| 65 # NOTE: NEWLIB_INSTALL_DIR also server as a SYSROOT | 65 # NOTE: NEWLIB_INSTALL_DIR also server as a SYSROOT |
| 66 readonly NEWLIB_INSTALL_DIR="${INSTALL_ROOT}/arm-newlib" | 66 readonly NEWLIB_INSTALL_DIR="${INSTALL_ROOT}/arm-newlib" |
| 67 | 67 |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 528 echo " Please delete it if you don't need it" | 528 echo " Please delete it if you don't need it" |
| 529 exit -1 | 529 exit -1 |
| 530 fi | 530 fi |
| 531 | 531 |
| 532 if [ -d "${installdir}" ]; then | 532 if [ -d "${installdir}" ]; then |
| 533 mv "${installdir}" "${tmpdir}" | 533 mv "${installdir}" "${tmpdir}" |
| 534 fi | 534 fi |
| 535 | 535 |
| 536 download-toolchains | 536 download-toolchains |
| 537 | 537 |
| 538 mv "${installdir}" "${dldir}" | 538 if [ -d "${installdir}" ]; then |
| 539 mv "${installdir}" "${dldir}" |
| 540 fi |
| 541 |
| 539 if [ -d "${tmpdir}" ]; then | 542 if [ -d "${tmpdir}" ]; then |
| 540 mv "${tmpdir}" "${installdir}" | 543 mv "${tmpdir}" "${installdir}" |
| 541 fi | 544 fi |
| 542 } | 545 } |
| 543 | 546 |
| 544 #@------------------------------------------------------------------------- | 547 #@------------------------------------------------------------------------- |
| 545 | 548 |
| 546 #@ download-toolchains - Download and Install all SDKs (arm,x86-32,x86-64) | 549 #@ download-toolchains - Download and Install all SDKs (arm,x86-32,x86-64) |
| 547 | 550 |
| 548 download-toolchains() { | 551 download-toolchains() { |
| (...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1371 # TODO(robertm): revisit some of these options | 1374 # TODO(robertm): revisit some of these options |
| 1372 RunWithLog arm_sel_ldr \ | 1375 RunWithLog arm_sel_ldr \ |
| 1373 ./scons MODE=opt-host \ | 1376 ./scons MODE=opt-host \ |
| 1374 platform=arm \ | 1377 platform=arm \ |
| 1375 sdl=none \ | 1378 sdl=none \ |
| 1376 naclsdk_validate=0 \ | 1379 naclsdk_validate=0 \ |
| 1377 sysinfo=0 \ | 1380 sysinfo=0 \ |
| 1378 sel_ldr | 1381 sel_ldr |
| 1379 rm -rf "${INSTALL_ROOT}/tools-arm" | 1382 rm -rf "${INSTALL_ROOT}/tools-arm" |
| 1380 mkdir "${INSTALL_ROOT}/tools-arm" | 1383 mkdir "${INSTALL_ROOT}/tools-arm" |
| 1381 local sconsdir="scons-out/opt-${BUILD_PLATFORM}-arm" | 1384 local sconsdir="scons-out/opt-${SCONS_BUILD_PLATFORM}-arm" |
| 1382 cp "${sconsdir}/obj/src/trusted/service_runtime/sel_ldr" \ | 1385 cp "${sconsdir}/obj/src/trusted/service_runtime/sel_ldr" \ |
| 1383 "${INSTALL_ROOT}/tools-arm" | 1386 "${INSTALL_ROOT}/tools-arm" |
| 1384 else | 1387 else |
| 1385 StepBanner "MISC-ARM" "Skipping ARM sel_ldr (No trusted ARM toolchain)" | 1388 StepBanner "MISC-ARM" "Skipping ARM sel_ldr (No trusted ARM toolchain)" |
| 1386 fi | 1389 fi |
| 1387 | 1390 |
| 1388 if ${BUILD_PLATFORM_LINUX} ; then | 1391 if ${BUILD_PLATFORM_LINUX} ; then |
| 1389 StepBanner "MISC-ARM" "Building validator (ARM)" | 1392 StepBanner "MISC-ARM" "Building validator (ARM)" |
| 1390 RunWithLog arm_ncval_core \ | 1393 RunWithLog arm_ncval_core \ |
| 1391 ./scons MODE=opt-host \ | 1394 ./scons MODE=opt-host \ |
| (...skipping 1852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3244 [ $# = 0 ] && set -- help # Avoid reference to undefined $1. | 3247 [ $# = 0 ] && set -- help # Avoid reference to undefined $1. |
| 3245 if [ "$(type -t $1)" != "function" ]; then | 3248 if [ "$(type -t $1)" != "function" ]; then |
| 3246 #Usage | 3249 #Usage |
| 3247 echo "ERROR: unknown function '$1'." >&2 | 3250 echo "ERROR: unknown function '$1'." >&2 |
| 3248 echo "For help, try:" | 3251 echo "For help, try:" |
| 3249 echo " $0 help" | 3252 echo " $0 help" |
| 3250 exit 1 | 3253 exit 1 |
| 3251 fi | 3254 fi |
| 3252 | 3255 |
| 3253 "$@" | 3256 "$@" |
| OLD | NEW |