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 | |
Mark Seaborn
2012/09/18 03:24:34
Since PNaCl toolchain-build changes aren't covered
petarj
2012/09/19 17:27:51
Removed. I will file a separate CL for this right
| |
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 | |
Mark Seaborn
2012/09/18 03:24:34
Did you mean 'false' here? If not, this is unnece
petarj
2012/09/19 17:27:51
Done.
| |
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 # Bitcode lib directories (including static bitcode libs and .pso stubs) | 138 # Bitcode lib directories (including static bitcode libs and .pso stubs) |
137 readonly INSTALL_LIB_NEWLIB="${INSTALL_NEWLIB}/lib" | 139 readonly INSTALL_LIB_NEWLIB="${INSTALL_NEWLIB}/lib" |
138 readonly INSTALL_LIB_GLIBC="${INSTALL_GLIBC}/lib" | 140 readonly INSTALL_LIB_GLIBC="${INSTALL_GLIBC}/lib" |
139 | 141 |
140 # Native nacl lib directories | 142 # Native nacl lib directories |
141 # The pattern `${INSTALL_LIB_NATIVE}${arch}' is used in many places. | 143 # The pattern `${INSTALL_LIB_NATIVE}${arch}' is used in many places. |
142 readonly INSTALL_LIB_NATIVE="${INSTALL_ROOT}/lib-" | 144 readonly INSTALL_LIB_NATIVE="${INSTALL_ROOT}/lib-" |
143 readonly INSTALL_LIB_ARM="${INSTALL_LIB_NATIVE}arm" | 145 readonly INSTALL_LIB_ARM="${INSTALL_LIB_NATIVE}arm" |
144 readonly INSTALL_LIB_X8632="${INSTALL_LIB_NATIVE}x86-32" | 146 readonly INSTALL_LIB_X8632="${INSTALL_LIB_NATIVE}x86-32" |
145 readonly INSTALL_LIB_X8664="${INSTALL_LIB_NATIVE}x86-64" | 147 readonly INSTALL_LIB_X8664="${INSTALL_LIB_NATIVE}x86-64" |
148 readonly INSTALL_LIB_MIPS32="${INSTALL_LIB_NATIVE}mips32" | |
146 | 149 |
147 # PNaCl client-translators (sandboxed) binary locations | 150 # PNaCl client-translators (sandboxed) binary locations |
148 readonly INSTALL_TRANSLATOR="${TOOLCHAIN_ROOT}/pnacl_translator" | 151 readonly INSTALL_TRANSLATOR="${TOOLCHAIN_ROOT}/pnacl_translator" |
149 | 152 |
150 | 153 |
151 # The INSTALL_HOST directory has host binaries and libs which | 154 # The INSTALL_HOST directory has host binaries and libs which |
152 # are part of the toolchain (e.g. llvm and binutils). | 155 # are part of the toolchain (e.g. llvm and binutils). |
153 # There are also tools-x86 and tools-arm which have host binaries which | 156 # There are also tools-x86 and tools-arm which have host binaries which |
154 # are not part of the toolchain but might be useful in the SDK, e.g. | 157 # are not part of the toolchain but might be useful in the SDK, e.g. |
155 # arm sel_ldr and x86-hosted arm/mips validators. | 158 # arm sel_ldr and x86-hosted arm/mips validators. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
235 # separately, one for each architecture, so that each translator | 238 # separately, one for each architecture, so that each translator |
236 # can only target its own architecture. | 239 # can only target its own architecture. |
237 # | 240 # |
238 # If SBTC_PRODUCTION is false, then we instead use PNaCl to | 241 # If SBTC_PRODUCTION is false, then we instead use PNaCl to |
239 # build a `fat` translator which can target all supported | 242 # build a `fat` translator which can target all supported |
240 # architectures. This translator is built as a .pexe | 243 # architectures. This translator is built as a .pexe |
241 # which can then be translated to each individual architecture. | 244 # which can then be translated to each individual architecture. |
242 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} | 245 SBTC_PRODUCTION=${SBTC_PRODUCTION:-false} |
243 | 246 |
244 # Which toolchain to use for each arch. | 247 # Which toolchain to use for each arch. |
245 SBTC_BUILD_WITH_PNACL="armv7 i686 x86_64" | 248 SBTC_BUILD_WITH_PNACL="armv7 mips32 i686 x86_64" |
246 | 249 |
247 # Current milestones in each repo | 250 # Current milestones in each repo |
248 | 251 |
249 readonly BINUTILS_REV=95a4e0cd6450 | 252 readonly BINUTILS_REV=95a4e0cd6450 |
250 readonly GOLD_REV=5d1c8d6e094d | 253 readonly GOLD_REV=5d1c8d6e094d |
251 | 254 |
252 # Repositories | 255 # Repositories |
253 readonly REPO_BINUTILS="nacl-llvm-branches.binutils" | 256 readonly REPO_BINUTILS="nacl-llvm-branches.binutils" |
254 # NOTE: this is essentially another binutils repo but a much more | 257 # NOTE: this is essentially another binutils repo but a much more |
255 # recent revision to pull in all the latest gold changes | 258 # recent revision to pull in all the latest gold changes |
(...skipping 1520 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 2046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3842 #Usage | 3866 #Usage |
3843 echo "ERROR: unknown function '$1'." >&2 | 3867 echo "ERROR: unknown function '$1'." >&2 |
3844 echo "For help, try:" | 3868 echo "For help, try:" |
3845 echo " $0 help" | 3869 echo " $0 help" |
3846 exit 1 | 3870 exit 1 |
3847 fi | 3871 fi |
3848 | 3872 |
3849 hg-migrate | 3873 hg-migrate |
3850 | 3874 |
3851 "$@" | 3875 "$@" |
OLD | NEW |