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 | |
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')
-rw-r--r-- | meta/conf/machine/include/arm/arch-armv4.inc | 3 | ||||
-rw-r--r-- | meta/conf/machine/include/arm/arch-armv5.inc | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/arm/arch-armv6.inc | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/arm/arch-armv7a.inc | 2 | ||||
-rw-r--r-- | meta/conf/machine/include/arm/feature-arm-thumb.inc | 29 |
5 files changed, 28 insertions, 10 deletions
diff --git a/meta/conf/machine/include/arm/arch-armv4.inc b/meta/conf/machine/include/arm/arch-armv4.inc index c33c81690c..52c07a83cf 100644 --- a/meta/conf/machine/include/arm/arch-armv4.inc +++ b/meta/conf/machine/include/arm/arch-armv4.inc | |||
@@ -1,5 +1,6 @@ | |||
1 | DEFAULTTUNE ?= "armv4" | 1 | DEFAULTTUNE ?= "armv4" |
2 | 2 | ||
3 | TUNEVALID[arm] = "Enable ARM instruction set" | ||
3 | TUNEVALID[armv4] = "Enable instructions for ARMv4" | 4 | TUNEVALID[armv4] = "Enable instructions for ARMv4" |
4 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv4", " -march=armv4${ARMPKGSFX_THUMB}", "", d)}" | 5 | TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv4", " -march=armv4${ARMPKGSFX_THUMB}", "", d)}" |
5 | # enable --fix-v4bx when we have armv4 in TUNE_FEATURES, but then disable it when we have also armv5 or thumb | 6 | # enable --fix-v4bx when we have armv4 in TUNE_FEATURES, but then disable it when we have also armv5 or thumb |
@@ -18,7 +19,7 @@ require conf/machine/include/arm/feature-arm-thumb.inc | |||
18 | AVAILTUNES += "armv4 armv4t" | 19 | AVAILTUNES += "armv4 armv4t" |
19 | ARMPKGARCH_tune-armv4 ?= "armv4" | 20 | ARMPKGARCH_tune-armv4 ?= "armv4" |
20 | ARMPKGARCH_tune-armv4t ?= "armv4" | 21 | ARMPKGARCH_tune-armv4t ?= "armv4" |
21 | TUNE_FEATURES_tune-armv4 ?= "armv4" | 22 | TUNE_FEATURES_tune-armv4 ?= "arm armv4" |
22 | TUNE_FEATURES_tune-armv4t ?= "${TUNE_FEATURES_tune-armv4} thumb" | 23 | TUNE_FEATURES_tune-armv4t ?= "${TUNE_FEATURES_tune-armv4} thumb" |
23 | PACKAGE_EXTRA_ARCHS_tune-armv4 = "arm armv4" | 24 | PACKAGE_EXTRA_ARCHS_tune-armv4 = "arm armv4" |
24 | PACKAGE_EXTRA_ARCHS_tune-armv4t = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv4t" | 25 | PACKAGE_EXTRA_ARCHS_tune-armv4t = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv4t" |
diff --git a/meta/conf/machine/include/arm/arch-armv5.inc b/meta/conf/machine/include/arm/arch-armv5.inc index 9e8d1fa0a5..5cceafa06f 100644 --- a/meta/conf/machine/include/arm/arch-armv5.inc +++ b/meta/conf/machine/include/arm/arch-armv5.inc | |||
@@ -14,7 +14,7 @@ require conf/machine/include/arm/feature-arm-vfp.inc | |||
14 | AVAILTUNES += "armv5 armv5t" | 14 | AVAILTUNES += "armv5 armv5t" |
15 | ARMPKGARCH_tune-armv5 ?= "armv5" | 15 | ARMPKGARCH_tune-armv5 ?= "armv5" |
16 | ARMPKGARCH_tune-armv5t ?= "armv5" | 16 | ARMPKGARCH_tune-armv5t ?= "armv5" |
17 | TUNE_FEATURES_tune-armv5 ?= "armv5" | 17 | TUNE_FEATURES_tune-armv5 ?= "arm armv5" |
18 | TUNE_FEATURES_tune-armv5t ?= "${TUNE_FEATURES_tune-armv5} thumb" | 18 | TUNE_FEATURES_tune-armv5t ?= "${TUNE_FEATURES_tune-armv5} thumb" |
19 | PACKAGE_EXTRA_ARCHS_tune-armv5 = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5" | 19 | PACKAGE_EXTRA_ARCHS_tune-armv5 = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5" |
20 | PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t" | 20 | PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t" |
diff --git a/meta/conf/machine/include/arm/arch-armv6.inc b/meta/conf/machine/include/arm/arch-armv6.inc index 0adf73fae2..4b0c5bf2d1 100644 --- a/meta/conf/machine/include/arm/arch-armv6.inc +++ b/meta/conf/machine/include/arm/arch-armv6.inc | |||
@@ -15,7 +15,7 @@ ARMPKGARCH_tune-armv6 ?= "armv6" | |||
15 | ARMPKGARCH_tune-armv6t ?= "armv6" | 15 | ARMPKGARCH_tune-armv6t ?= "armv6" |
16 | ARMPKGARCH_tune-armv6hf ?= "armv6" | 16 | ARMPKGARCH_tune-armv6hf ?= "armv6" |
17 | ARMPKGARCH_tune-armv6thf ?= "armv6" | 17 | ARMPKGARCH_tune-armv6thf ?= "armv6" |
18 | TUNE_FEATURES_tune-armv6-novfp ?= "armv6" | 18 | TUNE_FEATURES_tune-armv6-novfp ?= "arm armv6" |
19 | TUNE_FEATURES_tune-armv6t-novfp ?= "${TUNE_FEATURES_tune-armv6-novfp} thumb" | 19 | TUNE_FEATURES_tune-armv6t-novfp ?= "${TUNE_FEATURES_tune-armv6-novfp} thumb" |
20 | TUNE_FEATURES_tune-armv6 ?= "${TUNE_FEATURES_tune-armv6-novfp} vfp" | 20 | TUNE_FEATURES_tune-armv6 ?= "${TUNE_FEATURES_tune-armv6-novfp} vfp" |
21 | TUNE_FEATURES_tune-armv6t ?= "${TUNE_FEATURES_tune-armv6t-novfp} vfp" | 21 | TUNE_FEATURES_tune-armv6t ?= "${TUNE_FEATURES_tune-armv6t-novfp} vfp" |
diff --git a/meta/conf/machine/include/arm/arch-armv7a.inc b/meta/conf/machine/include/arm/arch-armv7a.inc index bb36c39739..f2c04a302e 100644 --- a/meta/conf/machine/include/arm/arch-armv7a.inc +++ b/meta/conf/machine/include/arm/arch-armv7a.inc | |||
@@ -14,7 +14,7 @@ ARMPKGARCH_tune-armv7a ?= "armv7a" | |||
14 | ARMPKGARCH_tune-armv7at ?= "armv7a" | 14 | ARMPKGARCH_tune-armv7at ?= "armv7a" |
15 | ARMPKGARCH_tune-armv7a-neon?= "armv7a" | 15 | ARMPKGARCH_tune-armv7a-neon?= "armv7a" |
16 | ARMPKGARCH_tune-armv7at-neon ?= "armv7a" | 16 | ARMPKGARCH_tune-armv7at-neon ?= "armv7a" |
17 | TUNE_FEATURES_tune-armv7a ?= "armv7a vfp" | 17 | TUNE_FEATURES_tune-armv7a ?= "arm armv7a vfp" |
18 | TUNE_FEATURES_tune-armv7at ?= "${TUNE_FEATURES_tune-armv7a} thumb" | 18 | TUNE_FEATURES_tune-armv7at ?= "${TUNE_FEATURES_tune-armv7a} thumb" |
19 | TUNE_FEATURES_tune-armv7a-neon ?= "${TUNE_FEATURES_tune-armv7a} neon" | 19 | TUNE_FEATURES_tune-armv7a-neon ?= "${TUNE_FEATURES_tune-armv7a} neon" |
20 | TUNE_FEATURES_tune-armv7at-neon ?= "${TUNE_FEATURES_tune-armv7at} neon" | 20 | TUNE_FEATURES_tune-armv7at-neon ?= "${TUNE_FEATURES_tune-armv7at} neon" |
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" |