git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Paul Smith <paul@mad-scientist.net>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
	Elmar Pruesse <p@ucdenver.edu>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Reducing git size by building libgit.so
Date: Wed, 12 Jun 2019 09:57:43 -0400	[thread overview]
Message-ID: <9c488ce8c1e1e6d6d4c343b0b40c8a64c8147a7f.camel@mad-scientist.net> (raw)
In-Reply-To: <20190611234815.GB8616@genre.crustytoothpaste.net>

On Tue, 2019-06-11 at 23:48 +0000, brian m. carlson wrote:
> Also, some people install Git into their home directories, and a
> shared library means that they'll have to use LD_LIBRARY_PATH (or
> equivalent) to run Git.

I don't have strong feeling about .so's although obviously less disk
space used is always a good thing, everything else being equal.

However, the above concern isn't actually an issue.  You can install
the .so in a known location relative to the binaries, then link the
binaries with an RPATH setting using $ORIGIN (or the equivalent on
MacOS which does exist but I forget the name).  On Windows, DLLs are
installed in the same directory as the binary, typically.

Allowing relocatable binaries with .so dependencies without requiring
LD_LIBRARY_PATH settings is a solved problem, to the best of my
understanding.


One thing to think about is that runtime loading a .so can take some
time if it has lots of public symbols.  If someone really wanted to do
this, the ideal thing would be to make all symbols hidden except those
needed by the binary front-ends and have those be very small shells
that just had a very limited number of entry points into the .so.

Maybe for git this doesn't matter but for some projects I've worked on
the time to dlopen() a library was a blocking issue that the above
procedure solved nicely.


  parent reply	other threads:[~2019-06-12 14:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-11 19:52 Reducing git size by building libgit.so Elmar Pruesse
2019-06-11 23:48 ` brian m. carlson
2019-06-12  9:29   ` Duy Nguyen
2019-06-12 13:57   ` Paul Smith [this message]
2019-06-12 23:31     ` brian m. carlson
2019-06-13 19:19       ` Johannes Sixt
2019-06-13  7:51     ` Johannes Schindelin
2019-06-13 17:28       ` Paul Smith
2019-06-13 18:23         ` Junio C Hamano
2019-06-12  9:41 ` Ævar Arnfjörð Bjarmason
2019-06-12  9:46   ` Duy Nguyen
2019-06-12 10:25   ` SZEDER Gábor

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: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=9c488ce8c1e1e6d6d4c343b0b40c8a64c8147a7f.camel@mad-scientist.net \
    --to=paul@mad-scientist.net \
    --cc=git@vger.kernel.org \
    --cc=p@ucdenver.edu \
    --cc=sandals@crustytoothpaste.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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).