From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5267 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: gcc'c crtstuff.c: a musl-related experience Date: Sun, 15 Jun 2014 21:41:31 -0400 Message-ID: <20140616014130.GT179@brightrain.aerifal.cx> References: <539E11E5.2080004@midipix.org> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1402882911 32578 80.91.229.3 (16 Jun 2014 01:41:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 16 Jun 2014 01:41:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5272-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jun 16 03:41:45 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WwLvc-0000mh-VQ for gllmg-musl@plane.gmane.org; Mon, 16 Jun 2014 03:41:45 +0200 Original-Received: (qmail 32178 invoked by uid 550); 16 Jun 2014 01:41:43 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32170 invoked from network); 16 Jun 2014 01:41:43 -0000 Content-Disposition: inline In-Reply-To: <539E11E5.2080004@midipix.org> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:5267 Archived-At: On Sun, Jun 15, 2014 at 05:36:37PM -0400, writeonce@midipix.org wrote: > The two files at stake are gcc/linux.h, and libgcc/crtstuff.c. In > the former, a built-in macro named __gnu_linux__ is defined when > glibc is the toolchain's default libc (OPTION_GLIBC). In the > latter, a macro named USE_PT_GNU_EH_FRAME is defined when > __gnu_linux__ is defined, which accordingly prevents > USE_EH_FRAME_REGISTRY from being defined shortly thereafter. The > absence of this last macro results in a crtbegin.o that is > incompatible with musl, at least in some cases (a simple c++ > application crashes after an exception has been thrown, which is how > I came to notice it). I'm not an expert on gcc internals, but I'm doubtful of your explanation of the problem. From just the macro names, USE_PT_GNU_EH_FRAME is the one you want, and USE_EH_FRAME_REGISTRY sounds like the nasty old fallback that's incompatible with static linking of libgcc_eh.a. However I'm confused what this has to do with crtbegin.o/crtend.o. Perhaps someone who's worked with toolchain stuff could comment. The reason I'm bringing this up is that there might really be some bug in musl or in your toolchain setup, where switching to the old code is just covering up the bug. Rich