From d19e29a8e6c05bd8bf356a30fab1d24ec3402229 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Fri, 25 Apr 2014 18:40:27 +0200 Subject: 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 Signed-off-by: Saul Wold Signed-off-by: Richard Purdie --- .../conf/machine/include/arm/feature-arm-thumb.inc | 29 +++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'meta/conf/machine/include/arm/feature-arm-thumb.inc') 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 @@ # but requires more instructions (140% for 70% smaller code) so may be # slower. TUNEVALID[thumb] = "Use thumb instructions instead of ARM" -ARM_THUMB_M_OPT = "${@['-marm', '-mthumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}" -TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' ${ARM_THUMB_M_OPT}', '', d)}" +ARM_THUMB_OPT = "${@['arm', 'thumb'][d.getVar('ARM_INSTRUCTION_SET', True) == 'thumb']}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv4', 't', '', d)}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv5', 't', '', d)}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv6', 't', '', d)}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7a', 't2', '', d)}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7r', 't2', '', d)}" +ARM_THUMB_SUFFIX .= "${@bb.utils.contains('TUNE_FEATURES', 'armv7m', 't2', '', d)}" + +# If the device supports ARM, then respect ARM_THUMB_OPT (which can be "arm" or "thumb") +# If the defice doesn't support ARM, then always set "thumb" even when +# some recipe explicitly sets ARM_INSTRUCTION_SET to "arm" +ARM_M_OPT = "${@bb.utils.contains('TUNE_FEATURES', 'arm', '${ARM_THUMB_OPT}', 'thumb', d)}" +python () { + selected = d.getVar('ARM_INSTRUCTION_SET', True) + used = d.getVar('ARM_M_OPT', True) + if selected != used: + pn = d.getVar('PN', True) + bb.warn("Recipe '%s' selects ARM_INSTRUCTION_SET to be '%s', but tune configuration overrides it to '%s'" % (pn, selected, used)) +} + +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}" OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" -ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv4', 'thumb' ], 't', '', d)}" -ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv5', 'thumb' ], 't', '', d)}" -ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv6', 'thumb' ], 't', '', d)}" -ARMPKGSFX_THUMB .= "${@bb.utils.contains('TUNE_FEATURES', [ 'armv7a', 'thumb' ], 't2', '', d)}" +ARMPKGSFX_THUMB .= "${ARM_THUMB_SUFFIX}" # Whether to compile with code to allow interworking between the two # 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" TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ' -mno-thumb-interwork', ' -mthumb-interwork', d)}" OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'no-thumb-interwork', ':thumb-interwork', '', d)}" +# what about armv7m devices which don't support -marm (e.g. Cortex-M3)? TARGET_CC_KERNEL_ARCH += "-mno-thumb-interwork -marm" -- cgit v1.2.3-54-g00ecf