Index: src/trusted/validator_arm/testdata-thumb/compile_tests.sh |
diff --git a/src/trusted/validator_arm/testdata/compile_tests.sh b/src/trusted/validator_arm/testdata-thumb/compile_tests.sh |
similarity index 56% |
copy from src/trusted/validator_arm/testdata/compile_tests.sh |
copy to src/trusted/validator_arm/testdata-thumb/compile_tests.sh |
index 5891068044ef8495af3f3e5bdcb49b9e7797eda8..e0c5c259d67d3d9c17780beea9208de00fd3726d 100755 |
--- a/src/trusted/validator_arm/testdata/compile_tests.sh |
+++ b/src/trusted/validator_arm/testdata-thumb/compile_tests.sh |
@@ -6,24 +6,25 @@ |
set -eu |
# Get the path to the ARM cross-compiler. |
-# We use the trusted compiler because llvm-fake.py (used in the |
-# untrusted compiler) doesn't support -nodefaultlibs. |
dir=$(pwd) |
cd ../../../.. |
-eval "$(tools/llvm/setup_arm_trusted_toolchain.py)" |
topdir=$(pwd) |
cd $dir |
-ldscript=$topdir/toolchain/pnacl_linux_x86_64/ldscripts/ld_script_arm_untrusted |
+tools="$topdir/toolchain/pnacl_linux_x86_64_newlib/pkg/binutils/bin" |
-readonly ARM_CROSS_COMPILER="${ARM_CC}" |
+ldscript=ld_script_arm_thumb2_untrusted |
+readonly ARM_LD="$tools/arm-pc-nacl-ld" |
+readonly ARM_AS="$tools/arm-pc-nacl-as" |
for test_file in *.S ; do |
object_file=${test_file%.*}.o |
nexe_file=${test_file%.*}.nexe |
- |
+ pre_file=${test_file%.*}.s |
echo "compiling $test_file -> $nexe_file" |
- ${ARM_CROSS_COMPILER} \ |
- -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -c $test_file -o $object_file |
+ cpp $test_file -o $pre_file |
+ ${ARM_AS} -march=armv7-a -mcpu=cortex-a8 -mfpu=neon -mthumb $pre_file \ |
+ -o $object_file |
${ARM_LD} -static -nodefaultlibs -nostdlib -T $ldscript \ |
$object_file -o $nexe_file |
+ rm $pre_file $object_file |
done |