Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 11 May 2018 23:28:20 +0200
From: Thomas Petazzoni <thomas.petazzoni@...tlin.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: undefined reference to `raise' with musl static
 toolchain

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

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ