[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why doesn't Guix build static libraries?

From: Tobias Geerinckx-Rice
Subject: Re: Why doesn't Guix build static libraries?
Date: Sun, 31 Oct 2021 12:48:19 +0100


Tim Lee 写道:
I noticed that many C and C++ libraries in Guix are built with the --disable-static option. Why are static libraries excluded from Guix?

I'll speak for myself: I remove static .a libraries whenever they're not obviously required by other software in Guix. If another package were to require them, I'd first try to fix it to link dynamically.

Static linking provides no serious advantages and at least one serious disadvantage: it's invisible to grafting. If A statically links to B, grafting B will leave A untouched and vulnerable.

My worry is that leaving .a files around will cause some build systems to silently prefer them to the .so and link statically. I can't remember the name of the packages, but this does happen.

Static linking is useful in tightly-controlled environments where space is at a premium, i.e., the Guix System initrd. That's why Guix has packages like bcachefs-tools-static. It's just made very explicit.

Kind regards,


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]