From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12823 Path: news.gmane.org!.POSTED!not-for-mail From: Thomas Petazzoni Newsgroups: gmane.linux.lib.musl.general Subject: Re: undefined reference to `raise' with musl static toolchain Date: Fri, 11 May 2018 23:28:20 +0200 Organization: Bootlin (formerly Free Electrons) Message-ID: <20180511232820.01736587@windsurf.home> 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> <20180511175901.7f17085a@windsurf.home> <20180511160544.GT1392@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1526074000 3071 195.159.176.226 (11 May 2018 21:26:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 11 May 2018 21:26:40 +0000 (UTC) Cc: musl@lists.openwall.com To: Rich Felker Original-X-From: musl-return-12839-gllmg-musl=m.gmane.org@lists.openwall.com Fri May 11 23:26:36 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 1fHFYi-0000hI-HQ for gllmg-musl@m.gmane.org; Fri, 11 May 2018 23:26:36 +0200 Original-Received: (qmail 32208 invoked by uid 550); 11 May 2018 21:28:43 -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 32183 invoked from network); 11 May 2018 21:28:43 -0000 In-Reply-To: <20180511160544.GT1392@brightrain.aerifal.cx> X-Mailer: Claws Mail 3.15.1-dirty (GTK+ 2.24.32; x86_64-redhat-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:12823 Archived-At: Hello, Thanks for your feedback! On Fri, 11 May 2018 12:05:44 -0400, Rich Felker wrote: > > Now my question remains: do you consider it normal that -static is > > required, or do you consider it a bug of the musl/gcc integration that > > -static is required even when the only variant available of the library > > is the static one ? > > I don't think gcc is intended to work right in configurations where it > supports dynamic linking but the only libc available is static, unless > you pass -static, and I don't see a good way to make it work in that > case. You've only hit the tip of the iceberg; there's more stuff that > could break subtly when gcc is passing ld options that were intended > for dynamic linking, but ld actually ends up performing static > linking. It "working" with uClibc is just "getting lucky" (or > "unlucky" depending on your perspective about ignoring vs catching > unsafe things). OK. > If gcc doesn't have any option to tell it you're building a > static-only toolchain and make static linking the default, I see that > as something of an omission, and maybe we should try to get that added > to gcc. I don't see anything like that. Buildroot already builds gcc with --enable-static --disable-shared when building a static toolchain, and I don't see any other option that would be relevant, from a quick look. Thomas -- Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com