elf.py 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. def machine_dict(d):
  2. # TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit?
  3. machdata = {
  4. "darwin9" : {
  5. "arm" : (40, 0, 0, True, 32),
  6. },
  7. "eabi" : {
  8. "arm" : (40, 0, 0, True, 32),
  9. },
  10. "elf" : {
  11. "aarch64" : (183, 0, 0, True, 64),
  12. "aarch64_be" :(183, 0, 0, False, 64),
  13. "i586" : (3, 0, 0, True, 32),
  14. "x86_64": (62, 0, 0, True, 64),
  15. "epiphany": (4643, 0, 0, True, 32),
  16. "lm32": (138, 0, 0, False, 32),
  17. "mips": ( 8, 0, 0, False, 32),
  18. "mipsel": ( 8, 0, 0, True, 32),
  19. "microblaze": (189, 0, 0, False, 32),
  20. "microblazeeb":(189, 0, 0, False, 32),
  21. "microblazeel":(189, 0, 0, True, 32),
  22. "powerpc": (20, 0, 0, False, 32),
  23. "riscv32": (243, 0, 0, True, 32),
  24. "riscv64": (243, 0, 0, True, 64),
  25. },
  26. "linux" : {
  27. "aarch64" : (183, 0, 0, True, 64),
  28. "aarch64_be" :(183, 0, 0, False, 64),
  29. "arm" : (40, 97, 0, True, 32),
  30. "armeb": (40, 97, 0, False, 32),
  31. "powerpc": (20, 0, 0, False, 32),
  32. "powerpc64": (21, 0, 0, False, 64),
  33. "i386": ( 3, 0, 0, True, 32),
  34. "i486": ( 3, 0, 0, True, 32),
  35. "i586": ( 3, 0, 0, True, 32),
  36. "i686": ( 3, 0, 0, True, 32),
  37. "x86_64": (62, 0, 0, True, 64),
  38. "ia64": (50, 0, 0, True, 64),
  39. "alpha": (36902, 0, 0, True, 64),
  40. "hppa": (15, 3, 0, False, 32),
  41. "m68k": ( 4, 0, 0, False, 32),
  42. "mips": ( 8, 0, 0, False, 32),
  43. "mipsel": ( 8, 0, 0, True, 32),
  44. "mips64": ( 8, 0, 0, False, 64),
  45. "mips64el": ( 8, 0, 0, True, 64),
  46. "mipsisa32r6": ( 8, 0, 0, False, 32),
  47. "mipsisa32r6el": ( 8, 0, 0, True, 32),
  48. "mipsisa64r6": ( 8, 0, 0, False, 64),
  49. "mipsisa64r6el": ( 8, 0, 0, True, 64),
  50. "nios2": (113, 0, 0, True, 32),
  51. "riscv32": (243, 0, 0, True, 32),
  52. "riscv64": (243, 0, 0, True, 64),
  53. "s390": (22, 0, 0, False, 32),
  54. "sh4": (42, 0, 0, True, 32),
  55. "sparc": ( 2, 0, 0, False, 32),
  56. "microblaze": (189, 0, 0, False, 32),
  57. "microblazeeb":(189, 0, 0, False, 32),
  58. "microblazeel":(189, 0, 0, True, 32),
  59. },
  60. "linux-musl" : {
  61. "aarch64" : (183, 0, 0, True, 64),
  62. "aarch64_be" :(183, 0, 0, False, 64),
  63. "arm" : ( 40, 97, 0, True, 32),
  64. "armeb": ( 40, 97, 0, False, 32),
  65. "powerpc": ( 20, 0, 0, False, 32),
  66. "i386": ( 3, 0, 0, True, 32),
  67. "i486": ( 3, 0, 0, True, 32),
  68. "i586": ( 3, 0, 0, True, 32),
  69. "i686": ( 3, 0, 0, True, 32),
  70. "x86_64": ( 62, 0, 0, True, 64),
  71. "mips": ( 8, 0, 0, False, 32),
  72. "mipsel": ( 8, 0, 0, True, 32),
  73. "mips64": ( 8, 0, 0, False, 64),
  74. "mips64el": ( 8, 0, 0, True, 64),
  75. "microblaze": (189, 0, 0, False, 32),
  76. "microblazeeb":(189, 0, 0, False, 32),
  77. "microblazeel":(189, 0, 0, True, 32),
  78. "riscv32": (243, 0, 0, True, 32),
  79. "riscv64": (243, 0, 0, True, 64),
  80. "sh4": ( 42, 0, 0, True, 32),
  81. },
  82. "uclinux-uclibc" : {
  83. "bfin": ( 106, 0, 0, True, 32),
  84. },
  85. "linux-gnueabi" : {
  86. "arm" : (40, 0, 0, True, 32),
  87. "armeb" : (40, 0, 0, False, 32),
  88. },
  89. "linux-musleabi" : {
  90. "arm" : (40, 0, 0, True, 32),
  91. "armeb" : (40, 0, 0, False, 32),
  92. },
  93. "linux-gnuspe" : {
  94. "powerpc": (20, 0, 0, False, 32),
  95. },
  96. "linux-muslspe" : {
  97. "powerpc": (20, 0, 0, False, 32),
  98. },
  99. "linux-gnu" : {
  100. "powerpc": (20, 0, 0, False, 32),
  101. "sh4": (42, 0, 0, True, 32),
  102. },
  103. "linux-gnu_ilp32" : {
  104. "aarch64" : (183, 0, 0, True, 32),
  105. },
  106. "linux-gnux32" : {
  107. "x86_64": (62, 0, 0, True, 32),
  108. },
  109. "linux-muslx32" : {
  110. "x86_64": (62, 0, 0, True, 32),
  111. },
  112. "linux-gnun32" : {
  113. "mips64": ( 8, 0, 0, False, 32),
  114. "mips64el": ( 8, 0, 0, True, 32),
  115. "mipsisa64r6": ( 8, 0, 0, False, 32),
  116. "mipsisa64r6el":( 8, 0, 0, True, 32),
  117. },
  118. }
  119. # Add in any extra user supplied data which may come from a BSP layer, removing the
  120. # need to always change this class directly
  121. extra_machdata = (d and d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS" or None) or "").split()
  122. for m in extra_machdata:
  123. call = m + "(machdata, d)"
  124. locs = { "machdata" : machdata, "d" : d}
  125. machdata = bb.utils.better_eval(call, locs)
  126. return machdata