From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12820 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: undefined reference to `raise' with musl static toolchain Date: Wed, 9 May 2018 13:28:48 -0400 Message-ID: <20180509172848.GN1392@brightrain.aerifal.cx> References: <20180508144417.216cefa5@windsurf.home> <20180508162226.GA30163@voyager> <20180508163423.GM1392@brightrain.aerifal.cx> <20180509112932.1a3176b0@windsurf.home> <20180509154407.1164eb41@windsurf.home> <20180509152437.GY4418@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1525886818 31659 195.159.176.226 (9 May 2018 17:26:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 9 May 2018 17:26:58 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Thomas Petazzoni To: musl@lists.openwall.com Original-X-From: musl-return-12836-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 09 19:26:53 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1fGSrd-000888-G9 for gllmg-musl@m.gmane.org; Wed, 09 May 2018 19:26:53 +0200 Original-Received: (qmail 29875 invoked by uid 550); 9 May 2018 17:29:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 29829 invoked from network); 9 May 2018 17:29:01 -0000 Content-Disposition: inline In-Reply-To: <20180509152437.GY4418@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12820 Archived-At: On Wed, May 09, 2018 at 05:24:37PM +0200, Szabolcs Nagy wrote: > * Thomas Petazzoni [2018-05-09 15:44:07 +0200]: > > > > So: why does a musl-based toolchain requires an explicit -static, while > > it isn't needed with uClibc-ng ? > > > > there can be many reasons.. > > e.g. if mktime in uclibc-ng happens to reference raise then it > would get linked in independently of libgcc. > > or maybe uclibc-ng has its own __aeabi_*div implementation. > > or the way libgcc was configured, the raise(SIGFPE) was disabled > (it is only enabled for linux targets, but who knows how > *-linux-uclibcgnueabihf is interpreted). > > you can check these using nm/objdump/readelf on libc.a and libgcc.a It would be nice if this raise dependency could be removed from libgcc. It's not necessary for any defined behavior; it's only there for the sake of emulating x86 behavior on div-by-zero. Either way you need to be using the right link order that -static gives (potentially for other reasons) but it would be nice to avoid unnecessary code getting static-linked like this. Rich