Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHGmiivfbgcr=XJ_-uCAyTbv=diX+uDYZfC214MjotY=NhdT=A@mail.gmail.com>
Date: Wed, 12 Nov 2025 15:33:42 +0100
From: Fredrik Orderud <forderud@...il.com>
To: musl@...ts.openwall.com
Subject: Safe to load musl shared lib into glibc executable?

I'm working on a project developing a Linux shared library (.so) that
we want to be as widely compatible as possible with multiple distros
of various age. Glibc have already caused compatibility problems for
deployment systems older than the build system. I'm therefore
investigating if musl could be an alternative, since it supports
static linking to the C library.

We're unable to require all library users to also switch to musl.
Therefore, for musl to be an alternative to glibc, then it must be
possible load a shared lib compiled with musl into executables still
compiled with glibc. Our library API doesn't transfer ownership of any
malloc/free pointers or similar, so it should in principle be
compatible with using a different C library internally vs. in the
client code.

I've already managed to load shared lib compiled with musl into
executables compiled with glibc in a tiny test project if adding musl
to LD_LIBRARY_PATH before starting the executable. However, the musl
FAQ mentions that "Binary compatibility is much more limited". I'm
therefore unsure if it's in general safe to mix musl with glibx this
way in the same process?

Any advise on the safety of loading a musl shared lib into glibc
executable? Any limitations or expected problems to watch out for?

Thanks in advance,
Fredrik Orderud

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.