summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-04 22:47:18 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-05 17:48:29 +0100
commit671b49e077b11d28a16122c5847a6638957fe2d4 (patch)
treec1c64d4268af4ab2d50949c5ceac40f5fda6ed7c /meta/recipes-devtools/elfutils
parenta15eea5077506111e4167a2361da0306d23543f3 (diff)
downloadpoky-671b49e077b11d28a16122c5847a6638957fe2d4.tar.gz
elfutils: Add patch from upstream for glibc 2.34 ptest fixes
Add a patch being discussed upstream to fix a ptest issue with glibc 2.34. (From OE-Core rev: 8921f2acfd566d2c03cea7bdb9f0b1883994148b) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/elfutils')
-rw-r--r--meta/recipes-devtools/elfutils/elfutils_0.185.bb1
-rw-r--r--meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch138
2 files changed, 139 insertions, 0 deletions
diff --git a/meta/recipes-devtools/elfutils/elfutils_0.185.bb b/meta/recipes-devtools/elfutils/elfutils_0.185.bb
index 3e06e7b200..5031ab97e7 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.185.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.185.bb
@@ -22,6 +22,7 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
22 file://ptest.patch \ 22 file://ptest.patch \
23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \ 23 file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
24 file://0001-debuginfod-debuginfod-client.c-correct-string-format.patch \ 24 file://0001-debuginfod-debuginfod-client.c-correct-string-format.patch \
25 file://glibc-2.34-fix.patch \
25 " 26 "
26SRC_URI:append:libc-musl = " \ 27SRC_URI:append:libc-musl = " \
27 file://0002-musl-libs.patch \ 28 file://0002-musl-libs.patch \
diff --git a/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch b/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch
new file mode 100644
index 0000000000..9509fb4e77
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/glibc-2.34-fix.patch
@@ -0,0 +1,138 @@
1glibc 2.34 calls pthread_kill from the raise function. Before raise
2directly called the (tg)kill syscall. So allow pthread_kill to be the
3first frame in a backtrace where raise is expected. Also change some
4asserts to fprintf plus abort to make it more clear why the testcase
5fails.
6
7https://sourceware.org/bugzilla/show_bug.cgi?id=28190
8
9Signed-off-by: Mark Wielaard <mark@klomp.org>
10Upstream-Status: Submitted [https://sourceware.org/pipermail/elfutils-devel/2021q3/004019.html]
11---
12 tests/ChangeLog | 6 +++++
13 tests/backtrace.c | 62 +++++++++++++++++++++++++++++++++++++++++------
14 2 files changed, 61 insertions(+), 7 deletions(-)
15
16Index: elfutils-0.185/tests/ChangeLog
17===================================================================
18--- elfutils-0.185.orig/tests/ChangeLog
19+++ elfutils-0.185/tests/ChangeLog
20@@ -1,3 +1,9 @@
21+2021-08-04 Mark Wielaard <mark@klomp.org>
22+
23+ PR28190
24+ * backtrace.c (callback_verify): Check for pthread_kill as first
25+ frame. Change asserts to fprintf plus abort.
26+
27 2021-05-14 Frank Ch. Eigler <fche@redhat.com>
28
29 PR27859
30Index: elfutils-0.185/tests/backtrace.c
31===================================================================
32--- elfutils-0.185.orig/tests/backtrace.c
33+++ elfutils-0.185/tests/backtrace.c
34@@ -97,6 +97,9 @@ callback_verify (pid_t tid, unsigned fra
35 static bool reduce_frameno = false;
36 if (reduce_frameno)
37 frameno--;
38+ static bool pthread_kill_seen = false;
39+ if (pthread_kill_seen)
40+ frameno--;
41 if (! use_raise_jmp_patching && frameno >= 2)
42 frameno += 2;
43 const char *symname2 = NULL;
44@@ -107,11 +110,26 @@ callback_verify (pid_t tid, unsigned fra
45 && (strcmp (symname, "__kernel_vsyscall") == 0
46 || strcmp (symname, "__libc_do_syscall") == 0))
47 reduce_frameno = true;
48+ else if (! pthread_kill_seen && symname
49+ && strstr (symname, "pthread_kill") != NULL)
50+ pthread_kill_seen = true;
51 else
52- assert (symname && strcmp (symname, "raise") == 0);
53+ {
54+ if (!symname || strcmp (symname, "raise") != 0)
55+ {
56+ fprintf (stderr,
57+ "case 0: expected symname 'raise' got '%s'\n", symname);
58+ abort ();
59+ }
60+ }
61 break;
62 case 1:
63- assert (symname != NULL && strcmp (symname, "sigusr2") == 0);
64+ if (symname == NULL || strcmp (symname, "sigusr2") != 0)
65+ {
66+ fprintf (stderr,
67+ "case 1: expected symname 'sigusr2' got '%s'\n", symname);
68+ abort ();
69+ }
70 break;
71 case 2: // x86_64 only
72 /* __restore_rt - glibc maybe does not have to have this symbol. */
73@@ -120,11 +138,21 @@ callback_verify (pid_t tid, unsigned fra
74 if (use_raise_jmp_patching)
75 {
76 /* Verify we trapped on the very first instruction of jmp. */
77- assert (symname != NULL && strcmp (symname, "jmp") == 0);
78+ if (symname == NULL || strcmp (symname, "jmp") != 0)
79+ {
80+ fprintf (stderr,
81+ "case 3: expected symname 'raise' got '%s'\n", symname);
82+ abort ();
83+ }
84 mod = dwfl_addrmodule (dwfl, pc - 1);
85 if (mod)
86 symname2 = dwfl_module_addrname (mod, pc - 1);
87- assert (symname2 == NULL || strcmp (symname2, "jmp") != 0);
88+ if (symname2 == NULL || strcmp (symname2, "jmp") != 0)
89+ {
90+ fprintf (stderr,
91+ "case 3: expected symname2 'jmp' got '%s'\n", symname2);
92+ abort ();
93+ }
94 break;
95 }
96 FALLTHROUGH;
97@@ -137,11 +165,22 @@ callback_verify (pid_t tid, unsigned fra
98 duplicate_sigusr2 = true;
99 break;
100 }
101- assert (symname != NULL && strcmp (symname, "stdarg") == 0);
102+ if (symname == NULL || strcmp (symname, "stdarg") != 0)
103+ {
104+ fprintf (stderr,
105+ "case 4: expected symname 'stdarg' got '%s'\n", symname);
106+ abort ();
107+ }
108 break;
109 case 5:
110 /* Verify we trapped on the very last instruction of child. */
111- assert (symname != NULL && strcmp (symname, "backtracegen") == 0);
112+ if (symname == NULL || strcmp (symname, "backtracegen") != 0)
113+ {
114+ fprintf (stderr,
115+ "case 5: expected symname 'backtracegen' got '%s'\n",
116+ symname);
117+ abort ();
118+ }
119 mod = dwfl_addrmodule (dwfl, pc);
120 if (mod)
121 symname2 = dwfl_module_addrname (mod, pc);
122@@ -151,7 +190,15 @@ callback_verify (pid_t tid, unsigned fra
123 // instructions or even inserts some padding instructions at the end
124 // (which apparently happens on ppc64).
125 if (use_raise_jmp_patching)
126- assert (symname2 == NULL || strcmp (symname2, "backtracegen") != 0);
127+ {
128+ if (symname2 != NULL && strcmp (symname2, "backtracegen") == 0)
129+ {
130+ fprintf (stderr,
131+ "use_raise_jmp_patching didn't expect symname2 "
132+ "'backtracegen'\n");
133+ abort ();
134+ }
135+ }
136 break;
137 }
138 }