| 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 2412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2423 StepBanner "LIBS-SUPPORT" | 2423 StepBanner "LIBS-SUPPORT" |
| 2424 libs-support-newlib-crt1 portable | 2424 libs-support-newlib-crt1 portable |
| 2425 libs-support-newlib-crt1 x86-64 | 2425 libs-support-newlib-crt1 x86-64 |
| 2426 libs-support-bitcode portable | 2426 libs-support-bitcode portable |
| 2427 libs-support-bitcode x86-64 | 2427 libs-support-bitcode x86-64 |
| 2428 | 2428 |
| 2429 local arch | 2429 local arch |
| 2430 for arch in arm x86-32 x86-64 mips32; do | 2430 for arch in arm x86-32 x86-64 mips32; do |
| 2431 libs-support-native ${arch} | 2431 libs-support-native ${arch} |
| 2432 done | 2432 done |
| 2433 |
| 2434 libs-support-unsandboxed |
| 2433 } | 2435 } |
| 2434 | 2436 |
| 2435 libs-support-newlib-crt1() { | 2437 libs-support-newlib-crt1() { |
| 2436 local arch=$1 | 2438 local arch=$1 |
| 2437 setup-biased-bitcode-env ${arch} | 2439 setup-biased-bitcode-env ${arch} |
| 2438 mkdir -p "${INSTALL_LIB}" | 2440 mkdir -p "${INSTALL_LIB}" |
| 2439 spushd "${PNACL_SUPPORT}/bitcode" | 2441 spushd "${PNACL_SUPPORT}/bitcode" |
| 2440 | 2442 |
| 2441 StepBanner "LIBS-SUPPORT-NEWLIB" \ | 2443 StepBanner "LIBS-SUPPORT-NEWLIB" \ |
| 2442 "Install crt1.x & crt1_for_eh.x (linker scripts)" | 2444 "Install crt1.x & crt1_for_eh.x (linker scripts)" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2520 | 2522 |
| 2521 # For ARM, also compile aeabi_read_tp.S | 2523 # For ARM, also compile aeabi_read_tp.S |
| 2522 if [ ${arch} == arm ] ; then | 2524 if [ ${arch} == arm ] ; then |
| 2523 ${cc_cmd} -c aeabi_read_tp.S -o "${tmpdir}"/aeabi_read_tp.o | 2525 ${cc_cmd} -c aeabi_read_tp.S -o "${tmpdir}"/aeabi_read_tp.o |
| 2524 fi | 2526 fi |
| 2525 spopd | 2527 spopd |
| 2526 | 2528 |
| 2527 ${PNACL_AR} rc "${destdir}"/libcrt_platform.a "${tmpdir}"/*.o | 2529 ${PNACL_AR} rc "${destdir}"/libcrt_platform.a "${tmpdir}"/*.o |
| 2528 } | 2530 } |
| 2529 | 2531 |
| 2532 libs-support-unsandboxed() { |
| 2533 if ${BUILD_PLATFORM_LINUX}; then |
| 2534 local arch=linux-x86-32 |
| 2535 StepBanner "LIBS-SUPPORT (${arch})" "Install unsandboxed_irt.o" |
| 2536 local destdir="${INSTALL_LIB_NATIVE}"${arch} |
| 2537 mkdir -p ${destdir} |
| 2538 gcc -m32 -O2 -Wall -Werror -I${NACL_ROOT}/.. -DNACL_LINUX=1 -c \ |
| 2539 ${PNACL_SUPPORT}/unsandboxed_irt.c -o ${destdir}/unsandboxed_irt.o |
| 2540 fi |
| 2541 } |
| 2542 |
| 2530 | 2543 |
| 2531 # Build the dummy "libpnacl_irt_shim.a", which is useful for building | 2544 # Build the dummy "libpnacl_irt_shim.a", which is useful for building |
| 2532 # commandline programs. It cannot be used to build PPAPI programs | 2545 # commandline programs. It cannot be used to build PPAPI programs |
| 2533 # because it does not actually shim the PPAPI interfaces. | 2546 # because it does not actually shim the PPAPI interfaces. |
| 2534 # The library is named the same as the real PPAPI shim to ensure that | 2547 # The library is named the same as the real PPAPI shim to ensure that |
| 2535 # the commandlines are the same. | 2548 # the commandlines are the same. |
| 2536 # This must be built after newlib(), since it uses headers like <stdint.h>. | 2549 # This must be built after newlib(), since it uses headers like <stdint.h>. |
| 2537 dummy-irt-shim() { | 2550 dummy-irt-shim() { |
| 2538 local arch=$1 | 2551 local arch=$1 |
| 2539 local destdir="${INSTALL_LIB_NATIVE}"${arch} | 2552 local destdir="${INSTALL_LIB_NATIVE}"${arch} |
| (...skipping 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3385 | 3398 |
| 3386 if [ "$(type -t $1)" != "function" ]; then | 3399 if [ "$(type -t $1)" != "function" ]; then |
| 3387 #Usage | 3400 #Usage |
| 3388 echo "ERROR: unknown function '$1'." >&2 | 3401 echo "ERROR: unknown function '$1'." >&2 |
| 3389 echo "For help, try:" | 3402 echo "For help, try:" |
| 3390 echo " $0 help" | 3403 echo " $0 help" |
| 3391 exit 1 | 3404 exit 1 |
| 3392 fi | 3405 fi |
| 3393 | 3406 |
| 3394 "$@" | 3407 "$@" |
| OLD | NEW |