mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Justin Cormack <justin@specialbusservice.com>
To: musl@lists.openwall.com
Subject: Re: thumb2 support
Date: Sun, 4 May 2014 14:56:49 +0100	[thread overview]
Message-ID: <CAK4o1WxSn_2meoXGXM+-WA4q4BCFrufAq2NC7KTjhS6rFJCieQ@mail.gmail.com> (raw)
In-Reply-To: <20140504120123.GB23751@brightrain.aerifal.cx>

On Sun, May 4, 2014 at 1:01 PM, Rich Felker <dalias@libc.org> wrote:
> On Sun, May 04, 2014 at 12:54:40PM +0100, Justin Cormack wrote:
>> On Wed, Apr 30, 2014 at 8:03 PM, Rich Felker <dalias@libc.org> wrote:
>> > On Tue, Apr 29, 2014 at 06:09:14PM +0200, Wermut wrote:
>> >> Hi
>> >>
>> >> I have tested the patch from Stephen Thomas at least for gcc 4.6, 4.7
>> >> and 4.8. Seems to work. Would be nice if the 1.1.1 release will
>> >> include a fix.
>> >
>> > It only works for armv7. On armv6k, I'm getting errors that the
>> > instructions aren't supported. I think we could simply add !thumb as a
>> > condition for the whole block...
>>
>> The patch has the wrong conditional in, there are no standard
>> __thumb__ and __thumb2__ defines, it is __ARM_ARCH_ISA_THUMB being 1
>> or 2 that differentiates. armv6k does not support thumb2. I should
>> have enough machines of different flavours to make a working patch.
>
> I don't see __ARM_ARCH_ISA_THUMB getting defined at all (gcc 4.7.1) so
> it doesn't seem reliable. __THUMBEL__ is defined in thumb mode
> (presumably the EL is for little endian?) but that's the only thing
> I'm getting that seems relevant other than __thumb__.

I was wrong, sorry, __thumb__ and __thumb2__ are defined. Maybe
__ARM_ARCH_ISA_THUMB does seem to be not defined always.

>> We should be able to support just using thumb2, for thumb 1 I guess we
>> can support a mixed mode with some files like this compiled for arm
>> only, but the rest compiled with thumb, with interop turned on. Not
>> sure how messy this will turn out to be.
>
> armv6 does not seem to have thumb2, does it? And for armv7 I think it
> should be reasonable to assume any thumb support is thumb2. Is this
> wrong? Aside from the question of the macro name, I think the current
> patch covers all cases that can be covered. (BTW as far as I can tell
> there's no good reason to ever compile with -mthumb for pre-v7, but it
> doesn't hurt to support it. All the asm is arm mode anyway, so -mthumb
> doesn't get you the ability to run on obscure hardware that's
> thumb-only unless you rewrite all the asm too.)

Some armv6 machines have thumb2, but not many (ARMv6T2 apparently, I
don't have one I don't think). All v7 machines do have (only) thumb2.
So you could test ARM_ARCH_6T2 or __thumb2__.

Alternatively it seems you can compile with -Wa,-mimplicit-it=always
and you don't need the patch at all. That could make it easier in
future.

So far all the thumb2-only hardware has no MMU, so less likely to be
using musl...

Justin


  reply	other threads:[~2014-05-04 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  3:36 Stephen Thomas
2014-04-28 12:06 ` Szabolcs Nagy
2014-04-28 14:27   ` Rich Felker
2014-04-28 23:52     ` Stephen Thomas
2014-04-29  0:56       ` Rich Felker
2014-04-29  1:14         ` Stephen Thomas
2014-04-29 16:09           ` Wermut
2014-04-30 19:03             ` Rich Felker
2014-05-04 11:54               ` Justin Cormack
2014-05-04 12:01                 ` Rich Felker
2014-05-04 13:56                   ` Justin Cormack [this message]
2014-05-04 14:09                     ` Rich Felker

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=CAK4o1WxSn_2meoXGXM+-WA4q4BCFrufAq2NC7KTjhS6rFJCieQ@mail.gmail.com \
    --to=justin@specialbusservice.com \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).