run.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. set -e
  2. # Test our implementation
  3. case $1 in
  4. thumb*)
  5. export RUST_TARGET_PATH=/checkout/targets
  6. xargo build --target $1
  7. xargo build --target $1 --release
  8. ;;
  9. # QEMU crashes even when executing the simplest cross compiled C program:
  10. # `int main() { return 0; }`
  11. powerpc64le-unknown-linux-gnu)
  12. cargo test --target $1 --no-run
  13. cargo test --target $1 --no-run --release
  14. ;;
  15. *)
  16. cargo test --target $1
  17. cargo test --target $1 --release
  18. ;;
  19. esac
  20. # Verify that we haven't drop any intrinsic/symbol
  21. case $1 in
  22. thumb*)
  23. xargo build --features c --target $1 --bin intrinsics
  24. ;;
  25. *)
  26. cargo build --features c --target $1 --bin intrinsics
  27. ;;
  28. esac
  29. # Look out for duplicated symbols when we include the compiler-rt (C) implementation
  30. PREFIX=$(echo $1 | sed -e 's/unknown-//')-
  31. case $1 in
  32. armv7-*)
  33. PREFIX=arm-linux-gnueabihf-
  34. ;;
  35. thumb*)
  36. PREFIX=arm-none-eabi-
  37. ;;
  38. *86*-*)
  39. PREFIX=
  40. ;;
  41. esac
  42. case $TRAVIS_OS_NAME in
  43. osx)
  44. # NOTE OSx's nm doesn't accept the `--defined-only` or provide an equivalent.
  45. # Use GNU nm instead
  46. NM=gnm
  47. brew install binutils
  48. ;;
  49. *)
  50. NM=nm
  51. ;;
  52. esac
  53. # NOTE On i586, It's normal that the get_pc_thunk symbol appears several times so ignore it
  54. stdout=$($PREFIX$NM -g --defined-only /target/${1}/debug/librustc_builtins.rlib)
  55. set +e
  56. echo $stdout | sort | uniq -d | grep -v __x86.get_pc_thunk | grep 'T __'
  57. if test $? = 0; then
  58. exit 1
  59. fi