mailing list of musl libc
 help / color / mirror / code / Atom feed
* How can I assess compatibility of a statically linked binary?
@ 2014-02-20 17:50 Oliver Schneider
  2014-02-20 17:59 ` Justin Cormack
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Schneider @ 2014-02-20 17:50 UTC (permalink / raw)
  To: musl

Hi,

when I have a file linked against glibc the file(1) utility will usually
tell me something like this:

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
(uses shared libs), for GNU/Linux 2.6.15, stripped

However, when I run this on a statically linked binary that uses musl, I
get

ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked,
stripped

which gives no indication of the minimum expected kernel. Does that mean
that this binary will also run on, say, a 2.4.x kernel? I guess not?

How can I tell which kernel interface a certain binary requires? After
all the system call numbers on which the libc relies change every once
in a while.

Thanks,

// Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can I assess compatibility of a statically linked binary?
  2014-02-20 17:50 How can I assess compatibility of a statically linked binary? Oliver Schneider
@ 2014-02-20 17:59 ` Justin Cormack
  2014-02-20 18:20   ` Oliver Schneider
  0 siblings, 1 reply; 4+ messages in thread
From: Justin Cormack @ 2014-02-20 17:59 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]

On 20 Feb 2014 17:51, "Oliver Schneider" <musl-mailinglist@f-prot.com>
wrote:
>
> Hi,
>
> when I have a file linked against glibc the file(1) utility will usually
> tell me something like this:
>
> ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
> (uses shared libs), for GNU/Linux 2.6.15, stripped
>
> However, when I run this on a statically linked binary that uses musl, I
> get
>
> ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked,
> stripped
>
> which gives no indication of the minimum expected kernel. Does that mean
> that this binary will also run on, say, a 2.4.x kernel? I guess not?
>
> How can I tell which kernel interface a certain binary requires? After
> all the system call numbers on which the libc relies change every once
> in a while.
>

The Musl docs say which the earliest supported release is. From memory it
is late 2.4 but I don't recall the exact version. If you don't use some
functionality things might work on an earlier version of course.

Justin

[-- Attachment #2: Type: text/html, Size: 1307 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can I assess compatibility of a statically linked binary?
  2014-02-20 17:59 ` Justin Cormack
@ 2014-02-20 18:20   ` Oliver Schneider
  2014-02-21  3:50     ` Rich Felker
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Schneider @ 2014-02-20 18:20 UTC (permalink / raw)
  To: musl

Hey Justin,

> The Musl docs say which the earliest supported release is. From
> memory it is late 2.4 but I don't recall the exact version. If you
> don't use some functionality things might work on an earlier version
> of course.
thanks for the swift response, found it in the Wiki now thanks to your
pointer:

> Musl is built on the Linux syscall layer. Linux kernel >=2.6.39 is
> necessary for POSIX conformant behaviour, older kernels will work
> with varying degrees of non-conformance, 2.4 kernels will only work
> for simple single-threaded applications.


I had mistakenly expected it under

  <http://wiki.musl-libc.org/wiki/Compatibility>

when it was of course to be found under:

  <http://wiki.musl-libc.org/wiki/Supported_Platforms>

Thanks,

// Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How can I assess compatibility of a statically linked binary?
  2014-02-20 18:20   ` Oliver Schneider
@ 2014-02-21  3:50     ` Rich Felker
  0 siblings, 0 replies; 4+ messages in thread
From: Rich Felker @ 2014-02-21  3:50 UTC (permalink / raw)
  To: musl

On Thu, Feb 20, 2014 at 06:20:51PM +0000, Oliver Schneider wrote:
> > Musl is built on the Linux syscall layer. Linux kernel >=2.6.39 is
> > necessary for POSIX conformant behaviour, older kernels will work
> > with varying degrees of non-conformance, 2.4 kernels will only work
> > for simple single-threaded applications.
> 
> 
> I had mistakenly expected it under
> 
>   <http://wiki.musl-libc.org/wiki/Compatibility>
> 
> when it was of course to be found under:
> 
>   <http://wiki.musl-libc.org/wiki/Supported_Platforms>

This will also be documented more formally in the official manual to
be released in conjunction with musl 1.0. For this we should clarify
what version is really needed. I don't think 2.6.39 is necessary;
something like 2.6.32 should be sufficient for POSIX 2008, barring any
arch-specific bugs (or just general bugs that need to be patched to
avoid having an unstable/insecure kernel). I know glibc is planning on
requiring at least 2.6.32 in the next release, so it would be nice if
we could just state the same requirement.

As for older kernels, somewhere down to 2.6.22 works if you don't care
about atomic close-on-exec working atomically (musl has fallback for
kernels that lack it, but the fallback is of course non-atomic). Then
there are also ranges going all the way back to 2.6.0 or even 2.5.x
that work if you don't care about certain POSIX signal semantics
(mainly, wrongly-generated EINTR where a syscall should have
restarted) and don't need *at() functions (note that musl presently
does not emulate these, even though it could do so using /proc). And
if in addition you don't need threads, even 2.4.x will work. It would
also be nice to get these version ranges documented in detail, in case
anyone has need to use musl binaries with such old kernels (some users
adding new software to existing embedded systems may care; otherwise
it's probably a non-issue).

Rich


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-21  3:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 17:50 How can I assess compatibility of a statically linked binary? Oliver Schneider
2014-02-20 17:59 ` Justin Cormack
2014-02-20 18:20   ` Oliver Schneider
2014-02-21  3:50     ` Rich Felker

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).