summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2025-04-19 12:46:19 +0200
committerThomas Weißschuh <linux@weissschuh.net>2025-04-19 14:17:52 +0200
commitf4152715dcd5c580dca6ea628ec03785bba44b9a (patch)
tree4f6af627e48f00967cd7ffc44e08f6e4ac8be5fe
parent8399f14666688be8d84cb3ccbec6ee790c020b36 (diff)
tools/nolibc: add __nolibc_aligned() and __nolibc_aligned_as()
Provide a convenience macro around __attribute__((aligned)). Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Acked-by: Willy Tarreau <w@1wt.eu> Link: https://lore.kernel.org/r/20250419-nolibc-ubsan-v2-2-060b8a016917@weissschuh.net
-rw-r--r--tools/include/nolibc/compiler.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools/include/nolibc/compiler.h b/tools/include/nolibc/compiler.h
index e6d6dc116e43..369cfb5a0e78 100644
--- a/tools/include/nolibc/compiler.h
+++ b/tools/include/nolibc/compiler.h
@@ -18,6 +18,9 @@
# define __nolibc_has_feature(feature) 0
#endif
+#define __nolibc_aligned(alignment) __attribute__((aligned(alignment)))
+#define __nolibc_aligned_as(type) __nolibc_aligned(__alignof__(type))
+
#if __nolibc_has_attribute(naked)
# define __nolibc_entrypoint __attribute__((naked))
# define __nolibc_entrypoint_epilogue()