diff options
| -rw-r--r-- | meta/classes/insane.bbclass | 138 | ||||
| -rw-r--r-- | meta/lib/oe/elf.py | 127 |
2 files changed, 129 insertions, 136 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass index 469d5c4cd5..8c360c83e7 100644 --- a/meta/classes/insane.bbclass +++ b/meta/classes/insane.bbclass | |||
| @@ -46,140 +46,6 @@ ALL_QA = "${WARN_QA} ${ERROR_QA}" | |||
| 46 | 46 | ||
| 47 | UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static" | 47 | UNKNOWN_CONFIGURE_WHITELIST ?= "--enable-nls --disable-nls --disable-silent-rules --disable-dependency-tracking --with-libtool-sysroot --disable-static" |
| 48 | 48 | ||
| 49 | # | ||
| 50 | # dictionary for elf headers | ||
| 51 | # | ||
| 52 | # feel free to add and correct. | ||
| 53 | # | ||
| 54 | # TARGET_OS TARGET_ARCH MACHINE, OSABI, ABIVERSION, Little Endian, 32bit? | ||
| 55 | def package_qa_get_machine_dict(d): | ||
| 56 | machdata = { | ||
| 57 | "darwin9" : { | ||
| 58 | "arm" : (40, 0, 0, True, 32), | ||
| 59 | }, | ||
| 60 | "eabi" : { | ||
| 61 | "arm" : (40, 0, 0, True, 32), | ||
| 62 | }, | ||
| 63 | "elf" : { | ||
| 64 | "aarch64" : (183, 0, 0, True, 64), | ||
| 65 | "aarch64_be" :(183, 0, 0, False, 64), | ||
| 66 | "i586" : (3, 0, 0, True, 32), | ||
| 67 | "x86_64": (62, 0, 0, True, 64), | ||
| 68 | "epiphany": (4643, 0, 0, True, 32), | ||
| 69 | "mips": ( 8, 0, 0, False, 32), | ||
| 70 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 71 | "microblaze": (189, 0, 0, False, 32), | ||
| 72 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 73 | "microblazeel":(189, 0, 0, True, 32), | ||
| 74 | "powerpc": (20, 0, 0, False, 32), | ||
| 75 | "riscv32": (243, 0, 0, True, 32), | ||
| 76 | "riscv64": (243, 0, 0, True, 64), | ||
| 77 | }, | ||
| 78 | "linux" : { | ||
| 79 | "aarch64" : (183, 0, 0, True, 64), | ||
| 80 | "aarch64_be" :(183, 0, 0, False, 64), | ||
| 81 | "arm" : (40, 97, 0, True, 32), | ||
| 82 | "armeb": (40, 97, 0, False, 32), | ||
| 83 | "powerpc": (20, 0, 0, False, 32), | ||
| 84 | "powerpc64": (21, 0, 0, False, 64), | ||
| 85 | "i386": ( 3, 0, 0, True, 32), | ||
| 86 | "i486": ( 3, 0, 0, True, 32), | ||
| 87 | "i586": ( 3, 0, 0, True, 32), | ||
| 88 | "i686": ( 3, 0, 0, True, 32), | ||
| 89 | "x86_64": (62, 0, 0, True, 64), | ||
| 90 | "ia64": (50, 0, 0, True, 64), | ||
| 91 | "alpha": (36902, 0, 0, True, 64), | ||
| 92 | "hppa": (15, 3, 0, False, 32), | ||
| 93 | "m68k": ( 4, 0, 0, False, 32), | ||
| 94 | "mips": ( 8, 0, 0, False, 32), | ||
| 95 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 96 | "mips64": ( 8, 0, 0, False, 64), | ||
| 97 | "mips64el": ( 8, 0, 0, True, 64), | ||
| 98 | "mipsisa32r6": ( 8, 0, 0, False, 32), | ||
| 99 | "mipsisa32r6el": ( 8, 0, 0, True, 32), | ||
| 100 | "mipsisa64r6": ( 8, 0, 0, False, 64), | ||
| 101 | "mipsisa64r6el": ( 8, 0, 0, True, 64), | ||
| 102 | "nios2": (113, 0, 0, True, 32), | ||
| 103 | "riscv32": (243, 0, 0, True, 32), | ||
| 104 | "riscv64": (243, 0, 0, True, 64), | ||
| 105 | "s390": (22, 0, 0, False, 32), | ||
| 106 | "sh4": (42, 0, 0, True, 32), | ||
| 107 | "sparc": ( 2, 0, 0, False, 32), | ||
| 108 | "microblaze": (189, 0, 0, False, 32), | ||
| 109 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 110 | "microblazeel":(189, 0, 0, True, 32), | ||
| 111 | }, | ||
| 112 | "linux-musl" : { | ||
| 113 | "aarch64" : (183, 0, 0, True, 64), | ||
| 114 | "aarch64_be" :(183, 0, 0, False, 64), | ||
| 115 | "arm" : ( 40, 97, 0, True, 32), | ||
| 116 | "armeb": ( 40, 97, 0, False, 32), | ||
| 117 | "powerpc": ( 20, 0, 0, False, 32), | ||
| 118 | "i386": ( 3, 0, 0, True, 32), | ||
| 119 | "i486": ( 3, 0, 0, True, 32), | ||
| 120 | "i586": ( 3, 0, 0, True, 32), | ||
| 121 | "i686": ( 3, 0, 0, True, 32), | ||
| 122 | "x86_64": ( 62, 0, 0, True, 64), | ||
| 123 | "mips": ( 8, 0, 0, False, 32), | ||
| 124 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 125 | "mips64": ( 8, 0, 0, False, 64), | ||
| 126 | "mips64el": ( 8, 0, 0, True, 64), | ||
| 127 | "microblaze": (189, 0, 0, False, 32), | ||
| 128 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 129 | "microblazeel":(189, 0, 0, True, 32), | ||
| 130 | "riscv32": (243, 0, 0, True, 32), | ||
| 131 | "riscv64": (243, 0, 0, True, 64), | ||
| 132 | "sh4": ( 42, 0, 0, True, 32), | ||
| 133 | }, | ||
| 134 | "uclinux-uclibc" : { | ||
| 135 | "bfin": ( 106, 0, 0, True, 32), | ||
| 136 | }, | ||
| 137 | "linux-gnueabi" : { | ||
| 138 | "arm" : (40, 0, 0, True, 32), | ||
| 139 | "armeb" : (40, 0, 0, False, 32), | ||
| 140 | }, | ||
| 141 | "linux-musleabi" : { | ||
| 142 | "arm" : (40, 0, 0, True, 32), | ||
| 143 | "armeb" : (40, 0, 0, False, 32), | ||
| 144 | }, | ||
| 145 | "linux-gnuspe" : { | ||
| 146 | "powerpc": (20, 0, 0, False, 32), | ||
| 147 | }, | ||
| 148 | "linux-muslspe" : { | ||
| 149 | "powerpc": (20, 0, 0, False, 32), | ||
| 150 | }, | ||
| 151 | "linux-gnu" : { | ||
| 152 | "powerpc": (20, 0, 0, False, 32), | ||
| 153 | "sh4": (42, 0, 0, True, 32), | ||
| 154 | }, | ||
| 155 | "linux-gnu_ilp32" : { | ||
| 156 | "aarch64" : (183, 0, 0, True, 32), | ||
| 157 | }, | ||
| 158 | "linux-gnux32" : { | ||
| 159 | "x86_64": (62, 0, 0, True, 32), | ||
| 160 | }, | ||
| 161 | "linux-muslx32" : { | ||
| 162 | "x86_64": (62, 0, 0, True, 32), | ||
| 163 | }, | ||
| 164 | "linux-gnun32" : { | ||
| 165 | "mips64": ( 8, 0, 0, False, 32), | ||
| 166 | "mips64el": ( 8, 0, 0, True, 32), | ||
| 167 | "mipsisa64r6": ( 8, 0, 0, False, 32), | ||
| 168 | "mipsisa64r6el":( 8, 0, 0, True, 32), | ||
| 169 | }, | ||
| 170 | } | ||
| 171 | |||
| 172 | # Add in any extra user supplied data which may come from a BSP layer, removing the | ||
| 173 | # need to always change this class directly | ||
| 174 | extra_machdata = (d.getVar("PACKAGEQA_EXTRA_MACHDEFFUNCS") or "").split() | ||
| 175 | for m in extra_machdata: | ||
| 176 | call = m + "(machdata, d)" | ||
| 177 | locs = { "machdata" : machdata, "d" : d} | ||
| 178 | machdata = bb.utils.better_eval(call, locs) | ||
| 179 | |||
| 180 | return machdata | ||
| 181 | |||
| 182 | |||
| 183 | def package_qa_clean_path(path, d, pkg=None): | 49 | def package_qa_clean_path(path, d, pkg=None): |
| 184 | """ | 50 | """ |
| 185 | Remove redundant paths from the path for display. If pkg isn't set then | 51 | Remove redundant paths from the path for display. If pkg isn't set then |
| @@ -404,7 +270,7 @@ def package_qa_check_arch(path,name,d, elf, messages): | |||
| 404 | """ | 270 | """ |
| 405 | Check if archs are compatible | 271 | Check if archs are compatible |
| 406 | """ | 272 | """ |
| 407 | import re | 273 | import re, oe.elf |
| 408 | 274 | ||
| 409 | if not elf: | 275 | if not elf: |
| 410 | return | 276 | return |
| @@ -431,7 +297,7 @@ def package_qa_check_arch(path,name,d, elf, messages): | |||
| 431 | 297 | ||
| 432 | #if this will throw an exception, then fix the dict above | 298 | #if this will throw an exception, then fix the dict above |
| 433 | (machine, osabi, abiversion, littleendian, bits) \ | 299 | (machine, osabi, abiversion, littleendian, bits) \ |
| 434 | = package_qa_get_machine_dict(d)[target_os][target_arch] | 300 | = oe.elf.machine_dict(d)[target_os][target_arch] |
| 435 | 301 | ||
| 436 | # Check the architecture and endiannes of the binary | 302 | # Check the architecture and endiannes of the binary |
| 437 | is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ | 303 | is_32 = (("virtual/kernel" in provides) or bb.data.inherits_class("module", d)) and \ |
diff --git a/meta/lib/oe/elf.py b/meta/lib/oe/elf.py new file mode 100644 index 0000000000..e63d268c35 --- /dev/null +++ b/meta/lib/oe/elf.py | |||
| @@ -0,0 +1,127 @@ | |||
| 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 | "mips": ( 8, 0, 0, False, 32), | ||
| 17 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 18 | "microblaze": (189, 0, 0, False, 32), | ||
| 19 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 20 | "microblazeel":(189, 0, 0, True, 32), | ||
| 21 | "powerpc": (20, 0, 0, False, 32), | ||
| 22 | "riscv32": (243, 0, 0, True, 32), | ||
| 23 | "riscv64": (243, 0, 0, True, 64), | ||
| 24 | }, | ||
| 25 | "linux" : { | ||
| 26 | "aarch64" : (183, 0, 0, True, 64), | ||
| 27 | "aarch64_be" :(183, 0, 0, False, 64), | ||
| 28 | "arm" : (40, 97, 0, True, 32), | ||
| 29 | "armeb": (40, 97, 0, False, 32), | ||
| 30 | "powerpc": (20, 0, 0, False, 32), | ||
| 31 | "powerpc64": (21, 0, 0, False, 64), | ||
| 32 | "i386": ( 3, 0, 0, True, 32), | ||
| 33 | "i486": ( 3, 0, 0, True, 32), | ||
| 34 | "i586": ( 3, 0, 0, True, 32), | ||
| 35 | "i686": ( 3, 0, 0, True, 32), | ||
| 36 | "x86_64": (62, 0, 0, True, 64), | ||
| 37 | "ia64": (50, 0, 0, True, 64), | ||
| 38 | "alpha": (36902, 0, 0, True, 64), | ||
| 39 | "hppa": (15, 3, 0, False, 32), | ||
| 40 | "m68k": ( 4, 0, 0, False, 32), | ||
| 41 | "mips": ( 8, 0, 0, False, 32), | ||
| 42 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 43 | "mips64": ( 8, 0, 0, False, 64), | ||
| 44 | "mips64el": ( 8, 0, 0, True, 64), | ||
| 45 | "mipsisa32r6": ( 8, 0, 0, False, 32), | ||
| 46 | "mipsisa32r6el": ( 8, 0, 0, True, 32), | ||
| 47 | "mipsisa64r6": ( 8, 0, 0, False, 64), | ||
| 48 | "mipsisa64r6el": ( 8, 0, 0, True, 64), | ||
| 49 | "nios2": (113, 0, 0, True, 32), | ||
| 50 | "riscv32": (243, 0, 0, True, 32), | ||
| 51 | "riscv64": (243, 0, 0, True, 64), | ||
| 52 | "s390": (22, 0, 0, False, 32), | ||
| 53 | "sh4": (42, 0, 0, True, 32), | ||
| 54 | "sparc": ( 2, 0, 0, False, 32), | ||
| 55 | "microblaze": (189, 0, 0, False, 32), | ||
| 56 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 57 | "microblazeel":(189, 0, 0, True, 32), | ||
| 58 | }, | ||
| 59 | "linux-musl" : { | ||
| 60 | "aarch64" : (183, 0, 0, True, 64), | ||
| 61 | "aarch64_be" :(183, 0, 0, False, 64), | ||
| 62 | "arm" : ( 40, 97, 0, True, 32), | ||
| 63 | "armeb": ( 40, 97, 0, False, 32), | ||
| 64 | "powerpc": ( 20, 0, 0, False, 32), | ||
| 65 | "i386": ( 3, 0, 0, True, 32), | ||
| 66 | "i486": ( 3, 0, 0, True, 32), | ||
| 67 | "i586": ( 3, 0, 0, True, 32), | ||
| 68 | "i686": ( 3, 0, 0, True, 32), | ||
| 69 | "x86_64": ( 62, 0, 0, True, 64), | ||
| 70 | "mips": ( 8, 0, 0, False, 32), | ||
| 71 | "mipsel": ( 8, 0, 0, True, 32), | ||
| 72 | "mips64": ( 8, 0, 0, False, 64), | ||
| 73 | "mips64el": ( 8, 0, 0, True, 64), | ||
| 74 | "microblaze": (189, 0, 0, False, 32), | ||
| 75 | "microblazeeb":(189, 0, 0, False, 32), | ||
| 76 | "microblazeel":(189, 0, 0, True, 32), | ||
| 77 | "riscv32": (243, 0, 0, True, 32), | ||
| 78 | "riscv64": (243, 0, 0, True, 64), | ||
| 79 | "sh4": ( 42, 0, 0, True, 32), | ||
| 80 | }, | ||
| 81 | "uclinux-uclibc" : { | ||
| 82 | "bfin": ( 106, 0, 0, True, 32), | ||
| 83 | }, | ||
| 84 | "linux-gnueabi" : { | ||
| 85 | "arm" : (40, 0, 0, True, 32), | ||
| 86 | "armeb" : (40, 0, 0, False, 32), | ||
| 87 | }, | ||
| 88 | "linux-musleabi" : { | ||
| 89 | "arm" : (40, 0, 0, True, 32), | ||
| 90 | "armeb" : (40, 0, 0, False, 32), | ||
| 91 | }, | ||
| 92 | "linux-gnuspe" : { | ||
| 93 | "powerpc": (20, 0, 0, False, 32), | ||
| 94 | }, | ||
| 95 | "linux-muslspe" : { | ||
| 96 | "powerpc": (20, 0, 0, False, 32), | ||
| 97 | }, | ||
| 98 | "linux-gnu" : { | ||
| 99 | "powerpc": (20, 0, 0, False, 32), | ||
| 100 | "sh4": (42, 0, 0, True, 32), | ||
| 101 | }, | ||
| 102 | "linux-gnu_ilp32" : { | ||
| 103 | "aarch64" : (183, 0, 0, True, 32), | ||
| 104 | }, | ||
| 105 | "linux-gnux32" : { | ||
| 106 | "x86_64": (62, 0, 0, True, 32), | ||
| 107 | }, | ||
| 108 | "linux-muslx32" : { | ||
| 109 | "x86_64": (62, 0, 0, True, 32), | ||
| 110 | }, | ||
| 111 | "linux-gnun32" : { | ||
| 112 | "mips64": ( 8, 0, 0, False, 32), | ||
| 113 | "mips64el": ( 8, 0, 0, True, 32), | ||
| 114 | "mipsisa64r6": ( 8, 0, 0, False, 32), | ||
| 115 | "mipsisa64r6el":( 8, 0, 0, True, 32), | ||
| 116 | }, | ||
| 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 | |||
| 127 | return machdata | ||
