From: Willy Tarreau <w@1wt.eu>
To: "Thomas Weißschuh" <linux@weissschuh.net>
Cc: Ammar Faizi <ammarfaizi2@gnuweeb.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] tools/nolibc: x86_64: wrap asm functions in functions
Date: Mon, 12 Aug 2024 21:38:26 +0200 [thread overview]
Message-ID: <Zrpksrnrbykx+IML@1wt.eu> (raw)
In-Reply-To: <65cf1965-841b-4fb1-9222-913c6bd9ccd4@t-8ch.de>
Hi Thomas,
On Mon, Aug 12, 2024 at 07:01:26PM +0200, Thomas Weißschuh wrote:
> > > The memcpy / memmove combination could be split up into one real
> > > function and one C inline wrapper and then the same pattern would apply.
> > >
> > > But to be honest I'd be fine with not supporting -flto on GCC.
> >
> > That could also be a reasonable solution. The primary goal of nolibc
> > is to make it easy for developers to develop tests, and for those who
> > want to create pre-boot code to do so. By nature this code is prone to
> > bugs. If it becomes totally unreadable for very unlikely cases, it will
> > cause issues that are hard to debug by the users themselves. It's sure
> > that supporting a variety of compilers and setups is great, but we should
> > keep in mind the maintainability goal when thinking about this. I think
> > that LTO will mostly be used for testing, and in this case I think it's
> > totally reasonable to restrict the choice of compatible compilers.
>
> IMO LTO is useful for nolibc to reduce the size of the generated binaries.
> For example the custom function sections that then can be combined with
> --gc-sections to get rid of unused functions is all implicit in LTO.
> And on top of that it can perform other size optimizations.
Well, probably, but my experience of it till now has been quite negative,
between stuff that doesn't build and stuff that takes ages to link on a
single core, for most of the time tiny to no gain at all :-/ But I admit
that in our case here at least we shouldn't witness long link times.
> But the complications for GCC are not worth it.
> And there seem general with LTO on GCC anyways as evidenced by the
> constructor and duplicate-asm bugs.
Yes, and the trouble it will cause will result in a lot of head-scratching
for those affected.
> After this discussion I think we should also change the __nolibc_naked
> attribute back to __nolibc_entrypoint as it was before.
> It is indeed not a replacement for a proper "naked".
Indeed, it sort of emulates it but does not have the exact same properties
as we've seen.
> What do you think about me rewriting the existing commits on nolibc-next
> to fix this up?
I'm obviously fine with this :-)
Thank you!
Willy
next prev parent reply other threads:[~2024-08-12 19:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-10 10:54 [PATCH 0/3] tools/nolibc: LTO compatibility Thomas Weißschuh
2024-08-10 10:54 ` [PATCH 1/3] tools/nolibc: crt: mark _start_c() as used Thomas Weißschuh
2024-08-10 10:54 ` [PATCH 2/3] tools/nolibc: stackprotector: mark implicitly used symbols " Thomas Weißschuh
2024-08-10 10:54 ` [PATCH 3/3] tools/nolibc: x86_64: wrap asm functions in functions Thomas Weißschuh
2024-08-10 12:12 ` Ammar Faizi
2024-08-10 12:37 ` Thomas Weißschuh
2024-08-10 14:35 ` Willy Tarreau
2024-08-10 16:04 ` Thomas Weißschuh
2024-08-10 16:45 ` Thomas Weißschuh
2024-08-10 17:00 ` Willy Tarreau
2024-08-12 17:01 ` Thomas Weißschuh
2024-08-12 19:38 ` Willy Tarreau [this message]
2024-08-10 19:16 ` Ammar Faizi
2024-08-10 19:45 ` Willy Tarreau
2024-08-10 20:10 ` Ammar Faizi
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=Zrpksrnrbykx+IML@1wt.eu \
--to=w@1wt.eu \
--cc=ammarfaizi2@gnuweeb.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox