mailing list of musl libc
 help / color / mirror / code / Atom feed
From: "writeonce@midipix.org" <writeonce@midipix.org>
To: musl@lists.openwall.com
Subject: Re: musl-llvm and crtbegin/crtend
Date: Wed, 23 Apr 2014 11:46:16 -0400	[thread overview]
Message-ID: <5357E048.8010308@midipix.org> (raw)
In-Reply-To: <20140423144752.GN26358@brightrain.aerifal.cx>

On 04/23/2014 10:47 AM, Rich Felker wrote:
> On Wed, Apr 23, 2014 at 04:47:55AM -0400, writeonce@midipix.org wrote:
>> Thanks, Rich.  From the sources of gcc (4.6 -- 4.8) and llvm/clang
>> (3.4 -- trunk) it appears that gcc introduced __init_array in
>> version 4.7;  when used, __do_global_ctors_aux is absent, however
>> the implementation of __do_global_dtors_aux is still there (in
>> crtbegin.o).
>>
>> When clang invokes the linker, it asks for crtbegin.o and crtend.o
>> to be included regardless of the executable type (c/c++), which
>> might be worth a patch (clang/lib/Driver/Tools.cpp).  On the other
>> hand, it does support __init_array (by default, I believe, and also
>> through -fuse-init-array), and there are also relevant bits in the
>> code for llvm's native linker (lld).
>>
>> Given that clang also supports the old ctor/dtor system (through
>> -fno-use-init-array), the status of crtbegin/crtend seems to be
>> still relevant.
> My point was just that if you're using exclusively new .o files built
> with init-array, I think it's possible to compile without crtbegin.o
> and crtend.o (or equivalently, with empty .o files dropped in their
> place).
>
> Rich
>
>
Thanks for clarifying this, I'll test this with both systems (gcc & 
llvm) and get back to the list.
zg



      reply	other threads:[~2014-04-23 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-22 21:53 writeonce
2014-04-22 22:38 ` Rich Felker
2014-04-23  8:47   ` writeonce
2014-04-23 14:47     ` Rich Felker
2014-04-23 15:46       ` writeonce [this message]

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=5357E048.8010308@midipix.org \
    --to=writeonce@midipix.org \
    --cc=musl@lists.openwall.com \
    /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).