mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Lei Zhang via cfe-commits <cfe-commits-NBbBogny7ofFcdTEL8lfRQ@public.gmane.org>
To: Peter Smith <peter.smith-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: gentoo-musl-cnFmAm88PdgLnqt3yJz4RQ@public.gmane.org,
	cfe-commits cfe
	<cfe-commits-NBbBogny7ofFcdTEL8lfRQ@public.gmane.org>,
	musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org,
	llvm-commits
	<llvm-commits-NBbBogny7ofFcdTEL8lfRQ@public.gmane.org>
Subject: Re: [gentoo-musl] Re: Add support for musl-libc on Linux
Date: Mon, 20 Jun 2016 18:59:20 +0800	[thread overview]
Message-ID: <CAOYuCc2yxgYFSzDjJP0SJho5Hs=zb635ysinwbg=SZ=CZJt9_Q@mail.gmail.com> (raw)
In-Reply-To: <CAEt-8LBteTKKdYDa2GUveGNbQu12c3gBgTEeiU5p1ONsTu_VaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

2016-06-20 17:37 GMT+08:00 Peter Smith <peter.smith@linaro.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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

  parent reply	other threads:[~2016-06-20 10:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOYuCc1atr0QjQud-nxdj3rPN0Hj16u__kAs5LRmU+Ff6shtBA@mail.gmail.com>
     [not found] ` <20160612190745.GA21691@britannica.bec.de>
     [not found]   ` <CAOYuCc1NZNxEPLonrHD++QPTYgq90Bwz0B16CLXiJrEAf-zNJQ@mail.gmail.com>
     [not found]     ` <CAOYuCc1NZNxEPLonrHD++QPTYgq90Bwz0B16CLXiJrEAf-zNJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-13 13:21       ` Felix Janda via cfe-commits
2016-06-13 13:50         ` Lei Zhang
     [not found]           ` <CAOYuCc0t_eyGoOm0oozYmj55eA3Jvb48h7tGOtiMBjGWtDT1RQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-13 21:00             ` Rafael Espíndola via llvm-commits
     [not found]               ` <CAG3jReK_cUOGaOHwQT1gzTBWRVsFuArywZuoXD==m5n-_ZEXKg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14  1:07                 ` Lei Zhang via llvm-commits
     [not found]                   ` <CAOYuCc3gtPz8XhGyAsDcsCjvZPLDwSAGOXwXeu=urXmwck61mQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-14 12:55                     ` Rafael Espíndola via cfe-commits
2016-06-15  8:28                       ` Lei Zhang via cfe-commits
     [not found]                         ` <CAOYuCc125C-5QjqWhK-QuU4zZvTqb+OsZhxQjowJidZaYBYY4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-15 20:09                           ` Rafael Espíndola via cfe-commits
2016-06-17  9:50                           ` Lei Zhang via cfe-commits
     [not found]                             ` <CAOYuCc3C27jqG8uyCOkDgcOAcgaFXEz7k9O8+Tqyjv9WYH2M1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-18  0:52                               ` Rafael Espíndola via cfe-commits
     [not found]                                 ` <CAG3jReKcdL3Hn5L0sOAAM34CKoUn=J-pusOV+CRyfYRLnvnp4Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-20  9:37                                   ` Peter Smith via llvm-commits
     [not found]                                     ` <CAEt-8LBteTKKdYDa2GUveGNbQu12c3gBgTEeiU5p1ONsTu_VaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-20 10:59                                       ` Lei Zhang via cfe-commits [this message]
2016-06-20 11:28                                         ` Szabolcs Nagy
     [not found]                                         ` <CAOYuCc2yxgYFSzDjJP0SJho5Hs=zb635ysinwbg=SZ=CZJt9_Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-20 11:44                                           ` Peter Smith via cfe-commits
     [not found]                                             ` <CAEt-8LCQ5H2vE_PXPxs+Gr2=roBT9BuT487w2at3UAKhFqqYxA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-20 13:09                                               ` Lei Zhang via llvm-commits
2016-06-20 11:05                                   ` Lei Zhang via llvm-commits
     [not found]                                     ` <CAOYuCc1+_xKLK2FOvCKNpKO4BZO07hd2Cbft8p_YO3chSR41UA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-21 13:36                                       ` Lei Zhang via cfe-commits
     [not found]                                         ` <CAOYuCc1_5a15MZ4tEQZAn84rf3Y7dzugzX1TTpSgACQ+d_k3Aw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-21 15:07                                           ` Peter Smith via cfe-commits
     [not found]                                             ` <CAEt-8LCXdLMPyo+d9B5SjR5xQKbSNT_sjXvyffjeMH1V_22csw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-22  8:03                                               ` Lei Zhang via llvm-commits
     [not found]                                                 ` <CAOYuCc3A-tf1LUVHtuUjAfjphRvrJfAbQUaC_bVPEyNTP=LQQg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-22  8:55                                                   ` Peter Smith via llvm-commits
     [not found]                                                     ` <CAEt-8LA2nA1XXgwiH1Z72vm903V8PH-fsitS_QVAgXkjkzThvQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-24  3:25                                                       ` Lei Zhang via cfe-commits
     [not found]                                                         ` <CAOYuCc3h1LvG4Ky8u8EqC6x12jg_c3XLUjo3BLuOQkQphVJUSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-24  8:02                                                           ` Peter Smith via cfe-commits
     [not found]                                                             ` <CAEt-8LBNJ+hn_Ws086H_xZxSK+btFou_e02OCaJ-MxVsXV__wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-06-25  2:18                                                               ` Lei Zhang via cfe-commits
2016-06-14  8:47               ` 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='CAOYuCc2yxgYFSzDjJP0SJho5Hs=zb635ysinwbg=SZ=CZJt9_Q@mail.gmail.com' \
    --to=cfe-commits-nbbbogny7offcdtel8lfrq@public.gmane.org \
    --cc=gentoo-musl-cnFmAm88PdgLnqt3yJz4RQ@public.gmane.org \
    --cc=llvm-commits-NBbBogny7ofFcdTEL8lfRQ@public.gmane.org \
    --cc=musl-ZwoEplunGu1jrUoiu81ncdBPR1lH4CV8@public.gmane.org \
    --cc=peter.smith-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=zhanglei.april-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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).