[PATCH v2 0/3] tools/nolibc: clang LTO compatibility

Thomas Weißschuh posted 3 patches 1 year, 6 months ago
tools/include/nolibc/arch-x86_64.h    | 4 ++--
tools/include/nolibc/crt.h            | 2 +-
tools/include/nolibc/stackprotector.h | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
[PATCH v2 0/3] tools/nolibc: clang LTO compatibility
Posted by Thomas Weißschuh 1 year, 6 months ago
A few tiny bugfixes and refactoring to provide compatibility with
clangs -flto.

$ CFLAGS_EXTRA=-flto ./run-tests.sh -m user -l       
i386:          195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
x86_64:        195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
arm64:         195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
arm:           195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
mips32le:      195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
mips32be:      195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
ppc:           195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
ppc64:         195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
ppc64le:       195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
riscv:         195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
s390:          195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
loongarch:     195 test(s): 192 passed,   3 skipped,   0 failed => status: warning

GCC is not supported, for details read the discussion in v1 of the
series.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Changes in v2:
- Drop GCC support
- arch-x86_64.h: Don't try to wrap the asm functions in C functions,
  Instead just replace the local symbol with a local label.
- Link to v1: https://lore.kernel.org/r/20240810-nolibc-lto-v1-0-a86e514c7fc1@weissschuh.net

---
Thomas Weißschuh (3):
      tools/nolibc: crt: mark _start_c() as used
      tools/nolibc: stackprotector: mark implicitly used symbols as used
      tools/nolibc: x86_64: use local label in memcpy/memmove

 tools/include/nolibc/arch-x86_64.h    | 4 ++--
 tools/include/nolibc/crt.h            | 2 +-
 tools/include/nolibc/stackprotector.h | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)
---
base-commit: 22ba81c50a49468d80055674d8d6f78afb1c92c4
change-id: 20240728-nolibc-lto-331813b72a0b

Best regards,
-- 
Thomas Weißschuh <linux@weissschuh.net>

Re: [PATCH v2 0/3] tools/nolibc: clang LTO compatibility
Posted by Willy Tarreau 1 year, 6 months ago
On Mon, Aug 12, 2024 at 10:50:16PM +0200, Thomas Weißschuh wrote:
> A few tiny bugfixes and refactoring to provide compatibility with
> clangs -flto.
> 
> $ CFLAGS_EXTRA=-flto ./run-tests.sh -m user -l       
> i386:          195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
> x86_64:        195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
> arm64:         195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
> arm:           195 test(s): 193 passed,   2 skipped,   0 failed => status: warning
> mips32le:      195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> mips32be:      195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> ppc:           195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> ppc64:         195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> ppc64le:       195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> riscv:         195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> s390:          195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> loongarch:     195 test(s): 192 passed,   3 skipped,   0 failed => status: warning
> 
> GCC is not supported, for details read the discussion in v1 of the
> series.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Changes in v2:
> - Drop GCC support
> - arch-x86_64.h: Don't try to wrap the asm functions in C functions,
>   Instead just replace the local symbol with a local label.
> - Link to v1: https://lore.kernel.org/r/20240810-nolibc-lto-v1-0-a86e514c7fc1@weissschuh.net

For the whole series:

Acked-by: Willy Tarreau <w@1wt.eu>

Thanks Thoams!
Willy