From: Thomas Weißschuh Date: Wed, 26 Feb 2025 11:44:52 +0000 (+0100) Subject: selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX X-Git-Tag: v6.15-rc1~202^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=032e871686483ec1bac27ce73e7094692fc76268;p=thirdparty%2Fkernel%2Flinux.git selftests: vDSO: parse_vdso: Test __SIZEOF_LONG__ instead of ULONG_MAX According to limits.h(2) ULONG_MAX is only guaranteed to expand to an expression, not a symbolic constant which can be evaluated by the preprocessor. Specifically the definition of ULONG_MAX from nolibc can not be evaluated by the preprocessor. To provide compatibility with nolibc, check with __SIZEOF_LONG__ instead, with is provided directly by the preprocessor and therefore always a symbolic constant. Signed-off-by: Thomas Weißschuh Signed-off-by: Thomas Gleixner Reviewed-by: Vincenzo Frascino Acked-by: Shuah Khan Link: https://lore.kernel.org/all/20250226-parse_vdso-nolibc-v2-13-28e14e031ed8@linutronix.de --- diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c index 200c534cc70e2..902b8f9984a1f 100644 --- a/tools/testing/selftests/vDSO/parse_vdso.c +++ b/tools/testing/selftests/vDSO/parse_vdso.c @@ -26,7 +26,7 @@ /* And here's the code. */ #ifndef ELF_BITS -# if ULONG_MAX > 0xffffffffUL +# if __SIZEOF_LONG__ >= 8 # define ELF_BITS 64 # else # define ELF_BITS 32