aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/glibc/0028-bits-siginfo-consts.h-enum-definition-for-TRAP_HWBKP.patch
blob: fae8d0040d64a7d77d6657c07d3433e7cbd0b2ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
From 38fad3e5ab3b45c56810abd35fa11a72fa10b8f1 Mon Sep 17 00:00:00 2001
From: Pratyush Anand <panand@redhat.com>
Date: Wed, 22 Mar 2017 17:02:38 +0530
Subject: [PATCH] bits/siginfo-consts.h: enum definition for TRAP_HWBKPT is
 missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Compile following linux kernel test code with latest glibc:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/testing/selftests/breakpoints/breakpoint_test_arm64.c

and we get following error:
breakpoint_test_arm64.c: In function ‘run_test’:
breakpoint_test_arm64.c:171:25: error: ‘TRAP_HWBKPT’ undeclared (first use in this function)
  if (siginfo.si_code != TRAP_HWBKPT) {
                         ^
I can compile test code by modifying my local
/usr/include/bits/siginfo.h and test works great. Therefore, this patch
will be needed in upstream glibc so that issue is fixed there as well.

Signed-off-by: Pratyush Anand <panand@redhat.com>

Upstream-Status: Submitted [https://sourceware.org/bugzilla/show_bug.cgi?id=21286]
---
 bits/siginfo-consts.h                         | 6 +++++-
 sysdeps/unix/sysv/linux/bits/siginfo-consts.h | 6 +++++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/bits/siginfo-consts.h b/bits/siginfo-consts.h
index 7464c1882b..298314527a 100644
--- a/bits/siginfo-consts.h
+++ b/bits/siginfo-consts.h
@@ -106,8 +106,12 @@ enum
 {
   TRAP_BRKPT = 1,		/* Process breakpoint.  */
 #  define TRAP_BRKPT	TRAP_BRKPT
-  TRAP_TRACE			/* Process trace trap.  */
+  TRAP_TRACE,			/* Process trace trap.  */
 #  define TRAP_TRACE	TRAP_TRACE
+  TRAP_BRANCH,			/* Process branch trap. */
+# define TRAP_BRANCH	TRAP_BRANCH
+  TRAP_HWBKPT			/* hardware breakpoint/watchpoint  */
+# define TRAP_HWBKPT	TRAP_HWBKPT
 };
 # endif
 
diff --git a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
index 193bd9c471..3fe852bc5f 100644
--- a/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
+++ b/sysdeps/unix/sysv/linux/bits/siginfo-consts.h
@@ -141,8 +141,12 @@ enum
 {
   TRAP_BRKPT = 1,		/* Process breakpoint.  */
 #  define TRAP_BRKPT	TRAP_BRKPT
-  TRAP_TRACE			/* Process trace trap.  */
+  TRAP_TRACE,			/* Process trace trap.  */
 #  define TRAP_TRACE	TRAP_TRACE
+  TRAP_BRANCH,			/* Process branch trap. */
+# define TRAP_BRANCH	TRAP_BRANCH
+  TRAP_HWBKPT			/* hardware breakpoint/watchpoint  */
+# define TRAP_HWBKPT	TRAP_HWBKPT
 };
 # endif