hello-armv7l.sh 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #! /bin/sh
  2. ## Copyright (C) 2017 Jeremiah Orians
  3. ## This file is part of M2-Planet.
  4. ##
  5. ## M2-Planet is free software: you can redistribute it and/or modify
  6. ## it under the terms of the GNU General Public License as published by
  7. ## the Free Software Foundation, either version 3 of the License, or
  8. ## (at your option) any later version.
  9. ##
  10. ## M2-Planet is distributed in the hope that it will be useful,
  11. ## but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ## GNU General Public License for more details.
  14. ##
  15. ## You should have received a copy of the GNU General Public License
  16. ## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
  17. set -x
  18. # Build the test
  19. bin/M2-Planet --architecture armv7l \
  20. -f test/common_armv7l/functions/chdir.c \
  21. -f test/common_armv7l/functions/malloc.c \
  22. -f test/common_armv7l/functions/getcwd.c \
  23. -f test/common_armv7l/functions/exit.c \
  24. -f test/common_armv7l/functions/file.c \
  25. -f functions/calloc.c \
  26. -f functions/match.c \
  27. -f functions/file_print.c \
  28. -f test/test0021/chdir.c \
  29. --debug \
  30. --bootstrap-mode \
  31. -o test/test0021/chdir.M1 || exit 1
  32. # Build debug footer
  33. blood-elf -f test/test0021/chdir.M1 \
  34. --entry _start \
  35. -o test/test0021/chdir-footer.M1 || exit 2
  36. # Macro assemble with libc written in M1-Macro
  37. M1 -f test/common_armv7l/armv7l_defs.M1 \
  38. -f test/common_armv7l/libc-core.M1 \
  39. -f test/test0021/chdir.M1 \
  40. -f test/test0021/chdir-footer.M1 \
  41. --LittleEndian \
  42. --architecture armv7l \
  43. -o test/test0021/chdir.hex2 || exit 3
  44. # Resolve all linkages
  45. hex2 -f test/common_armv7l/ELF-armv7l-debug.hex2 \
  46. -f test/test0021/chdir.hex2 \
  47. --LittleEndian \
  48. --architecture armv7l \
  49. --BaseAddress 0x10000 \
  50. -o test/results/test0021-armv7l-binary \
  51. --exec_enable || exit 4
  52. # Ensure binary works if host machine supports test
  53. if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
  54. then
  55. . ./sha256.sh
  56. # Verify that the resulting file works
  57. ./test/results/test0021-armv7l-binary
  58. [ 0 = $? ] || exit 5
  59. fi
  60. exit 0