[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f9192cc-245c-4adf-b72f-61f0537e7f26@arm.com>
Date: Fri, 28 Feb 2025 12:29:31 +0000
From: Vincenzo Frascino <vincenzo.frascino@....com>
To: Thomas Weißschuh <thomas.weissschuh@...utronix.de>,
Kees Cook <kees@...nel.org>, Eric Biederman <ebiederm@...ssion.com>,
Shuah Khan <shuah@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
Andy Lutomirski <luto@...nel.org>, Thomas Gleixner <tglx@...utronix.de>,
Willy Tarreau <w@....eu>, Thomas Weißschuh
<linux@...ssschuh.net>
Cc: "Jason A. Donenfeld" <Jason@...c4.com>,
Christophe Leroy <christophe.leroy@...roup.eu>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-kselftest@...r.kernel.org,
llvm@...ts.linux.dev
Subject: Re: [PATCH v2 13/16] selftests: vDSO: parse_vdso: Test
__SIZEOF_LONG__ instead of ULONG_MAX
On 26/02/2025 11:44, Thomas Weißschuh wrote:
> 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 no 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 <thomas.weissschuh@...utronix.de>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@....com>
> ---
> tools/testing/selftests/vDSO/parse_vdso.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/vDSO/parse_vdso.c b/tools/testing/selftests/vDSO/parse_vdso.c
> index 200c534cc70e2c2381fce3be5c0ebe4cb5675e84..902b8f9984a1f70049d46bcd4f199df24f507dcb 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
>
--
Regards,
Vincenzo
Powered by blists - more mailing lists