Home | History | Annotate | Download | only in build_tools
      1 #!/bin/bash
      2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
      3 # Use of this source code is governed by a BSD-style license that can be
      4 # found in the LICENSE file.
      5 #
      6 # Usage: nacl_interp_loader.sh PLATFORM NEXE ARGS...
      7 
      8 case "$1" in
      9 i?86)
     10   arch=x86_32
     11   libdir=lib32
     12   ;;
     13 x86_64)
     14   arch=x86_64
     15   libdir=lib64
     16   ;;
     17 arm|v7l)
     18   arch=arm
     19   libdir=lib32
     20   ;;
     21 *)
     22   echo >&2 "$0: Do not recognize architecture \"$1\""
     23   exit 127
     24   ;;
     25 esac
     26 
     27 shift
     28 
     29 case "${NACL_SDK_ROOT}" in
     30 *pepper_15* | *pepper_16* | *pepper_17*)
     31   SEL_LDR="$NACL_SDK_ROOT/toolchain/linux_x86/bin/sel_ldr_${arch}"
     32   IRT="$NACL_SDK_ROOT/toolchain/linux_x86/runtime/irt_core_${arch}.nexe"
     33   RTLD="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}/runnable-ld.so"
     34   LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}"
     35   ;;
     36 *)
     37   SEL_LDR="$NACL_SDK_ROOT/tools/sel_ldr_${arch}"
     38   IRT="$NACL_SDK_ROOT/tools/irt_core_${arch}.nexe"
     39   RTLD="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}/runnable-ld.so"
     40   LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}"
     41   ;;
     42 esac
     43 
     44 IGNORE_VALIDATOR_ARG=""
     45 if [ x"$NACL_IGNORE_VALIDATOR" == x"1" ]; then
     46   IGNORE_VALIDATOR_ARG="-c"
     47 fi
     48 
     49 exec "$SEL_LDR" -E "NACL_PWD=`pwd`" -E "MONO_PATH=$MONO_PATH" \
     50   -E "MONO_CFG_DIR=$MONO_CFG_DIR" -E "MONO_SHARED_DIR=$MONO_SHARED_DIR" \
     51   -a $IGNORE_VALIDATOR_ARG -S -B "$IRT" -l /dev/null -- "$RTLD" \
     52   --library-path $LIBDIR "$@"
     53