git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: A Large Angry SCM <gitzilla@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH/RFC] Build a shared / renamed / "stable" version of the library?
Date: Fri, 16 Sep 2005 10:41:05 -0400	[thread overview]
Message-ID: <432AD981.2080400@gmail.com> (raw)
In-Reply-To: <pan.2005.09.16.12.37.14.736570@smurf.noris.de>

Matthias Urlichs wrote:
> Build (and use) libgit.so instead of libgit.a.
> 
> --- 
> 
> I have written this nice Python extension that gives me fast access to
> git objects. Python extensions are built as shared libraries. Linking
> shared and non-shared objects into one library results in a couple of
> linker warnings on i386; other architectures are far less forgiving.
> 
> So the best choice I seem to have is to build a shared libgit.so.
> 
> Unfortunately, libgit doesn't have nice symbol names. I dunno how you
> all would feel about a big patch which renames absoutely every foo()
> function in libgit to be git_foo() instead (or one that #ifdef's them)...
> so I'm taking the easy way out, and use versioned symbols. That should
> prevent symbol name conflicts with other libraries.
> 
> I've had to redefine usage(), error() and die() to git_*(), because
> they're just too conflict-ish. "error" is even a weak symbol in libc. :-/
> 
> To summarize, the choices seem to be:
> - don't do anything => no script language extensions, need to fork off
>   a git program for absolutely everything. Bah.
> - build libgit.a with -fpic'd objects => doesn't work on all
>   architectures.
> - build libgit.shared.a and use that for building script language
>   extensions => works now, but may cause name conflicts down the road.
> - build a "normal" libgit.so => ditto on the name conflicts.
> - build a libgit.so with symbol versions => no name conflicts expected,
>   but works only with the GNU linker.
> - rename all library functions and globals => quite a bit of work,
>   and more typing down the road.
> - add "#define foo git_foo" to all library functions => ugly.
> 
> Opinions?

Renaming all the library functions and globals is the way to go if the 
long term view is that Git functionality will be desired in other 
projects. This is my view.

However, it's not clear (to me, anyway) that libgit is structured (other 
than naming) in a way that's usable for non core-git tools; git-daemon 
was discussed recently. Some research needs to be done to answer this 
question.

  reply	other threads:[~2005-09-16 14:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-16 12:37 [PATCH/RFC] Build a shared / renamed / "stable" version of the library? Matthias Urlichs
2005-09-16 14:41 ` A Large Angry SCM [this message]
2005-09-16 18:46 ` Junio C Hamano
2005-09-16 19:48   ` Chuck Lever
2005-09-16 20:06     ` Junio C Hamano
2005-09-16 20:17       ` Chuck Lever
2005-09-16 21:10   ` Matthias Urlichs

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=432AD981.2080400@gmail.com \
    --to=gitzilla@gmail.com \
    --cc=git@vger.kernel.org \
    /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).