Commit 08ab9580 authored by Thomas Weißschuh's avatar Thomas Weißschuh
Browse files

tools/nolibc: create __nolibc_no_sanitize_ubsan



The logic to disable UBSAN will become a bit more complicated.
Move it out into compiler.h, so crt.h stays readable.

Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Link: https://patch.msgid.link/20260408-nolibc-gcc-15-v1-1-330d0c40f894@weissschuh.net
parent 598b670a
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -80,4 +80,10 @@
/* Make the optimizer believe the variable can be manipulated arbitrarily. */
#define _NOLIBC_OPTIMIZER_HIDE_VAR(var)	__asm__ ("" : "+r" (var))

#if __nolibc_has_feature(undefined_behavior_sanitizer)
#  define __nolibc_no_sanitize_undefined __attribute__((no_sanitize("function")))
#else
#  define __nolibc_no_sanitize_undefined
#endif

#endif /* _NOLIBC_COMPILER_H */
+1 −4
Original line number Diff line number Diff line
@@ -47,10 +47,7 @@ char *__nolibc_program_invocation_short_name(char *long_name)
#endif /* NOLIBC_IGNORE_ERRNO */

void _start_c(long *sp);
__attribute__((weak,used))
#if __nolibc_has_feature(undefined_behavior_sanitizer)
	__attribute__((no_sanitize("function")))
#endif
__attribute__((weak,used)) __nolibc_no_sanitize_undefined
void _start_c(long *sp)
{
	long argc;