tools/nolibc: Add _NOLIBC_OPTIMIZER_HIDE_VAR() to compiler.h

Needed to stop compiler 'optimisations' bloating code.
Equivalent to the definition in include/linux/compiler.h

Signed-off-by: David Laight <david.laight.linux@gmail.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Link: https://patch.msgid.link/20260308113742.12649-2-david.laight.linux@gmail.com
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
This commit is contained in:
David Laight
2026-03-08 11:37:26 +00:00
committed by Thomas Weißschuh
parent cf34708824
commit 6702425cd5

View File

@@ -71,4 +71,7 @@
# define __nolibc_static_assert(_t)
#endif
/* Make the optimizer believe the variable can be manipulated arbitrarily. */
#define _NOLIBC_OPTIMIZER_HIDE_VAR(var) __asm__ ("" : "+r" (var))
#endif /* _NOLIBC_COMPILER_H */