[PATCH] selftests/rseq: Fix unknown type name __weak for gcc 11.3.0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add the definition of the '__weak' attribute since it is not available in
GCC 11.3.0 and newer:

rseq.c:41:1: error: unknown type name ‘__weak’
   41 | __weak ptrdiff_t __rseq_offset;

Fixes: 3bcbc20942db ("selftests/rseq: Play nice with binaries statically linked against glibc 2.35+")
Signed-off-by: Anh Tuan Phan <tuananhlfc@xxxxxxxxx>
---
 tools/testing/selftests/rseq/rseq.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/rseq/rseq.c b/tools/testing/selftests/rseq/rseq.c
index a723da253244..584eec9b0930 100644
--- a/tools/testing/selftests/rseq/rseq.c
+++ b/tools/testing/selftests/rseq/rseq.c
@@ -34,6 +34,10 @@
 #include "../kselftest.h"
 #include "rseq.h"
 
+#ifndef __weak
+#define __weak __attribute__((weak))
+#endif
+
 /*
  * Define weak versions to play nice with binaries that are statically linked
  * against a libc that doesn't support registering its own rseq.
-- 
2.34.1




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux