mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: u-igbb@aetey.se
Cc: musl@lists.openwall.com
Subject: Re: compiling musl on x86_64 linux with pcc
Date: Tue, 26 Aug 2014 15:54:07 -0400	[thread overview]
Message-ID: <20140826195407.GG12888@brightrain.aerifal.cx> (raw)
In-Reply-To: <20140826193439.GH12376@example.net>

On Tue, Aug 26, 2014 at 09:34:39PM +0200, u-igbb@aetey.se wrote:
> Hello Rich,
> 
> On Mon, Aug 25, 2014 at 11:46:17AM -0400, Rich Felker wrote:
> > I have pcc 1.1.0.DEVEL 20130227 with pcc-libs-20130721 and it seems to
> > still work fine with current musl. Note that some fixes are needed for
> > pcc-libs:
> > 
> > - You need to remove the broken csu files and replace them with
> >   symlinks to the musl files.
> 
> I do not even generate crt[01in].o in pcclibs and of course use
> the musl ones.

OK, just checking.

> > - You need to add __attribute__((__visibility__("hidden"))) to all
> >   external functions in libpcc.
> 
> This does not seem to make any difference

It does. Failure to fix this will result in these symbols becoming
part of the public ABI of any .so file that pulls them in, and will
thereby prevent them from being linked into apps that use the .so file
(since the app will already have its need for them satisfied). If the
.so file later changes such that it no longer needs the functions (or
if it's upgraded to a version that's correctly linked with a libpcc.a
where these symbols are hidden, then such apps will break.

> (and probably would not 
> be noticeable with simple tests anyway?).

I agree that it would not be noticed right away, but it is important.

> > - You need to add -fPIC to the CFLAGS for building libpcc or you get a
> >   broken libpcc (containing textrels) that can't be used for building
> >   libc.so and that's harmful for use with any other shared libs.
> 
> I do.
> 
> Anyway, the brokenness is present with both static and dynamic linking.
> 
> (testing on i486-pc-linux-gnu)
> 
> I narrowed down what looks broken:
> *printf() with "%something" seems to pick wrong arguments,
> iow it looks like malfunctioning variadic args. (?)

I have not seen anything like that happening.

> > I just ran libc-test with libc.so built by pcc and confirmed that
> > there are no non-math regressions versus gcc-built libc.so. (I did not
> > check math in detail because there are lots of known math failures
> > that are not serious.)
> > 
> > Let me know if you have any further questions about my setup.
> 
> Is it possible to try pcc from 2014-08-24 in your environment?
> 
> If it is hard, I can test the old versions instead (when I can, right now
> my time slice is over).

I can, but at at later time. I've got lots of other things I'm trying
to get done without adding pcc testing right now. So if you want to go
ahead and try it, go ahead.

> PS
> (this variadic business reminds me again that stdarg.h should be provided
> by the compiler who knows what it can do to the generated functions and
> what it must do with the public ones - not by the library which can be
> used with different compilers and should not boldly assume the level of
> their intelligence)

This is unrelatd. pcc's version would be exactly the same thing, and
in fact, as I explained before, there is only one correct
implementation: builtin functions like __builtin_va_arg, etc. but
possibly with gratuitously different names or argument orders. In any
case there is no way to simply "let the compiler do it" because
certain other headers need to access or expose the va_list type, and
doing this with a compiler-provided stdarg.h requires knowledge of the
compiler versions internals in the libc headers, which is much worse
than the current situation.

Rich


  reply	other threads:[~2014-08-26 19:54 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  9:18 compiling musl on x86_64 linux with ppc u-igbb
2014-08-13  9:29 ` "pcc" of course ([musl] compiling musl on x86_64 linux with ppc) u-igbb
2014-08-13  9:49 ` compiling musl on x86_64 linux with ppc Szabolcs Nagy
2014-08-13 10:25   ` compiling musl on x86_64 linux with pcc u-igbb
2014-08-13 11:22     ` u-igbb
2014-08-13 11:53       ` summary: [musl] " u-igbb
2014-08-13 12:38 ` compiling musl on x86_64 linux with ppc Rich Felker
2014-08-13 12:56   ` u-igbb
2014-08-13 14:23     ` Rich Felker
2014-08-13 14:43       ` compiling musl on x86_64 linux with pcc u-igbb
2014-08-13 14:43       ` compiling musl on x86_64 linux with ppc Szabolcs Nagy
2014-08-14  7:10       ` compiling musl on x86_64 linux with pcc u-igbb
2014-08-14 14:20         ` Rich Felker
2014-08-14 14:38           ` u-igbb
2014-08-14 14:47             ` Rich Felker
2014-08-14 15:00               ` u-igbb
2014-08-15 10:49               ` va_list (was: [musl] compiling musl on x86_64 linux with pcc) u-igbb
2014-08-15 13:44                 ` Rich Felker
2014-08-15 15:07                   ` u-igbb
2014-08-15 15:56                     ` Rich Felker
2014-08-15 17:12                       ` u-igbb
2014-08-15  8:05       ` compiling musl on x86_64 linux with ppc u-igbb
2014-08-25  8:28       ` compiling musl on x86_64 linux with pcc u-igbb
2014-08-25  8:34         ` u-igbb
2014-08-25 15:46           ` Rich Felker
2014-08-26 19:34             ` u-igbb
2014-08-26 19:54               ` Rich Felker [this message]
2014-08-27  7:40                 ` u-igbb
2014-08-27  7:54                   ` Rich Felker
2014-08-27  8:52                     ` variadic args (was: [musl] compiling musl on x86_64 linux with pcc) u-igbb
2014-08-27 16:34                       ` Rich Felker
2014-08-28  8:13                         ` u-igbb
2014-08-28 14:40                           ` Rich Felker
2014-08-28 16:55                             ` u-igbb
2014-08-27 14:38             ` compiling musl with pcc (i486-pc-linux-gnu) " u-igbb
2014-08-27 16:36               ` Rich Felker
2014-09-23 19:05             ` compiling musl on x86_64 linux with pcc u-igbb
2014-09-23 19:31               ` Rich Felker
2014-09-24  8:26                 ` u-igbb
2014-08-13 23:39     ` compiling musl on x86_64 linux with ppc Isaac Dunham
2014-08-13 23:41       ` 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=20140826195407.GG12888@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.com \
    --cc=u-igbb@aetey.se \
    /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).