All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined
@ 2018-05-08  9:14 ` lizhijian
  0 siblings, 0 replies; 30+ messages in thread
From: Li Zhijian @ 2018-05-08  9:14 UTC (permalink / raw)
  To: shuah, linux-kselftest
  Cc: mingo, tglx, gregkh, pombredanne, ebiederm, luto, dave.hansen,
	linux-kernel, philip.li, leist.fnst, zhijianx.li, Li Zhijian

SEGV_PKUERR and SEGV_BNDERR are defined since glibc-2.27

fix the following issue:
-------------------
root@vm-lkp-nex04-4G-5 /usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86# make
gcc -m32 -o /usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86/protection_keys_32 -O2 -g -std=gnu99 -pthread -Wall -no-pie -DCAN_BUILD_32 -DCAN_BUILD_64 protection_keys.c -lrt -ldl -lm
gcc -m64 -o /usr/src/linux-selftests-x86_64-rhel-7.2-75bc37fefc4471e718ba8e651aa74673d4e0a9eb/tools/testing/selftests/x86/protection_keys_64 -O2 -g -std=gnu99 -pthread -Wall -no-pie -DCAN_BUILD_32 -DCAN_BUILD_64 protection_keys.c -lrt -ldl
protection_keys.c:228:0: warning: "SEGV_BNDERR" redefined
 #define SEGV_BNDERR     3  /* failed address bound checks */
 ^
In file included from /usr/include/signal.h:58:0,
                 from protection_keys.c:33:
/usr/include/bits/siginfo-consts.h:117:0: note: this is the location of the previous definition
 #  define SEGV_BNDERR SEGV_BNDERR
 ^
protection_keys.c:229:0: warning: "SEGV_PKUERR" redefined
 #define SEGV_PKUERR     4
 ^
In file included from /usr/include/signal.h:58:0,
                 from protection_keys.c:33:
/usr/include/bits/siginfo-consts.h:119:0: note: this is the location of the previous definition
 #  define SEGV_PKUERR SEGV_PKUERR
 ^
protection_keys.c:228:0: warning: "SEGV_BNDERR" redefined
 #define SEGV_BNDERR     3  /* failed address bound checks */
 ^
In file included from /usr/include/signal.h:58:0,
                 from protection_keys.c:33:
/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h:117:0: note: this is the location of the previous definition
 #  define SEGV_BNDERR SEGV_BNDERR
 ^
protection_keys.c:229:0: warning: "SEGV_PKUERR" redefined
 #define SEGV_PKUERR     4
 ^
In file included from /usr/include/signal.h:58:0,
                 from protection_keys.c:33:
/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h:119:0: note: this is the location of the previous definition
 #  define SEGV_PKUERR SEGV_PKUERR
 ^
-------------------

Signed-off-by: Li Zhijian <lizhijian@cn.fujitsu.com>
---
 tools/testing/selftests/x86/protection_keys.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/x86/protection_keys.c b/tools/testing/selftests/x86/protection_keys.c
index f15aa5a..757bb16 100644
--- a/tools/testing/selftests/x86/protection_keys.c
+++ b/tools/testing/selftests/x86/protection_keys.c
@@ -225,8 +225,12 @@ void dump_mem(void *dumpme, int len_bytes)
 	}
 }
 
-#define SEGV_BNDERR     3  /* failed address bound checks */
-#define SEGV_PKUERR     4
+#ifndef SEGV_BNDERR
+# define SEGV_BNDERR     3  /* failed address bound checks */
+#endif
+#ifndef SEGV_PKUERR
+# define SEGV_PKUERR     4
+#endif
 
 static char *si_code_str(int si_code)
 {
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2018-05-18 10:10 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-08  9:14 [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined Li Zhijian
2018-05-08  9:14 ` Li Zhijian
2018-05-08  9:14 ` lizhijian
2018-05-08  9:14 ` [PATCH 2/2] tools/testing/selftests/x86: fix error: conflicting types for 'pkey_get|pkey_set' Li Zhijian
2018-05-08  9:14   ` Li Zhijian
2018-05-08  9:14   ` lizhijian
2018-05-08 16:30   ` Dave Hansen
2018-05-08 16:30     ` Dave Hansen
2018-05-08 16:30     ` dave.hansen
2018-05-08 17:36     ` Shuah Khan
2018-05-08 17:36       ` Shuah Khan
2018-05-08 17:36       ` shuah
2018-05-14  9:30     ` Ingo Molnar
2018-05-14  9:30       ` Ingo Molnar
2018-05-14  9:30       ` mingo.kernel.org
2018-05-08 16:25 ` [PATCH 1/2] tools/testing/selftests/x86: fix warning: "SEGV_PKUERR|SEGV_BNDERR" redefined Dave Hansen
2018-05-08 16:25   ` Dave Hansen
2018-05-08 16:25   ` dave.hansen
2018-05-08 17:35   ` Shuah Khan
2018-05-08 17:35     ` Shuah Khan
2018-05-08 17:35     ` shuah
2018-05-14  9:31     ` Ingo Molnar
2018-05-14  9:31       ` Ingo Molnar
2018-05-14  9:31       ` mingo
2018-05-15 20:08       ` Shuah Khan
2018-05-15 20:08         ` Shuah Khan
2018-05-15 20:08         ` shuah
2018-05-18 10:10         ` Ingo Molnar
2018-05-18 10:10           ` Ingo Molnar
2018-05-18 10:10           ` mingo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.