mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Pierluigi Passaro <pierluigi.passaro@phoenixsoftware.it>
To: musl@lists.openwall.com
Subject: Re: Cortex-M support
Date: Thu, 13 Sep 2018 03:06:52 +0200	[thread overview]
Message-ID: <97041122-710c-0b4c-d4de-d89d87a9ee83@phoenixsoftware.it> (raw)
In-Reply-To: <20180913005257.GC1878@brightrain.aerifal.cx>

This looks a good starting point: I'm targeting Cortex-M4 / M7 and maybe 
Cortex-R.
I'm inspecting the code and trying to get a build.
I have a few questions:

1) NOMMU support looks disabled
I'm wondering if in the file arch/arm/reloc.h, some code should be added 
(or not).
Somthing like
    #if (__ARM_ARCH_PROFILE == 'M') || (__ARM_ARCH_PROFILE == 'R')
    #define DL_NOMMU_SUPPORT 1
    #endif

2) trying to enable hardfp support, the build fails
- fabs try calling vabs.f64 assembly instruction
- sqrt try calling vsqrt.f64 assembly instruction
As far as I understood, vXXX.f64 instructions are only available with 
single/double precision FPU, not with half precision.
I'm wondering if the assembly optimization should be wrapped by 
something like
    #if ... && (__ARM_FP > 7)

I'm still trying to setup a reasonable build/test environment, but I 
suppose I need some suggestions on how to proceed.
Any hints?

Thanks
Regards
Pier

On 13/09/2018 02:52, Rich Felker wrote:
> On Wed, Sep 12, 2018 at 08:41:15PM -0400, Christopher Friedt wrote:
>> It does :) Although only through thumbv2, so there would be some  assembly
>> rework required for cortex-m0.
> There's also no fdpic ABI support yet, so it's only going to be
> nonshared text. For bare-metal/pseudo-kernel or a single-program
> userspace on Linux it probably doesn't matter, but if you're trying to
> run a real userspace it's very inefficient. I'd like to add fdpic
> soon.
>
> Also, I think it won't work unless the kernel traps and emulates the
> cp15 thread-pointer access, since we don't support the get_tls
> syscall. (We can add it if needed, but the whole idea of the syscall
> is silly since it's no more efficient than trapping on the kernel
> side, but support for switching to it makes userspace slower/heavier.
>
> Rich
>
>
>> On Wed., Sep. 12, 2018, 8:39 p.m. Pierluigi Passaro, <
>> pierluigi.passaro@phoenixsoftware.it> wrote:
>>
>>> Hi,
>>> I was wondering if musl already supports Cortex-M or not.
>>> Thanks
>>> Regards
>>> Pier
>>>



  reply	other threads:[~2018-09-13  1:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-13  0:39 Pierluigi Passaro
2018-09-13  0:41 ` Christopher Friedt
2018-09-13  0:52   ` Rich Felker
2018-09-13  1:06     ` Pierluigi Passaro [this message]
2018-09-13  1:24       ` Rich Felker
2018-09-13  9:43         ` Szabolcs Nagy

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=97041122-710c-0b4c-d4de-d89d87a9ee83@phoenixsoftware.it \
    --to=pierluigi.passaro@phoenixsoftware.it \
    --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).