From ef32e9b6a325d1d013b30d898b4dff94082902cd Mon Sep 17 00:00:00 2001 From: Thomas Weißschuh Date: Wed, 7 Aug 2024 23:51:41 +0200 Subject: tools/nolibc: move entrypoint specifics to compiler.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The specific attributes for the _start entrypoint are duplicated for each architecture. Deduplicate it into a dedicated #define into compiler.h. For clang compatibility, the epilogue will also need to be adapted, so move that one, too. Acked-by: Willy Tarreau Link: https://lore.kernel.org/r/20240807-nolibc-llvm-v2-5-c20f2f5fc7c2@weissschuh.net Signed-off-by: Thomas Weißschuh --- tools/include/nolibc/compiler.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tools/include/nolibc/compiler.h') diff --git a/tools/include/nolibc/compiler.h b/tools/include/nolibc/compiler.h index 1730d0454a55..3a1d5b8d4fb9 100644 --- a/tools/include/nolibc/compiler.h +++ b/tools/include/nolibc/compiler.h @@ -12,6 +12,9 @@ # define __nolibc_has_attribute(attr) 0 #endif +#define __nolibc_entrypoint __attribute__((optimize("Os", "omit-frame-pointer"))) +#define __nolibc_entrypoint_epilogue() __builtin_unreachable() + #if defined(__SSP__) || defined(__SSP_STRONG__) || defined(__SSP_ALL__) || defined(__SSP_EXPLICIT__) #define _NOLIBC_STACKPROTECTOR -- cgit v1.2.3