mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@aerifal.cx>
To: musl@lists.openwall.com
Subject: Re: Hello
Date: Fri, 6 Jul 2012 02:26:14 -0400	[thread overview]
Message-ID: <20120706062614.GS544@brightrain.aerifal.cx> (raw)
In-Reply-To: <20120706140601.252e4e83@sibserver.ru>

On Fri, Jul 06, 2012 at 02:06:01PM +0800, orc wrote:
> Here a patch, attached. It contains both missing syscalls and weak
> aliases. It does not contain glibc-specific stuff (if you want, I can
> send it too, but it looks ugly, intended only for 'run it
> successfully'). Some notes about:
> - rawmemchr() was taken from uClibc
> - ioperm() and iopl() were not necessary to make glxgears work, just
>   added them because Xorg will want them
> - I don't think libc even needs xattr stuff, but glibc includes them.
>   On many systems they are usually duplicated, libattr provides same
>   interface
> - It seems that every function in src/locale needs it's __underscore
>   alias, to match glibc api
> - there some ugly __funcname_internal aliases, don't know why glibc
>   defines them in that way

I think most of this is an artifact of some hacks they do in the glibc
headers for inlining/optimization and/or _FORTIFY_SOURCE support.
The functions it creates references to are not (AFAIK) in the LSB ABI
and thus binaries using them are non-LSB-conforming...

> Probably you will want to add:
> - weak_aliases for __underscores

Except most of them should be in the opposite direction. Especially
for functions like strxfrm_l where we'll eventually want the ISO C
"foo" function to depend on the POSIX "foo_l" function, the latter
will need its real name to be the __-prefixed version.

> - weak_aliases __funcname_internal

These are rather ugly and stupid, but seem harmless.

> - rawmemchr() (probably your own implementation, not uClibc one)

Indeed, I'll want to copy the existing fast code from strchr.

> - some missing syscalls (I really misguessed number of needed syscalls,
>   seems that this was a number of aliases, not syscalls)

These look mostly fine, but the header changes are all wrong (the
declarations are not under _GNU_SOURCE control).

> glibc-specific functions and objects required to make glxgears work:
> - dlvsym() (wrapper around dlsym(), we don't need ugly symvers)

Ugly because it needs to be written in asm and adds a useless per-arch
asm function. Perhaps we could just have dlvsym be a weak alias to
dlsym in the existing asm files...

> - gnu_get_libc_*()

return "not glibc";

> - malloc_usable_size() (returns 0 always, probably there is no code in
>   musl to make it work. Definition in eglibc was cryptic for me, but it
>   clearly seems to be the glibc/ptmalloc feature)

return (*((size_t *)ptr - 1) & -2) - 2*sizeof(size_t);


> - 4 function-wrappers in math code: __isnan(), __isnanf(), __isinf(),
>   __isinff()

Reasonable to add; perhaps even more efficient than the current
approach.

There's also that function named "finite" whose name violates the
namespace and thus it cannot be in a common source file with other
stuff that could be needed by conformant code.

> - __xmknod()

Ugly but this should be added; it's analogous to the __xstat junk.

> - _IO_2_1_stdout_ -> stdout

Very ugly, but shouldn't break anything...

> gtk2 will not work that way, I checked. One library in chain requires
> libstdc++, libstdc++ defines 'unique' symbols (see manual page of
> binutils nm) which musl linker cannot handle. Additionally, there is
> much more missing symbols including missing functions. But plain X11
> apps worked (I checked xfontsel and xlogo).

Have you looked into building the apps/libs natively against musl
except for the nvidia binary blob, to see if the blob works under that
usage? I think that's a usage case that's a lot more applicable to
real-world usage of musl, and in fact it's probably the first real
reason anybody would be interested in having musl work with code that
was built against glibc...

Rich


  reply	other threads:[~2012-07-06  6:26 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-07 12:01 Hello orc
2012-06-07 13:13 ` Hello John Spencer
2012-06-07 15:18   ` Hello orc
2012-06-07 16:29     ` Hello John Spencer
2012-06-07 16:19       ` Hello Rich Felker
2012-06-07 17:15         ` Hello orc
2012-06-08  3:31           ` Hello Rich Felker
2012-06-08  5:49             ` Hello Isaac Dunham
2012-06-08 12:28             ` Hello aep
2012-06-08 14:14               ` Hello Rich Felker
2012-06-08 16:17                 ` Hello aep
2012-06-08 16:11                   ` Hello Rich Felker
2012-06-09  2:05                   ` Hello Isaac Dunham
2012-07-05 17:24             ` Hello orc
2012-07-05 23:34               ` Hello Rich Felker
2012-07-06  6:06                 ` Hello orc
2012-07-06  6:26                   ` Rich Felker [this message]
2012-07-06  8:22                     ` Hello orc
2012-07-06 23:14                       ` Hello idunham
2012-07-07  0:57                         ` Hello Rich Felker
2012-07-07  8:07                         ` Hello orc
2012-07-07 15:54                           ` Hello idunham
2012-07-08  9:09                             ` Hello orc
2012-06-07 17:45         ` Hello Christian Neukirchen
2012-06-07 18:03       ` Hello Jens Staal
2012-06-07 19:10         ` Hello John Spencer
2012-06-07 17:33     ` Hello Jens Staal
2012-06-07 17:59       ` Hello orc
2012-06-20  7:29     ` Hello orc
2012-06-23  1:43       ` Hello idunham
2012-06-23  1:51         ` Hello Rich Felker
2012-06-25 12:09           ` Hello orc
2012-06-25 11:59         ` Hello orc
2012-06-25 13:53           ` Hello idunham
2012-07-22 23:09 Hello idunham
2012-07-23  2:01 ` Hello Rich Felker
2012-07-23  3:49   ` Hello idunham
2012-07-23 21:01     ` Hello Rich Felker

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=20120706062614.GS544@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).