target_bintools.cmake 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # - memusage: Name of command for memusage
  2. # In this implementation `sizeac` is used
  3. set_property(TARGET bintools PROPERTY memusage_command "${CMAKE_SIZE}")
  4. set_property(TARGET bintools PROPERTY memusage_flag "-gq")
  5. set_property(TARGET bintools PROPERTY memusage_infile "")
  6. # List of format the tool supports for converting, for example,
  7. # GNU tools uses objectcopyy, which supports the following: ihex, srec, binary
  8. set_property(TARGET bintools PROPERTY elfconvert_formats ihex srec binary)
  9. # MWDT toolchain does not support all options in a single command
  10. # Therefore a CMake script is used, so that multiple commands can be executed
  11. # successively.
  12. set_property(TARGET bintools PROPERTY elfconvert_command ${CMAKE_COMMAND})
  13. set_property(TARGET bintools PROPERTY elfconvert_flag
  14. -DELF2HEX=${CMAKE_ELF2HEX}
  15. -DELF2BIN=${CMAKE_ELF2BIN}
  16. -DSTRIP=${CMAKE_STRIP}
  17. -DOBJCOPY=${CMAKE_OBJCOPY}
  18. )
  19. set_property(TARGET bintools PROPERTY elfconvert_flag_final
  20. -P ${CMAKE_CURRENT_LIST_DIR}/elfconvert_command.cmake)
  21. set_property(TARGET bintools PROPERTY elfconvert_flag_strip_all "-DSTRIP_ALL=True")
  22. set_property(TARGET bintools PROPERTY elfconvert_flag_strip_debug "-DSTRIP_DEBUG=True")
  23. set_property(TARGET bintools PROPERTY elfconvert_flag_intarget "-DINTARGET=")
  24. set_property(TARGET bintools PROPERTY elfconvert_flag_outtarget "-DOUTTARGET=")
  25. set_property(TARGET bintools PROPERTY elfconvert_flag_section_remove "-DREMOVE_SECTION=")
  26. set_property(TARGET bintools PROPERTY elfconvert_flag_section_only "-DONLY_SECTION=")
  27. # mwdt doesn't handle rename, consider adjusting abstraction.
  28. set_property(TARGET bintools PROPERTY elfconvert_flag_section_rename "-DRENAME_SECTION=")
  29. set_property(TARGET bintools PROPERTY elfconvert_flag_gapfill "-DGAP_FILL=")
  30. set_property(TARGET bintools PROPERTY elfconvert_flag_srec_len "-DSREC_LEN=")
  31. set_property(TARGET bintools PROPERTY elfconvert_flag_infile "-DINFILE=")
  32. set_property(TARGET bintools PROPERTY elfconvert_flag_outfile "-DOUTFILE=")
  33. # - disassembly : Name of command for disassembly of files
  34. # In this implementation `elfdumpac` is used
  35. # disassembly_flag : -T
  36. # disassembly_flag_final : empty
  37. # disassembly_flag_inline_source : -S
  38. # disassembly_flag_all : empty
  39. # disassembly_flag_infile : empty
  40. # disassembly_flag_outfile : '>'
  41. set_property(TARGET bintools PROPERTY disassembly_command ${CMAKE_OBJDUMP})
  42. set_property(TARGET bintools PROPERTY disassembly_flag -T)
  43. set_property(TARGET bintools PROPERTY disassembly_flag_final "")
  44. set_property(TARGET bintools PROPERTY disassembly_flag_inline_source -S)
  45. set_property(TARGET bintools PROPERTY disassembly_flag_all "") # No support for all ?
  46. set_property(TARGET bintools PROPERTY disassembly_flag_infile "")
  47. set_property(TARGET bintools PROPERTY disassembly_flag_outfile > )
  48. #
  49. # - readelf : Name of command for reading elf files.
  50. # In this implementation `elfdumpac ` is used
  51. # readelf_flag : empty
  52. # readelf_flag_final : empty
  53. # readelf_flag_headers : -qshp
  54. # readelf_flag_infile : empty
  55. # readelf_flag_outfile : '>'
  56. # This is using elfdumpac from mwdt.
  57. set_property(TARGET bintools PROPERTY readelf_command ${CMAKE_READELF})
  58. set_property(TARGET bintools PROPERTY readelf_flag "")
  59. set_property(TARGET bintools PROPERTY readelf_flag_final "")
  60. set_property(TARGET bintools PROPERTY readelf_flag_headers -qshp)
  61. set_property(TARGET bintools PROPERTY readelf_flag_infile "")
  62. set_property(TARGET bintools PROPERTY readelf_flag_outfile > )
  63. #
  64. # - strip: Name of command for stripping symbols
  65. # In this implementation `stripac` is used
  66. # strip_flag : empty
  67. # strip_flag_final : empty
  68. # strip_flag_all : -qls
  69. # strip_flag_debug : -ql
  70. # strip_flag_dwo : empty
  71. # strip_flag_infile : empty
  72. # strip_flag_outfile : -o
  73. # This is using strip from bintools.
  74. set_property(TARGET bintools PROPERTY strip_command ${CMAKE_STRIP})
  75. # Any flag the strip command requires for processing
  76. set_property(TARGET bintools PROPERTY strip_flag "")
  77. set_property(TARGET bintools PROPERTY strip_flag_final "")
  78. set_property(TARGET bintools PROPERTY strip_flag_all -qls)
  79. set_property(TARGET bintools PROPERTY strip_flag_debug -ql)
  80. set_property(TARGET bintools PROPERTY strip_flag_infile "")
  81. set_property(TARGET bintools PROPERTY strip_flag_outfile -o )