run.sh 1.7 KB

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