mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: [PATCH 9/10] GLIBC ABI patches
Date: Tue, 24 Jul 2012 19:18:33 -0400	[thread overview]
Message-ID: <20120724231833.GM544@brightrain.aerifal.cx> (raw)
In-Reply-To: <794E4E83-2775-4DAF-8FDF-D87936250600@palsenberg.com>

On Tue, Jul 24, 2012 at 08:33:31PM +0200, Igmar Palsenberg wrote:
> >> Why bloat code with stuff to provide glibc compatibility ?
> >> 
> >> 
> >> 	Igmar
> > 
> > “That we even need those aliases is usually a case of bad automake
> > / autoconf / bad feature detection”
> > 
> > These are for ABI compatibility, not API compatibility. Nobody
> > using glibc uses these symbols intentionally, they are renamed and
> > aliased by the library. Last I checked, musl is shockingly close
> > to ABI compatibility with glibc, and like it or not, that's a
> > valuable feature. If you don't like the “bloat” of it, you'll have
> > to dig out a lot of the existing aliases too.
> 
> I've seen lots of code who use internal glibc functions / data
> structures. We want to prevent them from being used, that's why I
> personally have a problem with adding code like this. Unless it
> actually serves a real use.

OK, let me clarify a bit of musl's policy about glibc compatibility.
The intent is that programs or .o files built against glibc headers
and linked against glibc libc.so should work on musl as long as they
are conforming C/POSIX programs or programs which just use nonstandard
but widely available functions provided by musl and which are
otherwise conforming C/POSIX programs. There's no explicit goal of
supporting glibc programs which are poking at glibc internals (like
the stdio hacks in gnulib) or otherwise dependent on the way glibc
implements a particular interface, since one of the major goals of
musl is to be able to drop and replace the internals of any interface
with a new/better implementation without breaking programs linked
against musl libc.so.

To achieve the above level of glibc ABI compatibility, it's necessary
to provide a minimal set of symbols not specified by C or POSIX but
which glibc uses for implementing things specified by C or POSIX. One
good example is the __isoc99_*scanf functions. Since glibc's plain
*scanf functions are nonconformant, building against glibc with
-std=c99 causes the program to use the __isoc99_*scanf functions
instead. This is not a glibc-specific hack in the program but instead
a hack induced by the glibc header files. There's also minimal cost in
supporting it; it's just an extra symbol in the global symbol table,
no extra code. Other examples are the *64 functions for 64-bit off_t
support. An example where there is some actual code/data bloat is the
tables used for implementing ctype.h is*() functions. I added these
with some hesitation, but unfortunately they're necessary to be able
to run any conforming C program that was built against glibc which
happens to use ctype.h, and thankfully they're not too big.

With that said, there's also some benefit to being able to use nasty
binaryware video drivers that were built against glibc, specifically
the nvidia junk. I'm not a fan (personally, I would never buy an
nvidia card until their policies change, and even then I'd be hesitant
to buy the watt-guzzling SUV of video cards...) but many people have
them and want to use them, and being able to get the driver working
with musl is quite a nice hack. So if we can provide the symbols or a
minimal amount of compatibility glue to make these drivers work, I
think it's worthwhile to do so.

Rich


  reply	other threads:[~2012-07-24 23:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23  1:13 [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-07-23  1:17 ` [PATCH 2/10] splice Isaac Dunham
2012-07-23  1:21 ` [PATCH 3/10] xattr syscalls Isaac Dunham
2012-07-24 18:06   ` orc
2012-07-23  1:24 ` [PATCH 4/10] pipe2 Isaac Dunham
2012-07-23  1:28 ` [PATCH 5/10] __sigsetjmp alias Isaac Dunham
2012-07-23  1:32 ` [PATCH 6/10] Provide private versions of locale/ functions Isaac Dunham
2012-07-23  1:33 ` [PATCH 7/10] __fcntl Isaac Dunham
2012-07-23  1:36 ` [PATCH 8/10] finite Isaac Dunham
2012-07-23  7:58   ` Szabolcs Nagy
2012-07-23  1:38 ` [PATCH 9/10] GLIBC ABI patches Isaac Dunham
2012-07-23 15:11   ` Arvid E. Picciani
2012-07-24 18:15     ` Igmar Palsenberg
2012-07-24 18:19       ` Gregor Richards
2012-07-24 18:23         ` Igmar Palsenberg
2012-07-24 18:29           ` Gregor Richards
2012-07-24 18:33             ` Igmar Palsenberg
2012-07-24 23:18               ` Rich Felker [this message]
2012-07-25  7:27               ` Arvid E. Picciani
2012-07-25 14:12   ` Luca Barbato
2012-07-25 15:19     ` Rich Felker
2012-07-25 15:52       ` Luca Barbato
2012-07-25 17:35         ` Rich Felker
2012-07-25 23:06       ` idunham
2012-07-23  1:40 ` [PATCH 10/10] More glibc ABI compatability Isaac Dunham
2012-08-07  2:22 ` [PATCH 1/10] ioperm & iopl Isaac Dunham
2012-08-07  3:29   ` Isaac Dunham
2012-07-25  3:00 [PATCH 9/10] GLIBC ABI patches idunham
2012-07-25 15:06 ` Rich Felker
2012-07-25 22:19   ` Luca Barbato

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

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

  git send-email \
    --in-reply-to=20120724231833.GM544@brightrain.aerifal.cx \
    --to=dalias@aerifal.cx \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).