On Mon, Nov 16, 2020 at 11:07 AM Khem Raj <[email protected]> wrote: > > glibc does not define SYS_futex for 32bit architectures using 64bit > time_t e.g. riscv32, therefore perf fails to compile as it does not find > SYS_futex in C library headers, define it to SYS_futex_time64 when it > exists > > Upstream-Status: Pending > Signed-off-by: Khem Raj <[email protected]>
Reviewed-by: Alistair Francis <[email protected]> Alistair > --- > tools/perf/bench/futex.h | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/tools/perf/bench/futex.h b/tools/perf/bench/futex.h > index 31b53cc7d5bc..33f3f3230ae1 100644 > --- a/tools/perf/bench/futex.h > +++ b/tools/perf/bench/futex.h > @@ -13,6 +13,19 @@ > #include <sys/types.h> > #include <linux/futex.h> > > +/** > + * SYS_futex is expected from system C library, > + * in glibc (/usr/include/bits/syscall.h defines it in terms of of NR_futex) > + * some newer 32bit architectures e.g. RISCV32 is using 64bit time_t from > + * get go unlike other 32bit architectures in glibc, therefore it wont have > + * NR_futex defined but just NR_futex_time64 this aliases it to NR_futex > + * so that SYS_futex is then defined for rv32 > +*/ > + > +#if !defined(SYS_futex) && defined(SYS_futex_time64) > +#define SYS_futex SYS_futex_time64 > +#endif > + > /** > * futex() - SYS_futex syscall wrapper > * @uaddr: address of first futex > -- > 2.29.2 >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#9164): https://lists.yoctoproject.org/g/linux-yocto/message/9164 Mute This Topic: https://lists.yoctoproject.org/mt/78299646/21656 Group Owner: [email protected] Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
