From: Willy Tarreau <w@1wt.eu>
To: David Laight <David.Laight@ACULAB.COM>
Cc: "Thomas Weißschuh" <linux@weissschuh.net>,
"Rodrigo Campos" <rodrigo@sdfg.com.ar>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 0/1] tools/nolibc/string: export strlen()
Date: Sat, 27 Jan 2024 22:27:28 +0100 [thread overview]
Message-ID: <20240127212728.GA14846@1wt.eu> (raw)
In-Reply-To: <512849f3c22e4f4688c20fabe017c903@AcuMS.aculab.com>
On Sat, Jan 27, 2024 at 09:23:01PM +0000, David Laight wrote:
> ..
> > Yes, once we have the proof that the compiler may produce such a call, it
> > can also happen in whatever user code so we need to export the function,
> > there's no other solution.
>
> Does that mean that it you try to implement strlen() in C
> gcc will generate a recursive call?
Yes, that's exactly what happened the first time with strlen() itself!
> I guess an 'asm volatile("");' in the loop fix it.
That's how we fixed it for strlen(). The problem I'm having with
addressing it this way is that as long as the compiler will decide
to emit calls to strlen() which was not explicitly referenced in
the code, it will still be missing and will continue to fail. Thus
the safest solution is to make sure strlen() remains accessible in
case the compiler decides to make use of it.
Willy
prev parent reply other threads:[~2024-01-27 21:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 14:24 [PATCH 0/1] tools/nolibc/string: export strlen() Rodrigo Campos
2024-01-26 14:24 ` [PATCH 1/1] " Rodrigo Campos
2024-01-27 14:53 ` [PATCH 0/1] " Thomas Weißschuh
2024-01-27 16:24 ` Willy Tarreau
2024-01-27 17:28 ` Rodrigo Campos
2024-01-27 21:23 ` David Laight
2024-01-27 21:27 ` Willy Tarreau [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=20240127212728.GA14846@1wt.eu \
--to=w@1wt.eu \
--cc=David.Laight@ACULAB.COM \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=rodrigo@sdfg.com.ar \
/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