All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Cc: openembedded-devel@lists.openembedded.org
Subject: Re: [PATCH][v3 3/4] uClibc: redo configuration
Date: Thu, 8 Jul 2010 15:55:28 -0700	[thread overview]
Message-ID: <AANLkTilg2lk8YMpOSAOZrQ7cqaxvOFRpnuFhSv840yzq@mail.gmail.com> (raw)
In-Reply-To: <20100708221633.GE23169@mx.loc>

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

On Thu, Jul 8, 2010 at 3:16 PM, Bernhard Reutner-Fischer
<rep.dot.nop@gmail.com> wrote:
> On Thu, Jul 08, 2010 at 03:03:04PM -0700, Khem Raj wrote:
>>On Thu, Jul 8, 2010 at 2:34 PM, Phil Blundell <philb@gnu.org> wrote:
>>> On Thu, 2010-07-08 at 14:31 -0700, Khem Raj wrote:
>>>> On Thu, Jul 8, 2010 at 2:29 PM, Phil Blundell <philb@gnu.org> wrote:
>>>> > On Thu, 2010-07-08 at 14:03 -0700, Khem Raj wrote:
>>>> >> If I am not wrong you can still do interworking and not have bx (using
>>>> >> mov pc,lr)
>>>> >
>>>> > That's not an interworking instruction in ARMv4T, and I don't think it
>>>> > is in ARMv5TE either.  You might be thinking of pop {pc}, which is
>>>> > interworking in ARMv5TE, but even this is not interworking in v4t.
>>>>
>>>> tst lr, #1
>>>> moveq pc, lr
>>>> bx lr
>>>>
>>>> Thats how its done on armv4 for EABI
>>>
>>> Right, but the MOV in that case is not an interworking instruction; it's
>>> just a way to avoid executing BX when you don't actually need to switch
>>> mode, so that you can create a library which still works in an ARM-only
>>> environment.
>>>
>>> The final BX in that sequence is mandatory in order for it to actually
>>> function as an interworking return.
>>
>>right you are. yes bx is always needed for thumb interworking. So I guess
>>for uclibc we can rely on THUMB_INTERWORK distro feature if set correctly.
>
> AFAIR eabi implies thumb, thumb makes interwork possible, interwork
> imples bx but my memory could fail me on this.

eabi does not imply thumb. EABI is supported on armv4 which does not have
thumb.

>
> Can you, khem, think of a set of "thumb" and "interwork" (and
> potentially "bx" for HW that supports it, like IIRC all e.g. cortex
> onward based designs) in DISTRO_FEATURES and MACHINE_FEATURES that can
> be used generically?
>
> A first step would be to just resuse the infrastructure in this thread,
> later on we could think about some sort of combined_feature mechanism to
> properly setup arm ontop of this proposed infrastructure.

I think we need thumb_interwork distro_feature which we could use here
here is a patch that distros would need.




>
> cheers,
>

[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 2280 bytes --]

diff --git a/conf/distro/include/sane-toolchain.inc b/conf/distro/include/sane-toolchain.inc
index 6b6b170..78591e2 100644
--- a/conf/distro/include/sane-toolchain.inc
+++ b/conf/distro/include/sane-toolchain.inc
@@ -86,7 +86,13 @@ ARM_INSTRUCTION_SET = "${PREFERRED_ARM_INSTRUCTION_SET}"
 #    but requires more instructions (140% for 70% smaller code) so may be
 #    slower.
 
-THUMB_INTERWORK = "yes"
+# armv4 does not have thumb instruction set therefore no interworking instructions
+# so if machine is based on armv4 we dont have choice.
+
+THUMB_INTERWORK_armv4 = "no"
+
+THUMB_INTERWORK ?= "yes"
+
 # "yes" "no"
 #    Whether to compile with code to allow interworking between the two
 #    instruction sets.  This allows thumb code to be executed on a primarily
diff --git a/conf/distro/minimal-uclibc.conf b/conf/distro/minimal-uclibc.conf
index 44805cf..35c77c8 100644
--- a/conf/distro/minimal-uclibc.conf
+++ b/conf/distro/minimal-uclibc.conf
@@ -44,3 +44,4 @@ DISTRO_FEATURES += "pam"
 DISTRO_FEATURES += "largefile"
 # glib-2.0 nneds ipv6 and there is no knob to control it
 DISTRO_FEATURES += "ipv4 ipv6"
+DISTRO_FEATURES_append_arm = ' ${@["thumb-interworking",""][bb.data.getVar('THUMB_INTERWORKING', d, 1) == "yes"]}'
diff --git a/conf/distro/minimal.conf b/conf/distro/minimal.conf
index e400c14..ea9f467 100644
--- a/conf/distro/minimal.conf
+++ b/conf/distro/minimal.conf
@@ -16,7 +16,7 @@ DISTRO_VERSION = "dev-snapshot-${SRCDATE}"
 DISTRO_TYPE ?= "debug"
 
 # Ensure some form of release config, so error out if someone thinks he knows better
-DISTRO_CHECK := "${@bb.data.getVar('DISTRO_VERSION',d,1) or bb.fatal('Remove this line or set a dummy DISTRO_VERSION")
+DISTRO_CHECK := "${@bb.data.getVar('DISTRO_VERSION',d,1) or bb.fatal('Remove this line or set a dummy DISTRO_VERSION')}"
 
 #############################################################################
 # FEATURE SELECTION
@@ -34,6 +34,8 @@ DISTRO_FEATURES += "eabi"
 
 DISTRO_FEATURES += "mplt"
 
+DISTRO_FEATURES_append_arm = ' ${@["thumb-interworking",""][bb.data.getVar('THUMB_INTERWORKING', d, 1) == "yes"]}'
+
 #############################################################################
 # LIBRARY NAMES
 #############################################################################

  reply	other threads:[~2010-07-09 10:32 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-06 19:32 [PATCH][v3 0/4] honour {MACHINE, DISTRO}_FEATURES for configuration Bernhard Reutner-Fischer
2010-07-06 19:32 ` [PATCH][v3 1/4] busybox: configure according to {MACHINE, DISTRO}_FEATURES Bernhard Reutner-Fischer
2010-07-06 19:32 ` [PATCH][v3 2/4] busybox: picking IPv6 per default is not up to the package Bernhard Reutner-Fischer
2010-07-06 19:32 ` [PATCH][v3 3/4] uClibc: redo configuration Bernhard Reutner-Fischer
2010-07-08 19:02   ` Khem Raj
2010-07-08 20:28     ` Bernhard Reutner-Fischer
2010-07-08 20:31       ` Khem Raj
2010-07-08 20:44         ` Bernhard Reutner-Fischer
2010-07-08 20:41       ` Khem Raj
2010-07-08 20:47     ` Phil Blundell
2010-07-08 21:03       ` Khem Raj
2010-07-08 21:29         ` Phil Blundell
2010-07-08 21:31           ` Khem Raj
2010-07-08 21:34             ` Phil Blundell
2010-07-08 22:03               ` Khem Raj
2010-07-08 22:16                 ` Bernhard Reutner-Fischer
2010-07-08 22:55                   ` Khem Raj [this message]
2010-07-08 21:12       ` Khem Raj
2010-07-08 21:32         ` Phil Blundell
2010-07-08 22:01           ` Khem Raj
2010-07-06 19:32 ` [PATCH][v3 4/4] uclibc: add 0.9.31 Bernhard Reutner-Fischer

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=AANLkTilg2lk8YMpOSAOZrQ7cqaxvOFRpnuFhSv840yzq@mail.gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    --cc=rep.dot.nop@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.