selftests/futex: Fix futex_wait() for 32bit ARM
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 27 Aug 2025 13:00:11 +0000 (15:00 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 1 Sep 2025 14:26:55 +0000 (16:26 +0200)
commit237bfb76c90b184f57bb18fe35ff366c19393dc8
tree241c7d912eef0ebf4976bb2ac8e48fdf10c9a4d2
parent5fdb877b4916a1eb2b2c85018c2311855893405b
selftests/futex: Fix futex_wait() for 32bit ARM

On 32bit ARM systems gcc-12 will use 32bit timestamps while gcc-13 and later
will use 64bit timestamps.  The problem is that SYS_futex will continue
pointing at the 32bit system call.  This makes the futex_wait test fail like
this:

  waiter failed errno 110
  not ok 1 futex_wake private returned: 0 Success
  waiter failed errno 110
  not ok 2 futex_wake shared (page anon) returned: 0 Success
  waiter failed errno 110
  not ok 3 futex_wake shared (file backed) returned: 0 Success

Instead of compiling differently depending on the gcc version, use the
-D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 options to ensure that 64bit timestamps
are used.  Then use ifdefs to make SYS_futex point to the 64bit system call.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: André Almeida <andrealmeid@igalia.com>
Tested-by: Anders Roxell <anders.roxell@linaro.org>
Link: https://lore.kernel.org/20250827130011.677600-6-bigeasy@linutronix.de
tools/testing/selftests/futex/functional/Makefile
tools/testing/selftests/futex/include/futextest.h