diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2014-04-25 18:40:27 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-29 17:20:11 +0100 |
commit | d19e29a8e6c05bd8bf356a30fab1d24ec3402229 (patch) | |
tree | 62e4a82011c9b138a31eee89433394794e3cf72a /meta/conf/machine/include/arm/feature-arm-thumb.inc | |
parent | af76e86126574fa80f9dbae27496795950dd7547 (diff) | |
download | poky-d19e29a8e6c05bd8bf356a30fab1d24ec3402229.tar.gz |
feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES
* it will be inherited by most DEFAULTTUNEs, except few exceptions which
support only thumb and not arm
* respect missing "arm" in TUNE_FEATURES in feature-arm-thumb.inc, so
when recipe asks for "arm" and MACHINE supports only "thumb" ignore
recipe and try to build with "thumb"
* show warning when overriding ARM_INSTRUCTION_SET set by recipe from tune
config
(From OE-Core rev: 1250d3e009363d20f15bbfaced622c5912a7fb93)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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" |