Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAEt-8LCQ5H2vE_PXPxs+Gr2=roBT9BuT487w2at3UAKhFqqYxA@mail.gmail.com>
Date: Mon, 20 Jun 2016 12:44:34 +0100
From: Peter Smith <peter.smith@...aro.org>
To: Lei Zhang <zhanglei.april@...il.com>
Cc: Rafael EspĂ­ndola <rafael.espindola@...il.com>, 
	llvm-commits <llvm-commits@...ts.llvm.org>, musl@...ts.openwall.com, 
	gentoo-musl@...ts.gentoo.org, cfe-commits cfe <cfe-commits@...ts.llvm.org>
Subject: Re: [gentoo-musl] Re: Add support for musl-libc on Linux

>From what I can see, the EABI type is used to decide if certain
__aeabi_ prefixed functions such as __aeabi_idiv are available. If
Musl differs in function availability from the GNU library here I
think you'll need a Musl EABI type. However if there is no difference
you should be able to use the EABI::GNU type for Musl.

You might find http://reviews.llvm.org/D12413 helpful here
(introduction of -meabi option).

Peter


On 20 June 2016 at 11:59, Lei Zhang <zhanglei.april@...il.com> wrote:
> 2016-06-20 17:37 GMT+08:00 Peter Smith <peter.smith@...aro.org>:
>> Hello Lei,
>
> Hi, thanks for your reply!
>
>> I agree with Rafael that this is currently missing a few critical
>> things right now, especially in the llvm patch.
>>
>> My (limited) understanding of musl is that it intends to support the
>> same interface as GNUEABI and GNUEABIHF, but it is obviously a
>> different implementation.
>>
>> This is what I could find with a basic grep for GNUAEABI and working
>> out from there.
>>
>> Clang patch
>> I'm assuming you are only intending to support Musl on linux, and not BSD.
>
> Yes.
>
>> ToolChains.cpp
>> - getDynamicLinker()
>> There is a Triple.getEnvironment() == llvm::triple::GNUEABIHF which
>> selects between ld-linux-armhf.so.3 or ld-linux.so.3. I think you'll
>> need ld-linux-armhf.so.3 for MUSLHF here as well.
>
> Actually musl's dynamic linker has a different naming scheme from
> glibc's, which is handled by an extra chunk of code in the patch. The
> code you mentioned won't be reached when musl is present, and thus
> need no change.
>
>> LLVM patch
>> ARMSubtarget.h
>> - isTargetGNUAEABI()
>> I think you'll need to check all the callsites of this function, and
>> check what you want isTargetMusl() to do. At present I think you'll
>> want them to do the same thing in all cases except finding the
>> implementation. There looks to be a trade off between adding MUSCL and
>> MUSCLHF to isTargetGNUAEABI(), adding something like
>> isTargetGNUAEABIInterface() and adding isTargetMusl() to all the
>> callsites.
>>
>> - isTargetEHABICompatible()
>> I'm making the assumption that musl supports the ARM exceptions EHABI,
>> if so you'll want to add MUSL and MUSLHF here.
>
> I'm not 100% sure about this. Could some insider from musl confirm this?
>
>> - isTargetHardFloat()
>> You'll want to add MUSLHF here.
>>
>> ARMTargetMachine.cpp
>> - computeTargetABI()
>> You'll want to add MUSL and MUSLHF alongside GNUEABI and GNUEABIHF in
>> the switch.
>>
>> Hope this helps
>
> In addition to what you mentioned, perhaps I should also add "Musl" as
> a new EABI type in TargetOptions.h (in LLVM), just side by side with
> "GNU", and change relevant bits in LLVM and clang accordingly.
>
>
> Thanks again,
> Lei

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.