mbox series

[0/7] tools/nolibc: autodetect stackprotector availability from compiler

Message ID 20230521-nolibc-automatic-stack-protector-v1-0-dad6c80c51c1@weissschuh.net (mailing list archive)
Headers show
Series tools/nolibc: autodetect stackprotector availability from compiler | expand

Message

Thomas Weißschuh May 21, 2023, 9:36 a.m. UTC
As suggested by Willy it is possible to detect the availability of
stackprotector via preprocessor defines.
Make use of that to simplify the code and interface of nolibc.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
Thomas Weißschuh (7):
      tools/nolibc: fix typo pint -> point
      tools/nolibc: x86_64: disable stack protector for _start
      tools/nolibc: ensure stack protector guard is never zero
      tools/nolibc: add test for __stack_chk_guard initialization
      tools/nolibc: reformat list of headers to be installed
      tools/nolibc: add autodetection for stackprotector support
      tools/nolibc: simplify stackprotector compiler flags

 tools/include/nolibc/Makefile                | 19 +++++++++++++++++--
 tools/include/nolibc/arch-aarch64.h          |  6 +++---
 tools/include/nolibc/arch-arm.h              |  6 +++---
 tools/include/nolibc/arch-i386.h             |  6 +++---
 tools/include/nolibc/arch-loongarch.h        |  6 +++---
 tools/include/nolibc/arch-mips.h             |  6 +++---
 tools/include/nolibc/arch-riscv.h            |  6 +++---
 tools/include/nolibc/arch-x86_64.h           |  8 ++++----
 tools/include/nolibc/arch.h                  |  2 +-
 tools/include/nolibc/compiler.h              | 15 +++++++++++++++
 tools/include/nolibc/stackprotector.h        | 15 ++++++---------
 tools/testing/selftests/nolibc/Makefile      | 13 ++-----------
 tools/testing/selftests/nolibc/nolibc-test.c | 10 +++++++++-
 13 files changed, 72 insertions(+), 46 deletions(-)
---
base-commit: 606343b7478c319cb30291a39ecbceddb42229d6
change-id: 20230521-nolibc-automatic-stack-protector-b4f7fab9e625

Best regards,

Comments

Willy Tarreau May 21, 2023, 10:08 a.m. UTC | #1
Hi Thomas,

On Sun, May 21, 2023 at 11:36:28AM +0200, Thomas Weißschuh wrote:
> As suggested by Willy it is possible to detect the availability of
> stackprotector via preprocessor defines.
> Make use of that to simplify the code and interface of nolibc.

I have just had a quick glance over it and not tested it yet, but
overall I really like it, thank you! I'll try to give you some
feedback today (or simply merge it).

Willy