* [PATCH 0/5] Allow arm tunes which support only thumb
@ 2014-04-25 16:40 Martin Jansa
2014-04-25 16:40 ` [PATCH 1/5] feature-arm-thumb.inc: Replace inner quotes with apostrophes Martin Jansa
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
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(-)
--
1.9.1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/5] feature-arm-thumb.inc: Replace inner quotes with apostrophes
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
@ 2014-04-25 16:40 ` Martin Jansa
2014-04-25 16:40 ` [PATCH 2/5] feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES Martin Jansa
` (4 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
* so that it's highlighted correctly
---
meta/conf/machine/include/arm/feature-arm-thumb.inc | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
index fa3a4e5..d58c4b4 100644
--- a/meta/conf/machine/include/arm/feature-arm-thumb.inc
+++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/5] feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
2014-04-25 16:40 ` [PATCH 1/5] feature-arm-thumb.inc: Replace inner quotes with apostrophes Martin Jansa
@ 2014-04-25 16:40 ` Martin Jansa
2014-04-25 16:40 ` [PATCH 3/5] tune-cortexr4.inc: Add thumb and arm " Martin Jansa
` (3 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
* 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
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
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(-)
diff --git a/meta/conf/machine/include/arm/arch-armv4.inc b/meta/conf/machine/include/arm/arch-armv4.inc
index c33c816..52c07a8 100644
--- a/meta/conf/machine/include/arm/arch-armv4.inc
+++ b/meta/conf/machine/include/arm/arch-armv4.inc
@@ -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"
diff --git a/meta/conf/machine/include/arm/arch-armv5.inc b/meta/conf/machine/include/arm/arch-armv5.inc
index 9e8d1fa..5cceafa 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
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"
diff --git a/meta/conf/machine/include/arm/arch-armv6.inc b/meta/conf/machine/include/arm/arch-armv6.inc
index 0adf73f..4b0c5bf 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"
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"
diff --git a/meta/conf/machine/include/arm/arch-armv7a.inc b/meta/conf/machine/include/arm/arch-armv7a.inc
index bb36c39..f2c04a3 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"
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"
diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
index d58c4b4..8a38665 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"
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/5] tune-cortexr4.inc: Add thumb and arm to TUNE_FEATURES
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
2014-04-25 16:40 ` [PATCH 1/5] feature-arm-thumb.inc: Replace inner quotes with apostrophes Martin Jansa
2014-04-25 16:40 ` [PATCH 2/5] feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES Martin Jansa
@ 2014-04-25 16:40 ` Martin Jansa
2014-04-25 16:40 ` [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions Martin Jansa
` (2 subsequent siblings)
5 siblings, 0 replies; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/conf/machine/include/tune-cortexr4.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/conf/machine/include/tune-cortexr4.inc b/meta/conf/machine/include/tune-cortexr4.inc
index 57b6717..bde649f 100644
--- a/meta/conf/machine/include/tune-cortexr4.inc
+++ b/meta/conf/machine/include/tune-cortexr4.inc
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
` (2 preceding siblings ...)
2014-04-25 16:40 ` [PATCH 3/5] tune-cortexr4.inc: Add thumb and arm " Martin Jansa
@ 2014-04-25 16:40 ` Martin Jansa
2014-04-27 15:22 ` Phil Blundell
2014-04-25 16:40 ` [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix Martin Jansa
2014-04-25 16:51 ` [PATCH 0/5] Allow arm tunes which support only thumb Mark Hatle
5 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
From: Andrei Gherzan <andrei@gherzan.ro>
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."
Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/conf/machine/include/tune-cortexm3.inc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/conf/machine/include/tune-cortexm3.inc b/meta/conf/machine/include/tune-cortexm3.inc
index cbc4c0d..780baf4 100644
--- a/meta/conf/machine/include/tune-cortexm3.inc
+++ b/meta/conf/machine/include/tune-cortexm3.inc
@@ -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"
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
` (3 preceding siblings ...)
2014-04-25 16:40 ` [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions Martin Jansa
@ 2014-04-25 16:40 ` Martin Jansa
2014-04-25 17:04 ` Richard Purdie
2014-04-25 16:51 ` [PATCH 0/5] Allow arm tunes which support only thumb Mark Hatle
5 siblings, 1 reply; 10+ messages in thread
From: Martin Jansa @ 2014-04-25 16:40 UTC (permalink / raw)
To: openembedded-core
* 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
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
meta/conf/machine/include/arm/feature-arm-thumb.inc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
index 8a38665..6c5d1d6 100644
--- a/meta/conf/machine/include/arm/feature-arm-thumb.inc
+++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
@@ -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
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 0/5] Allow arm tunes which support only thumb
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
` (4 preceding siblings ...)
2014-04-25 16:40 ` [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix Martin Jansa
@ 2014-04-25 16:51 ` Mark Hatle
5 siblings, 0 replies; 10+ messages in thread
From: Mark Hatle @ 2014-04-25 16:51 UTC (permalink / raw)
To: openembedded-core
On 4/25/14, 11:40 AM, Martin Jansa wrote:
> 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
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
> 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(-)
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
2014-04-25 16:40 ` [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix Martin Jansa
@ 2014-04-25 17:04 ` Richard Purdie
2014-04-25 18:33 ` Denys Dmytriyenko
0 siblings, 1 reply; 10+ messages in thread
From: Richard Purdie @ 2014-04-25 17:04 UTC (permalink / raw)
To: Martin Jansa; +Cc: openembedded-core
On Fri, 2014-04-25 at 18:40 +0200, Martin Jansa wrote:
> * 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
>
> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> ---
> 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
> diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
> index 8a38665..6c5d1d6 100644
> --- a/meta/conf/machine/include/arm/feature-arm-thumb.inc
> +++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
> @@ -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
> --
> 1.9.1
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
2014-04-25 17:04 ` Richard Purdie
@ 2014-04-25 18:33 ` Denys Dmytriyenko
0 siblings, 0 replies; 10+ messages in thread
From: Denys Dmytriyenko @ 2014-04-25 18:33 UTC (permalink / raw)
To: Richard Purdie; +Cc: openembedded-core
On Fri, Apr 25, 2014 at 06:04:34PM +0100, Richard Purdie wrote:
> On Fri, 2014-04-25 at 18:40 +0200, Martin Jansa wrote:
> > * 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
> >
> > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > ---
> > 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.
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...
> > diff --git a/meta/conf/machine/include/arm/feature-arm-thumb.inc b/meta/conf/machine/include/arm/feature-arm-thumb.inc
> > index 8a38665..6c5d1d6 100644
> > --- a/meta/conf/machine/include/arm/feature-arm-thumb.inc
> > +++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
> > @@ -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
> > --
> > 1.9.1
> >
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions
2014-04-25 16:40 ` [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions Martin Jansa
@ 2014-04-27 15:22 ` Phil Blundell
0 siblings, 0 replies; 10+ messages in thread
From: Phil Blundell @ 2014-04-27 15:22 UTC (permalink / raw)
To: Martin Jansa; +Cc: openembedded-core
On Fri, 2014-04-25 at 18:40 +0200, Martin Jansa wrote:
> 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...
> 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.
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-04-27 15:22 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-25 16:40 [PATCH 0/5] Allow arm tunes which support only thumb Martin Jansa
2014-04-25 16:40 ` [PATCH 1/5] feature-arm-thumb.inc: Replace inner quotes with apostrophes Martin Jansa
2014-04-25 16:40 ` [PATCH 2/5] feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES Martin Jansa
2014-04-25 16:40 ` [PATCH 3/5] tune-cortexr4.inc: Add thumb and arm " Martin Jansa
2014-04-25 16:40 ` [PATCH 4/5] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions Martin Jansa
2014-04-27 15:22 ` Phil Blundell
2014-04-25 16:40 ` [PATCH 5/5] WIP: feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix Martin Jansa
2014-04-25 17:04 ` Richard Purdie
2014-04-25 18:33 ` Denys Dmytriyenko
2014-04-25 16:51 ` [PATCH 0/5] Allow arm tunes which support only thumb Mark Hatle
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox