OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 # Copyright 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can |
| 4 # be found in the LICENSE file. |
| 5 # Copyright 2012 MIPS Technologies / RT-RK |
| 6 |
| 7 set -eu |
| 8 |
| 9 # Get the path to the Mips cross-compiler. |
| 10 |
| 11 dir=$(pwd) |
| 12 cd ../../../.. |
| 13 topdir=$(pwd) |
| 14 tools="$topdir/toolchain/pnacl_linux_i686_newlib/pkg/binutils/bin" |
| 15 cd $dir |
| 16 |
| 17 readonly MIPSEL_LD="$tools/mipsel-pc-nacl-ld" |
| 18 readonly MIPSEL_AS="$tools/mipsel-pc-nacl-as" |
| 19 readonly MIPS_LD="$tools/mips-pc-nacl-ld" |
| 20 readonly MIPS_AS="$tools/mips-pc-nacl-as" |
| 21 |
| 22 |
| 23 for test_file in *.S ; do |
| 24 object_file=${test_file%.*}.o |
| 25 mips_nexe_file=mips/${test_file%.*}.nexe |
| 26 mipsel_nexe_file=mipsel/${test_file%.*}.nexe |
| 27 special_link_options="--section-start .text=0xFFFA000" |
| 28 |
| 29 echo "compiling (Mips) $test_file -> $mips_nexe_file" |
| 30 ${MIPS_AS} -mips32r2 -mdsp\ |
| 31 $test_file -o $object_file |
| 32 if [ $test_file == "test_invalid_dest.S" ] |
| 33 then |
| 34 ${MIPS_LD} $special_link_options -static -nodefaultlibs -nostdlib \ |
| 35 -m elf32btsmip_nacl $object_file -o $mips_nexe_file |
| 36 else |
| 37 ${MIPS_LD} -static -nodefaultlibs -nostdlib \ |
| 38 -m elf32btsmip_nacl $object_file -o $mips_nexe_file |
| 39 fi |
| 40 |
| 41 echo "compiling (Mipsel) $test_file -> $mipsel_nexe_file" |
| 42 ${MIPSEL_AS} -mips32r2 -EL -mdsp\ |
| 43 $test_file -o $object_file |
| 44 if [ $test_file == "test_invalid_dest.S" ] |
| 45 then |
| 46 ${MIPSEL_LD} $special_link_options -static -nodefaultlibs -nostdlib \ |
| 47 -m elf32ltsmip_nacl $object_file -o $mipsel_nexe_file |
| 48 else |
| 49 ${MIPSEL_LD} -static -nodefaultlibs -nostdlib \ |
| 50 -m elf32ltsmip_nacl $object_file -o $mipsel_nexe_file |
| 51 fi |
| 52 rm $object_file |
| 53 done |
| 54 |
OLD | NEW |