Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 20 Jun 2016 12:44:34 +0100
From: Peter Smith <>
To: Lei Zhang <>
Cc: Rafael EspĂ­ndola <>, 
	llvm-commits <>,,, cfe-commits cfe <>
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 helpful here
(introduction of -meabi option).


On 20 June 2016 at 11:59, Lei Zhang <> wrote:
> 2016-06-20 17:37 GMT+08:00 Peter Smith <>:
>> 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 or I think you'll
>> need 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.