unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Tobias Geerinckx-Rice <me@tobias.gr>
To: Tim Lee <progscriptclone@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: Why doesn't Guix build static libraries?
Date: Sun, 31 Oct 2021 12:48:19 +0100	[thread overview]
Message-ID: <87fssh2ybn.fsf@nckx> (raw)
In-Reply-To: <20211031044920.qbhhohp5onuyke5n@localhost>

[-- Attachment #1: Type: text/plain, Size: 1035 bytes --]

Tim,

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,

T G-R

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

  reply	other threads:[~2021-10-31 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31  4:49 Why doesn't Guix build static libraries? Tim Lee
2021-10-31 11:48 ` Tobias Geerinckx-Rice [this message]
2021-10-31 15:03   ` Denis 'GNUtoo' Carikli
2021-10-31 16:13     ` Tobias Geerinckx-Rice

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fssh2ybn.fsf@nckx \
    --to=me@tobias.gr \
    --cc=help-guix@gnu.org \
    --cc=progscriptclone@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).