mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: Combine musl compiled library with gcc app?
Date: Fri, 18 Jan 2019 10:52:28 -0500	[thread overview]
Message-ID: <20190118155228.GO23599@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAGDMk9GzYO4QyVJcZEEOP-_LH6dQ4sgNzwwC9sqo5Ow4n7NChw@mail.gmail.com>

On Fri, Jan 18, 2019 at 10:41:38AM -0500, John Mudd wrote:
> Is it possible to link a gcc compiled app with a musl compiled library? I
> assume this would require linking with both glibc and musl libc libraries.

I think you mean glibc, not gcc. If you have built libraries with
musl, they are almost certainly not suitable for loading by glibc.
They will not reference any versioned glibc symbols so would get
ancient, buggy versions of the glibc functions. In some cases, types
will mismatch too because of this; on 32-bit archs for example the
standard-name functions in glibc taking off_t expect it to be a 32-bit
type.

The other direction, building a library with glibc and loading it with
musl, *is* intended to work in almost all cases as long as you're not
using glibc-specific functions or glibc-specific extensions to
standard functions which musl does not support.

Neither of these is a really good idea though. If you're capable of
building the code from source it makes sense to build it properly for
the target it's going to be run on.

Rich


      reply	other threads:[~2019-01-18 15:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 15:41 John Mudd
2019-01-18 15:52 ` Rich Felker [this message]

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=20190118155228.GO23599@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --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).