| OLD | NEW |
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 # Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2011 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 set -eu | 6 set -eu |
| 7 | 7 |
| 8 # Get the path to the ARM cross-compiler. | 8 # Get the path to the ARM cross-compiler. |
| 9 # We use the trusted compiler because llvm-fake.py (used in the | |
| 10 # untrusted compiler) doesn't support -nodefaultlibs. | |
| 11 dir=$(pwd) | 9 dir=$(pwd) |
| 12 cd ../../../.. | 10 cd ../../../.. |
| 13 eval "$(tools/llvm/setup_arm_trusted_toolchain.py)" | |
| 14 topdir=$(pwd) | 11 topdir=$(pwd) |
| 15 cd $dir | 12 cd $dir |
| 16 | 13 |
| 14 tools="$topdir/toolchain/pnacl_linux_x86_64/arm-none-linux-gnueabi/bin" |
| 15 |
| 17 ldscript=$topdir/toolchain/pnacl_linux_x86_64/ldscripts/ld_script_arm_untrusted | 16 ldscript=$topdir/toolchain/pnacl_linux_x86_64/ldscripts/ld_script_arm_untrusted |
| 18 | 17 readonly ARM_LD="$tools/arm-pc-nacl-ld" |
| 19 readonly ARM_CROSS_COMPILER="${ARM_CC}" | 18 readonly ARM_AS="$tools/arm-pc-nacl-as" |
| 20 for test_file in *.S ; do | 19 for test_file in *.S ; do |
| 21 object_file=${test_file%.*}.o | 20 object_file=${test_file%.*}.o |
| 22 nexe_file=${test_file%.*}.nexe | 21 nexe_file=${test_file%.*}.nexe |
| 23 | 22 pre_file=${test_file%.*}.s |
| 24 echo "compiling $test_file -> $nexe_file" | 23 echo "compiling $test_file -> $nexe_file" |
| 25 ${ARM_CROSS_COMPILER} \ | 24 cpp $test_file -o $pre_file |
| 26 -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -c $test_file -o $object_file | 25 ${ARM_AS} -march=armv7-a -mcpu=cortex-a8 -mfpu=neon $pre_file -o $object_file |
| 27 ${ARM_LD} -static -nodefaultlibs -nostdlib -T $ldscript \ | 26 ${ARM_LD} -static -nodefaultlibs -nostdlib -T $ldscript \ |
| 28 $object_file -o $nexe_file | 27 $object_file -o $nexe_file |
| 29 done | 28 done |
| OLD | NEW |