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 #@ PNaCl toolchain build script | 6 #@ PNaCl toolchain build script |
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 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 297 |
298 # llvm-sb-configure - Configure llvm tools (sandboxed) | 298 # llvm-sb-configure - Configure llvm tools (sandboxed) |
299 llvm-sb-configure() { | 299 llvm-sb-configure() { |
300 local arch=$1 | 300 local arch=$1 |
301 | 301 |
302 StepBanner "LLVM-SB" "Configure ${arch}" | 302 StepBanner "LLVM-SB" "Configure ${arch}" |
303 local srcdir="${TC_SRC_LLVM}" | 303 local srcdir="${TC_SRC_LLVM}" |
304 local objdir="${LLVM_SB_OBJDIR}" | 304 local objdir="${LLVM_SB_OBJDIR}" |
305 local installdir="$(GetTranslatorInstallDir ${arch})" | 305 local installdir="$(GetTranslatorInstallDir ${arch})" |
306 local targets="" | 306 local targets="" |
| 307 local subzero_targets="" |
307 # For LLVM, "x86" brings in both i686 and x86_64. | 308 # For LLVM, "x86" brings in both i686 and x86_64. |
308 case ${arch} in | 309 case ${arch} in |
309 i686) targets=x86 ;; | 310 i686) |
310 x86_64) targets=x86 ;; | 311 targets=x86 |
311 armv7) targets=arm ;; | 312 subzero_targets=X8632 |
312 universal) targets=x86,arm ;; | 313 ;; |
| 314 x86_64) |
| 315 targets=x86 |
| 316 subzero_targets=X8664 |
| 317 ;; |
| 318 armv7) |
| 319 targets=arm |
| 320 subzero_targets=ARM32 |
| 321 ;; |
| 322 universal) |
| 323 targets=x86,arm |
| 324 subzero_targets=X8632,ARM32 |
| 325 ;; |
313 esac | 326 esac |
314 | 327 |
315 spushd "${objdir}" | 328 spushd "${objdir}" |
316 # TODO(jvoung): remove ac_cv_func_getrusage=no once newlib has getrusage | 329 # TODO(jvoung): remove ac_cv_func_getrusage=no once newlib has getrusage |
317 # in its headers. Otherwise, configure thinks that we can link in | 330 # in its headers. Otherwise, configure thinks that we can link in |
318 # getrusage (stub is in libnacl), but we can't actually compile code | 331 # getrusage (stub is in libnacl), but we can't actually compile code |
319 # that uses ::getrusage because it's not in headers: | 332 # that uses ::getrusage because it's not in headers: |
320 # https://code.google.com/p/nativeclient/issues/detail?id=3657 | 333 # https://code.google.com/p/nativeclient/issues/detail?id=3657 |
321 # Similar with getrlimit/setrlimit where struct rlimit isn't defined. | 334 # Similar with getrlimit/setrlimit where struct rlimit isn't defined. |
322 RunWithLog \ | 335 RunWithLog \ |
323 ${LLVM_SB_LOG_PREFIX}.configure \ | 336 ${LLVM_SB_LOG_PREFIX}.configure \ |
324 env -i \ | 337 env -i \ |
325 PATH="/usr/bin:/bin" \ | 338 PATH="/usr/bin:/bin" \ |
326 ${srcdir}/configure \ | 339 ${srcdir}/configure \ |
327 "${LLVM_SB_CONFIGURE_ENV[@]}" \ | 340 "${LLVM_SB_CONFIGURE_ENV[@]}" \ |
328 --prefix=${installdir} \ | 341 --prefix=${installdir} \ |
329 --host=nacl \ | 342 --host=nacl \ |
330 --enable-targets=${targets} \ | 343 --enable-targets=${targets} \ |
| 344 --enable-subzero-targets=${subzero_targets} \ |
331 --disable-assertions \ | 345 --disable-assertions \ |
332 --enable-pic=no \ | 346 --enable-pic=no \ |
333 --enable-static \ | 347 --enable-static \ |
334 --enable-shared=no \ | 348 --enable-shared=no \ |
335 --disable-jit \ | 349 --disable-jit \ |
336 --enable-optimized \ | 350 --enable-optimized \ |
337 --enable-libcpp \ | 351 --enable-libcpp \ |
338 --target=${CROSS_TARGET_ARM} \ | 352 --target=${CROSS_TARGET_ARM} \ |
339 llvm_cv_link_use_export_dynamic=no \ | 353 llvm_cv_link_use_export_dynamic=no \ |
340 ac_cv_func_getrusage=no \ | 354 ac_cv_func_getrusage=no \ |
(...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1022 |
1009 if [ "$(type -t $1)" != "function" ]; then | 1023 if [ "$(type -t $1)" != "function" ]; then |
1010 #Usage | 1024 #Usage |
1011 echo "ERROR: unknown function '$1'." >&2 | 1025 echo "ERROR: unknown function '$1'." >&2 |
1012 echo "For help, try:" | 1026 echo "For help, try:" |
1013 echo " $0 help" | 1027 echo " $0 help" |
1014 exit 1 | 1028 exit 1 |
1015 fi | 1029 fi |
1016 | 1030 |
1017 "$@" | 1031 "$@" |
OLD | NEW |