Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH][RFC][WIP 3/6] feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix
Date: Fri, 31 Jan 2014 20:03:20 +0100	[thread overview]
Message-ID: <20140131190320.GY3718@jama> (raw)
In-Reply-To: <20140131184645.GX3718@jama>

[-- Attachment #1: Type: text/plain, Size: 6587 bytes --]

On Fri, Jan 31, 2014 at 07:46:45PM +0100, Martin Jansa wrote:
> On Fri, Jan 31, 2014 at 06:38:00PM +0100, Martin Jansa wrote:
> > On Wed, Jan 22, 2014 at 01:36:08AM +0100, Martin Jansa wrote:
> > > * this means that recipes with ARM_INSTRUCTION_SET explicitly changed
> > >   to arm will be built in feed without thumb suffix
> > > * I'm not sure if the rest of system correctly supports different
> > >   TUNE_PKGARCHs for different recipes, this is one of the reasons why
> > >   this is WIP/RFC
> > > 
> > > Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
> > > ---
> > >  meta/conf/machine/include/arm/feature-arm-thumb.inc | 17 +++++++++++------
> > >  1 file changed, 11 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 d58c4b4..09a127a 100644
> > > --- a/meta/conf/machine/include/arm/feature-arm-thumb.inc
> > > +++ b/meta/conf/machine/include/arm/feature-arm-thumb.inc
> > > @@ -5,14 +5,19 @@
> > >  # 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)}"
> > > +
> > > +TUNE_CCARGS .= "${@bb.utils.contains('TUNE_FEATURES', 'thumb', ' -m${ARM_THUMB_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)}"
> > > +# Add suffix from ARM_THUMB_SUFFIX only if after all this we still set ARM_THUMB_OPT to thumb
> > > +ARMPKGSFX_THUMB .= "${@ d.getVar('ARM_THUMB_SUFFIX', True) if d.getVar('ARM_THUMB_OPT', True) == 'thumb'] else ''}"
> > 
> > In branch I've removed extra ']' in this line and moved this patch as
> > last in series, because it's really not ready for merge (eglibc-initial
> > fails).
> 
> Ah, there was another issue in 4/6 and "arm" TUNE_FEATURE wasn't
> inherited by higher architectures, so it was correctly forcing "thumb"
> mode - that's why eglibc-initial was failing and now it isn't.

OMG sorry for noise, yes there is still problem when missing thumb and
arm builds for the same machine with different PKGARCH and
eglibc-initial still fails

| checking build system type... x86_64-pc-linux-gnu
| checking host system type... arm-oe-linux-gnueabi
| checking for arm-oe-linux-gnueabi-gcc... arm-oe-linux-gnueabi-gcc  -march=armv5e -marm -mthumb-interwork --sysroot=/OE/build/oe-core/tmp-eglibc/sysroots/qemuarm
| checking for suffix of object files... configure: error: in `/OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/build-arm-oe-linux-gnueabi':
| configure: error: cannot compute suffix of object files: cannot compile
| See `config.log' for more details
| WARNING: /OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/temp/run.do_configure.3925:1 exit 1 from
|   /OE/build/oe-core/tmp-eglibc/work/armv5e-oe-linux-gnueabi/eglibc-initial/2.18-r0/eglibc-2.18/libc/configure --host=arm-oe-linux-gnueabi --build=x86_64-linux --prefix=/usr --without-cvs --disable-sanity-checks --with-headers=/OE/build/oe-core/tmp-eglibc/sysroots/qemuarm/usr/include --with-kconfig=/OE/build/oe-core/tmp-eglibc/sysroots/x86_64-linux/usr/bin --enable-hacker-mode --enable-addons

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

Any idea how to resolve this correctly?
-- 
Martin 'JaMa' Jansa     jabber: Martin.Jansa@gmail.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 205 bytes --]

  reply	other threads:[~2014-01-31 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22  0:36 [PATCH][RFC][WIP 0/6] thumb tune feature improvements Martin Jansa
2014-01-22  0:36 ` [PATCH][RFC][WIP 1/6] feature-arm-thumb.inc: Fix missing t2 suffix for armv7a MACHINEs Martin Jansa
2014-01-22  0:36 ` [PATCH][RFC][WIP 2/6] feature-arm-thumb.inc: Replace inner quotes with apostrophes Martin Jansa
2014-01-22  0:36 ` [PATCH][RFC][WIP 3/6] feature-arm-thumb.inc: respect ARM_INSTRUCTION_SET when adding thumb suffix Martin Jansa
2014-01-31 17:38   ` Martin Jansa
2014-01-31 18:46     ` Martin Jansa
2014-01-31 19:03       ` Martin Jansa [this message]
2014-01-22  0:36 ` [PATCH][RFC][WIP 4/6] feature-arm-thumb.inc, arch-armv4.inc: Add "arm" to TUNE_FEATURES Martin Jansa
2014-01-22  0:36 ` [PATCH][RFC][WIP 5/6] tune-cortexr4.inc: Add thumb and arm " Martin Jansa
2014-01-22  0:36 ` [PATCH][RFC][WIP 6/6] tune-cortexm3.inc: Cortex-M3 doesn't support ARM instructions Martin Jansa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140131190320.GY3718@jama \
    --to=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox