[PATCH 0/2] nolibc: fix two build issues at -O0

Willy Tarreau posted 2 patches 4 years, 3 months ago
tools/include/nolibc/stdlib.h | 22 +++++++++++++++-------
tools/include/nolibc/string.h | 11 ++++++++++-
2 files changed, 25 insertions(+), 8 deletions(-)
[PATCH 0/2] nolibc: fix two build issues at -O0
Posted by Willy Tarreau 4 years, 3 months ago
Hello Paul,

please find in this series two build fixes to apply on top of the series
you've already queued:
 - gcc errors at -O0 because it doesn't eliminate non-inline code and
   keeps the reference to the external "environ" from getenv()
 - clang fails at -O0 because __builtin_strlen() calls strlen()

I don't care about optimizing at -O0 by definition but at least it should
build and work correctly! I've verified that rcutorture still runs.

Thanks!
Willy

---
Willy Tarreau (2):
  tools/nolibc/string: do not use __builtin_strlen() at -O0
  tools/nolibc/stdlib: only reference the external environ when inlined

 tools/include/nolibc/stdlib.h | 22 +++++++++++++++-------
 tools/include/nolibc/string.h | 11 ++++++++++-
 2 files changed, 25 insertions(+), 8 deletions(-)

-- 
2.35.1
Re: [PATCH 0/2] nolibc: fix two build issues at -O0
Posted by Paul E. McKenney 4 years, 3 months ago
On Wed, Mar 23, 2022 at 08:18:05AM +0100, Willy Tarreau wrote:
> Hello Paul,
> 
> please find in this series two build fixes to apply on top of the series
> you've already queued:
>  - gcc errors at -O0 because it doesn't eliminate non-inline code and
>    keeps the reference to the external "environ" from getenv()
>  - clang fails at -O0 because __builtin_strlen() calls strlen()
> 
> I don't care about optimizing at -O0 by definition but at least it should
> build and work correctly! I've verified that rcutorture still runs.

Queued with Ammar's Tested-by, thank you both!

							Thanx, Paul

> Thanks!
> Willy
> 
> ---
> Willy Tarreau (2):
>   tools/nolibc/string: do not use __builtin_strlen() at -O0
>   tools/nolibc/stdlib: only reference the external environ when inlined
> 
>  tools/include/nolibc/stdlib.h | 22 +++++++++++++++-------
>  tools/include/nolibc/string.h | 11 ++++++++++-
>  2 files changed, 25 insertions(+), 8 deletions(-)
> 
> -- 
> 2.35.1
>