diff options
Diffstat (limited to 'meta/conf/machine/include/arm/feature-arm-thumb.inc')
-rw-r--r-- | meta/conf/machine/include/arm/feature-arm-thumb.inc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc index d58c4b4bda..8a3866568c 100644 --- a/meta/conf/machine/include/arm/feature-arm-thumb.inc +++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc | |||
@@ -5,14 +5,30 @@ | |||
5 | # but requires more instructions (140% for 70% smaller code) so may be | 5 | # but requires more instructions (140% for 70% smaller code) so may be |
6 | # slower. | 6 | # slower. |
7 | TUNEVALID[thumb] = "Use thumb instructions instead of ARM" | 7 | TUNEVALID[thumb] = "Use thumb instructions instead of ARM" |
8 | ARM_THUMB_M_OPT = "${@['-marm', '-mthumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}" | 8 | ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}" |
9 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' ${ARM_THUMB_M_OPT}', '', d)}" | 9 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4', 't', '', d)}" |
10 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5', 't', '', d)}" | ||
11 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6', 't', '', d)}" | ||
12 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 't2', '', d)}" | ||
13 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 't2', '', d)}" | ||
14 | ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 't2', '', d)}" | ||
15 | |||
16 | # If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb") | ||
17 | # If the defice doesn't support ARM, then always set "thumb" even when | ||
18 | # some recipe explicitly sets ARM_INSTRUCTION_SET to "arm" | ||
19 | ARM_M_OPT = "${@bb.utils.contains('TUNE_FEATURES', 'arm', '${ARM_THUMB_OPT}', 'thumb', d)}" | ||
20 | python () { | ||
21 | selected = d.getVar('ARM_INSTRUCTION_SET', True) | ||
22 | used = d.getVar('ARM_M_OPT', True) | ||
23 | if selected != used: | ||
24 | pn = d.getVar('PN', True) | ||
25 | bb.warn("Recipe '%s' selects ARM_INSTRUCTION_SET to be '%s', but tune configuration overrides it to '%s'" % (pn, selected, used)) | ||
26 | } | ||
27 | |||
28 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}" | ||
10 | OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" | 29 | OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" |
11 | 30 | ||
12 | ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv4', 'thumb' ], 't', '', d)}" | 31 | ARMPKGSFX_THUMB .= "${ARM_THUMB_SUFFIX}" |
13 | ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv5', 'thumb' ], 't', '', d)}" | ||
14 | ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv6', 'thumb' ], 't', '', d)}" | ||
15 | ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv7a', 'thumb' ], 't2', '', d)}" | ||
16 | 32 | ||
17 | # Whether to compile with code to allow interworking between the two | 33 | # Whether to compile with code to allow interworking between the two |
18 | # instruction sets. This allows thumb code to be executed on a primarily | 34 | # instruction sets. This allows thumb code to be executed on a primarily |
@@ -22,4 +38,5 @@ TUNEVALID[no-thumb-interwork] = "Disable mixing of thumb and ARM functions" | |||
22 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ' -mno-thumb-interwork', ' -mthumb-interwork', d)}" | 38 | TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ' -mno-thumb-interwork', ' -mthumb-interwork', d)}" |
23 | OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ':thumb-interwork', '', d)}" | 39 | OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ':thumb-interwork', '', d)}" |
24 | 40 | ||
41 | # what about armv7m devices which don't support -marm (e.g. Cortex-M3)? | ||
25 | TARGET_CC_KERNEL_ARCH += "-mno-thumb-interwork -marm" | 42 | TARGET_CC_KERNEL_ARCH += "-mno-thumb-interwork -marm" |