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 #@ 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 ###################################################################### |
(...skipping 25 matching lines...) Expand all Loading... |
36 readonly NACL_ROOT="$(GetAbsolutePath ..)" | 36 readonly NACL_ROOT="$(GetAbsolutePath ..)" |
37 readonly SCONS_OUT="${NACL_ROOT}/scons-out" | 37 readonly SCONS_OUT="${NACL_ROOT}/scons-out" |
38 | 38 |
39 SetScriptPath "${PNACL_ROOT}/build.sh" | 39 SetScriptPath "${PNACL_ROOT}/build.sh" |
40 SetLogDirectory "${PNACL_ROOT}/build/log" | 40 SetLogDirectory "${PNACL_ROOT}/build/log" |
41 | 41 |
42 # For different levels of make parallelism change this in your env | 42 # For different levels of make parallelism change this in your env |
43 readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8} | 43 readonly PNACL_CONCURRENCY=${PNACL_CONCURRENCY:-8} |
44 PNACL_PRUNE=${PNACL_PRUNE:-false} | 44 PNACL_PRUNE=${PNACL_PRUNE:-false} |
45 PNACL_BUILD_ARM=true | 45 PNACL_BUILD_ARM=true |
| 46 PNACL_BUILD_MIPS=true |
46 | 47 |
47 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then | 48 if ${BUILD_PLATFORM_MAC} || ${BUILD_PLATFORM_WIN}; then |
48 # We don't yet support building ARM tools for mac or windows. | 49 # We don't yet support building ARM tools for mac or windows. |
49 PNACL_BUILD_ARM=false | 50 PNACL_BUILD_ARM=false |
| 51 PNACL_BUILD_MIPS=true |
50 fi | 52 fi |
51 | 53 |
52 readonly SB_JIT=${SB_JIT:-false} | 54 readonly SB_JIT=${SB_JIT:-false} |
53 | 55 |
54 # TODO(pdox): Decide what the target should really permanently be | 56 # TODO(pdox): Decide what the target should really permanently be |
55 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi | 57 readonly CROSS_TARGET_ARM=arm-none-linux-gnueabi |
56 readonly BINUTILS_TARGET=arm-pc-nacl | 58 readonly BINUTILS_TARGET=arm-pc-nacl |
57 readonly REAL_CROSS_TARGET=le32-unknown-nacl | 59 readonly REAL_CROSS_TARGET=le32-unknown-nacl |
58 readonly NACL64_TARGET=x86_64-nacl | 60 readonly NACL64_TARGET=x86_64-nacl |
59 | 61 |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 # Bitcode lib directories (including static bitcode libs and .pso stubs) | 137 # Bitcode lib directories (including static bitcode libs and .pso stubs) |
136 readonly INSTALL_LIB_NEWLIB="${INSTALL_NEWLIB}/lib" | 138 readonly INSTALL_LIB_NEWLIB="${INSTALL_NEWLIB}/lib" |
137 readonly INSTALL_LIB_GLIBC="${INSTALL_GLIBC}/lib" | 139 readonly INSTALL_LIB_GLIBC="${INSTALL_GLIBC}/lib" |
138 | 140 |
139 # Native nacl lib directories | 141 # Native nacl lib directories |
140 # The pattern `${INSTALL_LIB_NATIVE}${arch}' is used in many places. | 142 # The pattern `${INSTALL_LIB_NATIVE}${arch}' is used in many places. |
141 readonly INSTALL_LIB_NATIVE="${INSTALL_ROOT}/lib-" | 143 readonly INSTALL_LIB_NATIVE="${INSTALL_ROOT}/lib-" |
142 readonly INSTALL_LIB_ARM="${INSTALL_LIB_NATIVE}arm" | 144 readonly INSTALL_LIB_ARM="${INSTALL_LIB_NATIVE}arm" |
143 readonly INSTALL_LIB_X8632="${INSTALL_LIB_NATIVE}x86-32" | 145 readonly INSTALL_LIB_X8632="${INSTALL_LIB_NATIVE}x86-32" |
144 readonly INSTALL_LIB_X8664="${INSTALL_LIB_NATIVE}x86-64" | 146 readonly INSTALL_LIB_X8664="${INSTALL_LIB_NATIVE}x86-64" |
| 147 readonly INSTALL_LIB_MIPS32="${INSTALL_LIB_NATIVE}mips32" |
145 | 148 |
146 # PNaCl client-translators (sandboxed) binary locations | 149 # PNaCl client-translators (sandboxed) binary locations |
147 readonly INSTALL_TRANSLATOR="${TOOLCHAIN_ROOT}/pnacl_translator" | 150 readonly INSTALL_TRANSLATOR="${TOOLCHAIN_ROOT}/pnacl_translator" |
148 | 151 |
149 | 152 |
150 # The INSTALL_HOST directory has host binaries and libs which | 153 # The INSTALL_HOST directory has host binaries and libs which |
151 # are part of the toolchain (e.g. llvm and binutils). | 154 # are part of the toolchain (e.g. llvm and binutils). |
152 # There are also tools-x86 and tools-arm which have host binaries which | 155 # There are also tools-x86 and tools-arm which have host binaries which |
153 # are not part of the toolchain but might be useful in the SDK, e.g. | 156 # are not part of the toolchain but might be useful in the SDK, e.g. |
154 # arm sel_ldr and x86-hosted arm/mips validators. | 157 # arm sel_ldr and x86-hosted arm/mips validators. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 # separately, one for each architecture, so that each translator | 237 # separately, one for each architecture, so that each translator |
235 # can only target its own architecture. | 238 # can only target its own architecture. |
236 # | 239 # |
237 # If SBTC_PRODUCTION is false, then we instead use PNaCl to | 240 # If SBTC_PRODUCTION is false, then we instead use PNaCl to |
238 # build a `fat` translator which can target all supported | 241 # build a `fat` translator which can target all supported |
239 # architectures. This translator is built as a .pexe | 242 # architectures. This translator is built as a .pexe |
240 # which can then be translated to each individual architecture. | 243 # which can then be translated to each individual architecture. |
241 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} | 244 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} |
242 | 245 |
243 # Which toolchain to use for each arch. | 246 # Which toolchain to use for each arch. |
244 SBTC_BUILD_WITH_PNACL="armv7 i686 x86_64" | 247 SBTC_BUILD_WITH_PNACL="armv7 mips32 i686 x86_64" |
245 | 248 |
246 # Current milestones in each repo | 249 # Current milestones in each repo |
247 | 250 |
248 readonly BINUTILS_REV=95a4e0cd6450 | 251 readonly BINUTILS_REV=95a4e0cd6450 |
249 readonly GOLD_REV=5d1c8d6e094d | 252 readonly GOLD_REV=5d1c8d6e094d |
250 | 253 |
251 # Repositories | 254 # Repositories |
252 readonly REPO_BINUTILS="nacl-llvm-branches.binutils" | 255 readonly REPO_BINUTILS="nacl-llvm-branches.binutils" |
253 # NOTE: this is essentially another binutils repo but a much more | 256 # NOTE: this is essentially another binutils repo but a much more |
254 # recent revision to pull in all the latest gold changes | 257 # recent revision to pull in all the latest gold changes |
(...skipping 1521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 rm -rf "${INSTALL_ROOT}/tools-arm" | 1779 rm -rf "${INSTALL_ROOT}/tools-arm" |
1777 mkdir "${INSTALL_ROOT}/tools-arm" | 1780 mkdir "${INSTALL_ROOT}/tools-arm" |
1778 local sconsdir="${SCONS_OUT}/opt-${SCONS_BUILD_PLATFORM}-arm" | 1781 local sconsdir="${SCONS_OUT}/opt-${SCONS_BUILD_PLATFORM}-arm" |
1779 cp "${sconsdir}/obj/src/trusted/service_runtime/sel_ldr" \ | 1782 cp "${sconsdir}/obj/src/trusted/service_runtime/sel_ldr" \ |
1780 "${INSTALL_ROOT}/tools-arm" | 1783 "${INSTALL_ROOT}/tools-arm" |
1781 spopd | 1784 spopd |
1782 else | 1785 else |
1783 StepBanner "MISC-TOOLS" "Skipping arm sel_ldr (No trusted arm toolchain)" | 1786 StepBanner "MISC-TOOLS" "Skipping arm sel_ldr (No trusted arm toolchain)" |
1784 fi | 1787 fi |
1785 | 1788 |
| 1789 if ${PNACL_BUILD_MIPS} ; then |
| 1790 StepBanner "MISC-TOOLS" "Building sel_ldr (mips32)" |
| 1791 # TODO(petarj): revisit some of these options, remove werror when ready |
| 1792 spushd "${NACL_ROOT}" |
| 1793 RunWithLog mips32_sel_ldr \ |
| 1794 ./scons MODE=opt-host \ |
| 1795 platform=mips32 \ |
| 1796 naclsdk_validate=0 \ |
| 1797 sysinfo=0 \ |
| 1798 werror=0 \ |
| 1799 sel_ldr |
| 1800 rm -rf "${INSTALL_ROOT}/tools-mips32" |
| 1801 mkdir "${INSTALL_ROOT}/tools-mips32" |
| 1802 local sconsdir="scons-out/opt-${SCONS_BUILD_PLATFORM}-mips32" |
| 1803 cp "${sconsdir}/obj/src/trusted/service_runtime/sel_ldr" \ |
| 1804 "${INSTALL_ROOT}/tools-mips32" |
| 1805 spopd |
| 1806 else |
| 1807 StepBanner "MISC-TOOLS" "Skipping mips sel_ldr (No trusted mips32 toolchain)
" |
| 1808 fi |
| 1809 |
1786 if ${BUILD_PLATFORM_LINUX} ; then | 1810 if ${BUILD_PLATFORM_LINUX} ; then |
1787 rm -rf "${INSTALL_ROOT}/tools-x86" | 1811 rm -rf "${INSTALL_ROOT}/tools-x86" |
1788 mkdir "${INSTALL_ROOT}/tools-x86" | 1812 mkdir "${INSTALL_ROOT}/tools-x86" |
1789 for target in arm mips; do | 1813 for target in arm mips; do |
1790 build-validator $target | 1814 build-validator $target |
1791 done | 1815 done |
1792 else | 1816 else |
1793 for target in arm mips; do | 1817 for target in arm mips; do |
1794 StepBanner "MISC-"${target} "Skipping " ${target} " validator (Not yet sup
ported on Mac)" | 1818 StepBanner "MISC-"${target} "Skipping " ${target} " validator (Not yet sup
ported on Mac)" |
1795 done | 1819 done |
(...skipping 2090 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3886 #Usage | 3910 #Usage |
3887 echo "ERROR: unknown function '$1'." >&2 | 3911 echo "ERROR: unknown function '$1'." >&2 |
3888 echo "For help, try:" | 3912 echo "For help, try:" |
3889 echo " $0 help" | 3913 echo " $0 help" |
3890 exit 1 | 3914 exit 1 |
3891 fi | 3915 fi |
3892 | 3916 |
3893 hg-migrate | 3917 hg-migrate |
3894 | 3918 |
3895 "$@" | 3919 "$@" |
OLD | NEW |