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 18:59:20 +0800
From: Lei Zhang <>
To: Peter Smith <>
Cc: Rafael EspĂ­ndola <>, 
	llvm-commits <>,,, cfe-commits cfe <>
Subject: Re: [gentoo-musl] Re: Add support for musl-libc on Linux

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.


> 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,

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.