Allow arm tunes which support only thumb
cover Allow arm tunes which support only thumb
Now with 1.7 open for new changes can we please apply first 4 patches?
The following changes since commit 866d2854139e0b00063dde06bc3a34d635ae2fc8:
build-appliance-image: Update to head revision (2014-04-24 17:54:58 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib jansa/tune
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/tune
Andrei Gherzan (1):
tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
Martin Jansa (4):
feature-arm-thumb.inc: Replace inner quotes with apostrophes feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES tune-cortexr4.inc: Add thumb and arm to TUNE_FEATURES
WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding
thumb suffix
meta/conf/machine/include/arm/arch-armv4.inc | 3 +- meta/conf/machine/include/arm/arch-armv5.inc | 2 +- meta/conf/machine/include/arm/arch-armv6.inc | 2 +- meta/conf/machine/include/arm/arch-armv7a.inc | 2 +- .../conf/machine/include/arm/feature-arm-thumb.inc | 36 ++++++++++++++++------ meta/conf/machine/include/tune-cortexm3.inc | 2 +- meta/conf/machine/include/tune-cortexr4.inc | 2 +- 7 files changed, 34 insertions(+), 15 deletions(-)
Signature · 1 line
1.9.1
PATCH 1/5 feature-arm-thumb.inc: Replace inner quotes with apostrophes
* so that it's highlighted correctly
--- meta/conf/machine/include/arm/feature-arm-thumb.inc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
meta/conf/machine/include/arm/feature-arm-thumb.inc +8 -8
@@ -6,20 +6,20 @@ # 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)}" -OVERRIDES .= "${@bb.utils.contains("TUNE_FEATURES", "thumb", ":thumb", "", d)}" +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' ${ARM_THUMB_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 .= "${@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)}" # Whether to compile with code to allow interworking between the two # instruction sets. This allows thumb code to be executed on a primarily # arm system and vice versa. It is strongly recommended that DISTROs not # turn this off - the actual cost is very small. 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)}" +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)}" TARGET_CC_KERNEL_ARCH += "-mno-thumb-interwork -marm"
Signature · 1 line
1.9.1
PATCH 2/5 feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES
In reply to Martin Jansa* 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
--- meta/conf/machine/include/arm/arch-armv4.inc | 3 ++- meta/conf/machine/include/arm/arch-armv5.inc | 2 +- meta/conf/machine/include/arm/arch-armv6.inc | 2 +- meta/conf/machine/include/arm/arch-armv7a.inc | 2 +- .../conf/machine/include/arm/feature-arm-thumb.inc | 29 +++++++++++++++++----- 5 files changed, 28 insertions(+), 10 deletions(-)
meta/conf/machine/include/arm/arch-armv4.inc +2 -1
@@ -1,5 +1,6 @@ DEFAULTTUNE ?= "armv4" +TUNEVALID[arm] = "Enable ARM instruction set" TUNEVALID[armv4] = "Enable instructions for ARMv4" TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv4", " -march=armv4${ARMPKGSFX_THUMB}", "", d)}" # 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 AVAILTUNES += "armv4 armv4t" ARMPKGARCH_tune-armv4 ?= "armv4" ARMPKGARCH_tune-armv4t ?= "armv4" -TUNE_FEATURES_tune-armv4 ?= "armv4" +TUNE_FEATURES_tune-armv4 ?= "arm armv4" TUNE_FEATURES_tune-armv4t ?= "${TUNE_FEATURES_tune-armv4} thumb" PACKAGE_EXTRA_ARCHS_tune-armv4 = "arm armv4" PACKAGE_EXTRA_ARCHS_tune-armv4t = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv4t"
meta/conf/machine/include/arm/arch-armv5.inc +1 -1
@@ -14,7 +14,7 @@ require conf/machine/include/arm/feature-arm-vfp.inc AVAILTUNES += "armv5 armv5t" ARMPKGARCH_tune-armv5 ?= "armv5" ARMPKGARCH_tune-armv5t ?= "armv5" -TUNE_FEATURES_tune-armv5 ?= "armv5" +TUNE_FEATURES_tune-armv5 ?= "arm armv5" TUNE_FEATURES_tune-armv5t ?= "${TUNE_FEATURES_tune-armv5} thumb" PACKAGE_EXTRA_ARCHS_tune-armv5 = "${PACKAGE_EXTRA_ARCHS_tune-armv4} armv5" PACKAGE_EXTRA_ARCHS_tune-armv5t = "${PACKAGE_EXTRA_ARCHS_tune-armv4t} armv5 armv5t"
meta/conf/machine/include/arm/arch-armv6.inc +1 -1
@@ -15,7 +15,7 @@ ARMPKGARCH_tune-armv6 ?= "armv6" ARMPKGARCH_tune-armv6t ?= "armv6" ARMPKGARCH_tune-armv6hf ?= "armv6" ARMPKGARCH_tune-armv6thf ?= "armv6" -TUNE_FEATURES_tune-armv6-novfp ?= "armv6" +TUNE_FEATURES_tune-armv6-novfp ?= "arm armv6" TUNE_FEATURES_tune-armv6t-novfp ?= "${TUNE_FEATURES_tune-armv6-novfp} thumb" TUNE_FEATURES_tune-armv6 ?= "${TUNE_FEATURES_tune-armv6-novfp} vfp" TUNE_FEATURES_tune-armv6t ?= "${TUNE_FEATURES_tune-armv6t-novfp} vfp"
meta/conf/machine/include/arm/arch-armv7a.inc +1 -1
@@ -14,7 +14,7 @@ ARMPKGARCH_tune-armv7a ?= "armv7a" ARMPKGARCH_tune-armv7at ?= "armv7a" ARMPKGARCH_tune-armv7a-neon?= "armv7a" ARMPKGARCH_tune-armv7at-neon ?= "armv7a" -TUNE_FEATURES_tune-armv7a ?= "armv7a vfp" +TUNE_FEATURES_tune-armv7a ?= "arm armv7a vfp" TUNE_FEATURES_tune-armv7at ?= "${TUNE_FEATURES_tune-armv7a} thumb" TUNE_FEATURES_tune-armv7a-neon ?= "${TUNE_FEATURES_tune-armv7a} neon" TUNE_FEATURES_tune-armv7at-neon ?= "${TUNE_FEATURES_tune-armv7at} neon"
meta/conf/machine/include/arm/feature-arm-thumb.inc +23 -6
@@ -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"
Signature · 1 line
1.9.1
PATCH 3/5 tune-cortexr4.inc: Add thumb and arm to TUNE_FEATURES
In reply to Martin Jansa--- meta/conf/machine/include/tune-cortexr4.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/include/tune-cortexr4.inc +1 -1
@@ -10,5 +10,5 @@ TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv7r", " -march=armv7-r AVAILTUNES += "cortexr4" ARMPKGARCH_tune-cortexr4 = "armv7r" -TUNE_FEATURES_tune-cortexr4 = "armv7r vfp cortexr4" +TUNE_FEATURES_tune-cortexr4 = "armv7r vfp cortexr4 arm thumb" PACKAGE_EXTRA_ARCHS_tune-cortexr4 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7r-vfp"
Signature · 1 line
1.9.1
PATCH 4/5 tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
In reply to Martin JansaFrom: Andrei Gherzan <[email protected]>
Use thumb instructions for Cortex-M3 to avoid this gcc error:
'error: target CPU does not support ARM mode'.
Extracted from "Cortex-M3 Technical Reference Manual":
"The processor implements the ARM v7-M architecture. This includes the entire 16-bit Thumb instruction set and the base Thumb-2 32-bit instruction set architecture. The processor cannot execute ARM instructions."
--- meta/conf/machine/include/tune-cortexm3.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/machine/include/tune-cortexm3.inc +1 -1
@@ -10,5 +10,5 @@ TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", "armv7m", " -march=armv7-m AVAILTUNES += "cortexm3" ARMPKGARCH_tune-cortexm3 = "armv7m" -TUNE_FEATURES_tune-cortexm3 = "armv7m vfp cortexm3" +TUNE_FEATURES_tune-cortexm3 = "armv7m vfp cortexm3 thumb" PACKAGE_EXTRA_ARCHS_tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7m-vfp"
Signature · 1 line
1.9.1
Re: [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
Quoted 4 lines · Martin Jansa
Extracted from "Cortex-M3 Technical Reference Manual":
"The processor implements the ARM v7-M architecture. This includes the entire 16-bit Thumb instruction set and the base Thumb-2 32-bit instruction set architecture. The processor cannot execute ARM instructions."
This is true, though it's worth noting that the Thumb-only restriction is generic to ARMv7-M and not specific to Cortex-M3. This tune file seems to conflate the architecture and the particular CPU slightly and it seems like some refactoring might be desirable, though obviously that doesn't make your patch wrong. Also...
Quoted 1 line
PACKAGE_EXTRA_ARCHS_tune-cortexm3 = "${PACKAGE_EXTRA_ARCHS_tune-armv7at} armv7m-vfp"
... this seems a bit bogus. Presumably ${PACKAGE_EXTRA_ARCHS_tune-armv7at} will include "arm" and a bunch of other architectures, some of which (e.g. armv4) are more or less guaranteed to be 32-bit code. Without a wholesale rethink of the way that PACKAGE_ARCHs are done on arm, it doesn't seem very safe for armv7m machines to admit any earlier architecture at all in their PACKAGE_EXTRA_ARCHS.
p.
PATCH 5/5 WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
In reply to Martin Jansa* this means that recipes with ARM_INSTRUCTION_SET explicitly changed to arm will be built in feed without thumb suffix
* It looks like the rest of system doesn't correctly support different TUNE_PKGARCHs for different recipes (e.g. eglibc-initial fails) so this needs a bit more work
config.log: configure:2768: arm-oe-linux-gnueabi-gcc -march=armv5e -marm -mthumb-interwork --sysroot=/OE/build/oe-core/tmp-eglibc/sysroots/qemuarm -c -O2 -pipe -g -feliminate-unused-debug-types conftest.c >&5 /OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/eglibc-2.18/libc/configure: line 2770: arm-oe-linux-gnueabi-gcc: command not found configure:2772: $? = 127
and the problem is basically that STAGING_BINDIR_TOOLCHAIN points to different directory when building recipe with thumb enabled and disabled, in this case gcc was built with thumb enabled and is installed in:
sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi
OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi arm-oe-linux-gnueabi-addr2line arm-oe-linux-gnueabi-elfedit
arm-oe-linux-gnueabi-nm arm-oe-linux-gnueabi-readelf
arm-oe-linux-gnueabi-ar arm-oe-linux-gnueabi-gprof
arm-oe-linux-gnueabi-objcopy arm-oe-linux-gnueabi-size
arm-oe-linux-gnueabi-as arm-oe-linux-gnueabi-ld
arm-oe-linux-gnueabi-objdump arm-oe-linux-gnueabi-strings
arm-oe-linux-gnueabi-c++filt arm-oe-linux-gnueabi-ld.bfd
arm-oe-linux-gnueabi-ranlib arm-oe-linux-gnueabi-strip
but when building eglibc-initial with thumb disalbed, TUNE_PKGARCH becames armv5e and STAGING_BINDIR_TOOLCHAIN in PATH points to wrong dir:
$STAGING_BINDIR_TOOLCHAIN
set conf/bitbake.conf:354
"${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}"
STAGING_BINDIR_TOOLCHAIN="/OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi" OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi
ls: cannot access /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi: No such file or directory
--- meta/conf/machine/include/arm/feature-arm-thumb.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
meta/conf/machine/include/arm/feature-arm-thumb.inc +2 -1
@@ -28,7 +28,8 @@ python () { TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}" OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" -ARMPKGSFX_THUMB .= "${ARM_THUMB_SUFFIX}" +# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb +ARMPKGSFX_THUMB .= "${@ d.getVar('ARM_THUMB_SUFFIX', True) if d.getVar('ARM_M_OPT', True) == 'thumb' else ''}" # Whether to compile with code to allow interworking between the two # instruction sets. This allows thumb code to be executed on a primarily
Signature · 1 line
1.9.1
Re: [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
Quoted 36 lines · Martin Jansa
* this means that recipes with
ARM_INSTRUCTION_SETexplicitly changed to arm will be built in feed without thumb suffix
* It looks like the rest of system doesn't correctly support differentTUNE_PKGARCHsfor different recipes (e.g. eglibc-initial fails) so this needs a bit more workconfig.log: configure:2768: arm-oe-linux-gnueabi-gcc -march=armv5e -marm -mthumb-interwork --sysroot=/OE/build/oe-core/tmp-eglibc/sysroots/qemuarm -c -O2 -pipe -g -feliminate-unused-debug-types conftest.c >&5 /OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/eglibc-2.18/libc/configure: line 2770: arm-oe-linux-gnueabi-gcc: command not found configure:2772: $? = 127and the problem is basically that
STAGING_BINDIR_TOOLCHAINpoints to different directory when building recipe with thumb enabled and disabled, in this case gcc was built with thumb enabled and is installed in:sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi
OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi arm-oe-linux-gnueabi-addr2line arm-oe-linux-gnueabi-elfedit
arm-oe-linux-gnueabi-nm arm-oe-linux-gnueabi-readelf
arm-oe-linux-gnueabi-ar arm-oe-linux-gnueabi-gprof
arm-oe-linux-gnueabi-objcopy arm-oe-linux-gnueabi-size
arm-oe-linux-gnueabi-as arm-oe-linux-gnueabi-ld
arm-oe-linux-gnueabi-objdump arm-oe-linux-gnueabi-strings
arm-oe-linux-gnueabi-c++filt arm-oe-linux-gnueabi-ld.bfd
arm-oe-linux-gnueabi-ranlib arm-oe-linux-gnueabi-stripbut when building eglibc-initial with thumb disalbed,
TUNE_PKGARCHbecames armv5e andSTAGING_BINDIR_TOOLCHAINin PATH points to wrong dir:$STAGING_BINDIR_TOOLCHAIN set conf/bitbake.conf:354 "${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" STAGING_BINDIR_TOOLCHAIN="/OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi"
Quoted 7 lines
OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi
ls: cannot access /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi: No such file or directorySigned-off-by Martin Jansa <[email protected]>--- meta/conf/machine/include/arm/feature-arm-thumb.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
You might find my WIP gcc changes happen to fix some of the issues you're running into here since there is one compiler for all of arm regardless of tune.
Half of this merged to master, the other half is roughly what is on the top of:
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rpurdie/t222
although this is still WIP too.
Cheers,
Richard
Quoted 17 lines
meta/conf/machine/include/arm/feature-arm-thumb.inc +2
-1@@ -28,7 +28,8 @@ python () { TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}" OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" -ARMPKGSFX_THUMB .= "${ARM_THUMB_SUFFIX}" +# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb +ARMPKGSFX_THUMB .= "${@ d.getVar('ARM_THUMB_SUFFIX', True) if d.getVar('ARM_M_OPT', True) == 'thumb' else ''}" # Whether to compile with code to allow interworking between the two # instruction sets. This allows thumb code to be executed on a primarilySignature · 1 line
1.9.1
Re: [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
Quoted 49 lines · Richard Purdie
Quoted 36 lines · Martin Jansa
* this means that recipes with
ARM_INSTRUCTION_SETexplicitly changed to arm will be built in feed without thumb suffix
* It looks like the rest of system doesn't correctly support differentTUNE_PKGARCHsfor different recipes (e.g. eglibc-initial fails) so this needs a bit more workconfig.log: configure:2768: arm-oe-linux-gnueabi-gcc -march=armv5e -marm -mthumb-interwork --sysroot=/OE/build/oe-core/tmp-eglibc/sysroots/qemuarm -c -O2 -pipe -g -feliminate-unused-debug-types conftest.c >&5 /OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/eglibc-2.18/libc/configure: line 2770: arm-oe-linux-gnueabi-gcc: command not found configure:2772: $? = 127and the problem is basically that
STAGING_BINDIR_TOOLCHAINpoints to different directory when building recipe with thumb enabled and disabled, in this case gcc was built with thumb enabled and is installed in:sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi
OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5te-oe-linux-gnueabi arm-oe-linux-gnueabi-addr2line arm-oe-linux-gnueabi-elfedit
arm-oe-linux-gnueabi-nm arm-oe-linux-gnueabi-readelf
arm-oe-linux-gnueabi-ar arm-oe-linux-gnueabi-gprof
arm-oe-linux-gnueabi-objcopy arm-oe-linux-gnueabi-size
arm-oe-linux-gnueabi-as arm-oe-linux-gnueabi-ld
arm-oe-linux-gnueabi-objdump arm-oe-linux-gnueabi-strings
arm-oe-linux-gnueabi-c++filt arm-oe-linux-gnueabi-ld.bfd
arm-oe-linux-gnueabi-ranlib arm-oe-linux-gnueabi-stripbut when building eglibc-initial with thumb disalbed,
TUNE_PKGARCHbecames armv5e andSTAGING_BINDIR_TOOLCHAINin PATH points to wrong dir:$STAGING_BINDIR_TOOLCHAIN set conf/bitbake.conf:354 "${STAGING_DIR_NATIVE}${bindir_native}/${TUNE_PKGARCH}${TARGET_VENDOR}-${TARGET_OS}" STAGING_BINDIR_TOOLCHAIN="/OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi"Quoted 7 lines
OE qemuarm@ ~/build/oe-core $ ls /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi
ls: cannot access /OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin/armv5e-oe-linux-gnueabi: No such file or directorySigned-off-by Martin Jansa <[email protected]>--- meta/conf/machine/include/arm/feature-arm-thumb.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)You might find my WIP gcc changes happen to fix some of the issues you're running into here since there is one compiler for all of arm regardless of tune.
Quoted 6 lines
Half of this merged to master, the other half is roughly what is on the top of:
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=rpurdie/t222
although this is still WIP too.
Heh, and I was also looking into STAGING_BINDIR_TOOLCHAIN and TUNE_PKGARCH issues lately, although for slightly different reason. I'll be sure to check your WIP fixes soon...
Quoted 24 lines
Quoted 17 lines
meta/conf/machine/include/arm/feature-arm-thumb.inc +2
-1@@ -28,7 +28,8 @@ python () { TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_M_OPT}', '', d)}" OVERRIDES .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ':thumb', '', d)}" -ARMPKGSFX_THUMB .= "${ARM_THUMB_SUFFIX}" +# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_M_OPT to thumb +ARMPKGSFX_THUMB .= "${@ d.getVar('ARM_THUMB_SUFFIX', True) if d.getVar('ARM_M_OPT', True) == 'thumb' else ''}" # Whether to compile with code to allow interworking between the two # instruction sets. This allows thumb code to be executed on a primarilySignature · 1 line
1.9.1Signature · 4 lines
_______________________________________________ Openembedded-core mailing list [email protected] http://lists.openembedded.org/mailman/listinfo/openembedded-core
Quoted 14 lines · Martin Jansa
Now with 1.7 open for new changes can we please apply first 4 patches?
The following changes since commit
866d2854139e0b00063dde06bc3a34d635ae2fc8:build-appliance-image: Update to head revision (2014-04-24 17:54:58 +0100)are available in the git repository at:
git://git.openembedded.org/openembedded-core-contribjansa/tune
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=jansa/tuneAndrei Gherzan (1):
tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
Quoted 6 lines
Martin Jansa (4):
feature-arm-thumb.inc: Replace inner quotes with apostrophes feature-arm-thumb.inc, arch-armv4.inc: Add "arm" toTUNE_FEATUREStune-cortexr4.inc: Add thumb and arm toTUNE_FEATURES
WIP: feature-arm-thumb.inc: respectARM_INSTRUCTION_SETwhen adding
thumb suffix
I looked these over and I do like what I see.
The last WIP item is what I originally wanted to implement.. but at the time was told not to do it that way... so I'm more then happy to support the package arch clearly indicating if thumb was enabled for compilation or not.
--Mark
Quoted 9 lines
meta/conf/machine/include/arm/arch-armv4.inc | 3 +- meta/conf/machine/include/arm/arch-armv5.inc | 2 +- meta/conf/machine/include/arm/arch-armv6.inc | 2 +- meta/conf/machine/include/arm/arch-armv7a.inc | 2 +- .../conf/machine/include/arm/feature-arm-thumb.inc | 36 ++++++++++++++++------ meta/conf/machine/include/tune-cortexm3.inc | 2 +- meta/conf/machine/include/tune-cortexr4.inc | 2 +- 7 files changed, 34 insertions(+), 15 deletions(-)