mbox series

[00/12] tools/nolibc: improve LLVM/clang support

Message ID 20240728-nolibc-llvm-v1-0-bc384269bc35@weissschuh.net (mailing list archive)
Headers show
Series tools/nolibc: improve LLVM/clang support | expand

Message

Thomas Weißschuh July 28, 2024, 10:09 a.m. UTC
The current support for LLVM and clang in nolibc and its testsuite is
very limited.

* Various architectures plain do not compile
* The user *has* to specify "-Os" otherwise the program crashes
* Cross-compilation of the tests does not work
* Using clang is not wired up in run-tests.sh

This series extends this support.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (12):
      tools/nolibc: use clang-compatible asm syntax in arch-arm.h
      tools/nolibc: limit powerpc stack-protector workaround to GCC
      tools/nolibc: move entrypoint specifics to compiler.h
      tools/nolibc: use attribute((naked)) if available
      selftests/nolibc: report failure if no testcase passed
      selftests/nolibc: avoid passing NULL to printf("%s")
      selftests/nolibc: determine $(srctree) first
      selftests/nolibc: setup objtree without Makefile.include
      selftests/nolibc: add support for LLVM= parameter
      selftests/nolibc: add cc-option compatible with clang cross builds
      selftests/nolibc: run-tests.sh: avoid overwriting CFLAGS_EXTRA
      selftests/nolibc: run-tests.sh: allow building through LLVM

 tools/include/nolibc/arch-aarch64.h          |  4 ++--
 tools/include/nolibc/arch-arm.h              |  8 ++++----
 tools/include/nolibc/arch-i386.h             |  4 ++--
 tools/include/nolibc/arch-loongarch.h        |  4 ++--
 tools/include/nolibc/arch-mips.h             |  4 ++--
 tools/include/nolibc/arch-powerpc.h          |  6 +++---
 tools/include/nolibc/arch-riscv.h            |  4 ++--
 tools/include/nolibc/arch-s390.h             |  4 ++--
 tools/include/nolibc/arch-x86_64.h           |  4 ++--
 tools/include/nolibc/compiler.h              | 12 ++++++++++++
 tools/testing/selftests/nolibc/Makefile      | 27 ++++++++++++++++-----------
 tools/testing/selftests/nolibc/nolibc-test.c |  4 ++--
 tools/testing/selftests/nolibc/run-tests.sh  | 20 ++++++++++++++++----
 13 files changed, 67 insertions(+), 38 deletions(-)
---
base-commit: 0db287736bc586fcd5a2925518ef09eec6924803
change-id: 20240727-nolibc-llvm-3fad68590d4c

Best regards,

Comments

Shuah Khan July 29, 2024, 7:26 p.m. UTC | #1
On 7/28/24 04:09, Thomas Weißschuh wrote:
> The current support for LLVM and clang in nolibc and its testsuite is
> very limited.
> 
> * Various architectures plain do not compile
> * The user *has* to specify "-Os" otherwise the program crashes
> * Cross-compilation of the tests does not work
> * Using clang is not wired up in run-tests.sh
> 
> This series extends this support.
> 
> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
> ---
> Thomas Weißschuh (12):
>        tools/nolibc: use clang-compatible asm syntax in arch-arm.h
>        tools/nolibc: limit powerpc stack-protector workaround to GCC
>        tools/nolibc: move entrypoint specifics to compiler.h
>        tools/nolibc: use attribute((naked)) if available
>        selftests/nolibc: report failure if no testcase passed
>        selftests/nolibc: avoid passing NULL to printf("%s")
>        selftests/nolibc: determine $(srctree) first
>        selftests/nolibc: setup objtree without Makefile.include
>        selftests/nolibc: add support for LLVM= parameter
>        selftests/nolibc: add cc-option compatible with clang cross builds
>        selftests/nolibc: run-tests.sh: avoid overwriting CFLAGS_EXTRA
>        selftests/nolibc: run-tests.sh: allow building through LLVM
> 

Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

thanks,
-- Shuah
Shuah Khan July 29, 2024, 7:27 p.m. UTC | #2
On 7/29/24 13:26, Shuah Khan wrote:
> On 7/28/24 04:09, Thomas Weißschuh wrote:
>> The current support for LLVM and clang in nolibc and its testsuite is
>> very limited.
>>
>> * Various architectures plain do not compile
>> * The user *has* to specify "-Os" otherwise the program crashes
>> * Cross-compilation of the tests does not work
>> * Using clang is not wired up in run-tests.sh
>>
>> This series extends this support.
>>
>> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
>> ---
>> Thomas Weißschuh (12):
>>        tools/nolibc: use clang-compatible asm syntax in arch-arm.h
>>        tools/nolibc: limit powerpc stack-protector workaround to GCC
>>        tools/nolibc: move entrypoint specifics to compiler.h
>>        tools/nolibc: use attribute((naked)) if available
>>        selftests/nolibc: report failure if no testcase passed
>>        selftests/nolibc: avoid passing NULL to printf("%s")
>>        selftests/nolibc: determine $(srctree) first
>>        selftests/nolibc: setup objtree without Makefile.include
>>        selftests/nolibc: add support for LLVM= parameter
>>        selftests/nolibc: add cc-option compatible with clang cross builds
>>        selftests/nolibc: run-tests.sh: avoid overwriting CFLAGS_EXTRA
>>        selftests/nolibc: run-tests.sh: allow building through LLVM
>>
> 
> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org>

For the selftest changes.

thanks,
-- Shuah
Willy Tarreau Aug. 3, 2024, 9:50 a.m. UTC | #3
On Sun, Jul 28, 2024 at 12:09:54PM +0200, Thomas Weißschuh wrote:
> The current support for LLVM and clang in nolibc and its testsuite is
> very limited.
> 
> * Various architectures plain do not compile
> * The user *has* to specify "-Os" otherwise the program crashes
> * Cross-compilation of the tests does not work
> * Using clang is not wired up in run-tests.sh
> 
> This series extends this support.

Overall Ack on the whole series once the minor comments are addressed
or discussed: Acked-by: Willy Tarreau <w@1wt.eu>

thanks!
Willy