[Posix] Optimize string marshal code by using unsafe code (#4964)
[mono.git] / nacl / nacl_interp_loader_sdk.sh
1 #!/bin/bash
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
4 # found in the LICENSE file.
5 #
6 # Usage: nacl_interp_loader.sh PLATFORM NEXE ARGS...
7
8 # Assumes this file is sitting in the source tree.
9 # This should be changed for some proper SDK installation setup.
10 NACL_SDK_ROOT=${NACL_SDK_ROOT:-/path/to/naclsdk/pepper_XX}
11
12 case "$1" in
13 i?86)
14   arch=x86_32
15   libdir=lib32
16   ;;
17 x86_64)
18   arch=x86_64
19   libdir=lib64
20   ;;
21 arm|v7l)
22   arch=arm
23   libdir=lib32
24   ;;
25 *)
26   echo >&2 "$0: Do not recognize architecture \"$1\""
27   exit 127
28   ;;
29 esac
30
31 shift
32
33 case "${NACL_SDK_ROOT}" in
34 *pepper_15* | *pepper_16* | *pepper_17*)
35   SEL_LDR="$NACL_SDK_ROOT/toolchain/linux_x86/bin/sel_ldr_${arch}"
36   IRT="$NACL_SDK_ROOT/toolchain/linux_x86/runtime/irt_core_${arch}.nexe"
37   RTLD="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}/runnable-ld.so"
38   LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86/x86_64-nacl/${libdir}"
39   ;;
40 *)
41   SEL_LDR="$NACL_SDK_ROOT/tools/sel_ldr_${arch}"
42   IRT="$NACL_SDK_ROOT/tools/irt_core_${arch}.nexe"
43   RTLD="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}/runnable-ld.so"
44   LIBDIR="$NACL_SDK_ROOT/toolchain/linux_x86_glibc/x86_64-nacl/${libdir}"
45   ;;
46 esac
47
48 IGNORE_VALIDATOR_ARG=""
49 if [ x"$NACL_IGNORE_VALIDATOR" == x"1" ]; then
50   IGNORE_VALIDATOR_ARG="-c"
51 fi
52
53 exec "$SEL_LDR" -E "NACL_PWD=`pwd`" -E "MONO_PATH=$MONO_PATH" \
54   -E "MONO_CFG_DIR=$MONO_CFG_DIR" -E "MONO_SHARED_DIR=$MONO_SHARED_DIR" \
55   -a $IGNORE_VALIDATOR_ARG -S -B "$IRT" -l /dev/null -- "$RTLD" \
56   --library-path $LIBDIR "$@"