mailing list of musl libc
 help / color / mirror / code / Atom feed
From: John Spencer <maillist-musl@barfooze.de>
To: musl@lists.openwall.com
Subject: Re: dlopen'ing glibc linked libraries
Date: Tue, 21 Jan 2014 15:31:27 +0100	[thread overview]
Message-ID: <52DE84BF.2090001@barfooze.de> (raw)
In-Reply-To: <CAKDfesm1273_2eUHubBTuxOtXiGVSW7Nt+ZvFsAfCacW3KAfTQ@mail.gmail.com>

Gabriel Jacobo wrote:
> Hey everyone! First message here...
> 
> I recently found about musl when googling for GLIBC alternatives. I read in
> the FAQ that binary compatibility with GLIBC is not there yet, so my
> question is if this is a priority for the library.

GLIBC compat is already pretty good, given that the glibc stuff was 
compiled in a sane manner (i.e. with the flags that enable 64bit off_t).
for example, it is possible to run Dwarf Fortress:
http://openwall.com/lists/sabotage/2013/11/01/1

it's also possible to run opera with a preloaded .so that provides a few
symbols that musl doesn't provide.

> 
> As a bit of background to my question, let me say that I'm an SDL2
> contributor, and I've tried linking SDL against musl, which seemed to work
> great. I'm linking dynamically BTW (statically linking to musl didn't quite
> work, I didn't research the issue much but it's probably a problem in SDL's
> build system).

statically linked musl does not support dlopen(), so you will have a 
hard time loading plugins (explanation for why it is not supported:
http://www.openwall.com/lists/musl/2012/12/08/4 )

> 
> However, SDL uses dlopen/dlsym heavily to load most of its functionality

i guess this kind of plug-in loading is considered a bad idea by most 
people here...

> (for example, to load the libGL.so.1 binary in order to provide OpenGL
> support), and these binaries depend on GLIBC...so (expectedly?) almost

that's not quite true, sabotage linux builds mesa fine (with 2 minor 
patches).
recipe:
https://github.com/sabotage-linux/sabotage/blob/master/pkg/mesalib#L19
patches:
https://github.com/sabotage-linux/sabotage/blob/master/KEEP/mesalib-fpclassify.patch
https://github.com/sabotage-linux/sabotage/blob/master/KEEP/mesalib-strtod.patch
https://github.com/sabotage-linux/sabotage/blob/master/KEEP/mesalib-strtof.patch

> nothing actually works with the SDL/musl binary.

basically what you should try to do is build all dependencies against musl.

> So, will it ever work?

even if it would work, mixing glibc and musl linked things is far from 
optimal.

> 
> Thanks!

btw, you might be interested in this SDL bug:
https://bugzilla.libsdl.org/show_bug.cgi?id=2019



  reply	other threads:[~2014-01-21 14:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-21 13:57 Gabriel Jacobo
2014-01-21 14:31 ` John Spencer [this message]
2014-01-21 14:44   ` Gabriel Jacobo
2014-01-21 16:28     ` John Spencer
2014-01-21 18:17     ` Szabolcs Nagy
2014-01-23 10:07       ` Szabolcs Nagy
2014-01-24 10:07         ` Justin Cormack
2014-01-24 13:41           ` Szabolcs Nagy

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=52DE84BF.2090001@barfooze.de \
    --to=maillist-musl@barfooze.de \
    --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).