[cfe-dev] a clang-provided implementation of crtbegin/crtend

Joerg Sonnenberger joerg at britannica.bec.de
Fri Apr 25 09:34:39 PDT 2014


On Tue, Apr 22, 2014 at 12:18:49PM -0400, writeonce at midipix.org wrote:
> On 04/22/2014 07:55 AM, Richard Pennington wrote:
> >On 04/21/2014 10:17 PM, writeonce at midipix.org wrote:
> >>Greetings,
> >>
> >>Given that clang has been self-hosting for quite some time now,
> >>I wonder whether there have been any plans to provide a
> >>clang-native source code for crtbegin/crtend?  I haven't seen
> >>any discussion of this on the mailing list, and so wanted to
> >>know whether that would be considered the territory of the libc
> >>implementaiton and/or the operating system distribution.
> >>
> >>Kind regards,
> >>writeonce at midipix dot org
> >>
> >For my self hosting clang/LLVM/musl I used the NetBSD versions.
> >http://ellcc.org/viewvc/svn/ellcc/trunk/libecc/src/musl/crt/crtbegin.c?revision=3510&view=markup
> >http://ellcc.org/viewvc/svn/ellcc/trunk/libecc/src/musl/crt/crtbegin.c?revision=3510&view=markup
> >
> >-Rich
> Thank you, Rich.  If I understand correctly, the above is different
> from the NetBSD assembly sources (link sent by Joerg), and is also
> more compact and portable (written in C).  Is that true, or am I
> missing something?

We have both a C version in the tree for strange architectures like MIPS
where you have to fight with many different ABIs and straight forward
assemblers versions for others. At least for classic .init/.fini
support, avoiding asm completely is difficult to impossible...

Joerg



More information about the cfe-dev mailing list