diff options
author | Victor Kamensky <victor.kamensky7@gmail.com> | 2024-06-09 20:34:03 -0700 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2024-10-02 06:15:15 -0700 |
commit | e7e5720dd48fc28490ccac2fb8d7053f331c1421 (patch) | |
tree | 4e4e381b700d0c76157e34dd739b180d874c23cf | |
parent | 2b073f0eaa1c9e7918c177af2452a210924b5be2 (diff) | |
download | poky-e7e5720dd48fc28490ccac2fb8d7053f331c1421.tar.gz |
systemtap: fix systemtap-native build error on Fedora 40
Backport of couple patches from upstream.
(From OE-Core rev: bca8aa07ce0cea82f6f17381efaeba897edab265)
Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cc486f26db46c562e35f770c16edf3f4035e536e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
3 files changed, 86 insertions, 0 deletions
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack-redux.patch b/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack-redux.patch new file mode 100644 index 0000000000..0c2888400d --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack-redux.patch | |||
@@ -0,0 +1,32 @@ | |||
1 | From 91caf37e4dfe862f9b68447b1597c0d0f31523c3 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Frank Ch. Eigler" <fche@redhat.com> | ||
3 | Date: Tue, 7 May 2024 15:04:04 -0400 | ||
4 | Subject: [PATCH] elaborate.cxx: gcc version compatibility hack redux | ||
5 | |||
6 | Note __GNUC__ >= 14 for this diagnostic. | ||
7 | |||
8 | Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=91caf37e4dfe862f9b68447b1597c0d0f31523c3] | ||
9 | Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com> | ||
10 | --- | ||
11 | elaborate.cxx | 2 ++ | ||
12 | 1 file changed, 2 insertions(+) | ||
13 | |||
14 | diff --git a/elaborate.cxx b/elaborate.cxx | ||
15 | index 88505559b..c08023f1d 100644 | ||
16 | --- a/elaborate.cxx | ||
17 | +++ b/elaborate.cxx | ||
18 | @@ -2656,9 +2656,11 @@ symresolution_info::symresolution_info (systemtap_session& s, bool omniscient_un | ||
19 | session (s), unmangled_p(omniscient_unmangled), current_function (0), current_probe (0) | ||
20 | { | ||
21 | #pragma GCC diagnostic push | ||
22 | + #if __GNUC__ >= 14 | ||
23 | // c10s early snapshot GCC complains about this construct, which is | ||
24 | // made safe via our dtor usage | ||
25 | #pragma GCC diagnostic ignored "-Wdangling-pointer" | ||
26 | + #endif | ||
27 | saved_session_symbol_resolver = s.symbol_resolver; | ||
28 | s.symbol_resolver = this; // save resolver for early PR25841 function resolution | ||
29 | #pragma GCC diagnostic pop | ||
30 | -- | ||
31 | 2.45.2 | ||
32 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack.patch b/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack.patch new file mode 100644 index 0000000000..7cdcc93f14 --- /dev/null +++ b/meta/recipes-kernel/systemtap/systemtap/0001-elaborate.cxx-gcc-version-compatibility-hack.patch | |||
@@ -0,0 +1,52 @@ | |||
1 | From d11241bdd05bc4c745c8aef53a2725331e1a93b4 Mon Sep 17 00:00:00 2001 | ||
2 | From: "Frank Ch. Eigler" <fche@redhat.com> | ||
3 | Date: Tue, 7 May 2024 14:25:12 -0400 | ||
4 | Subject: [PATCH] elaborate.cxx: gcc version compatibility hack | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | Suppress -Wdangling-pointer for a construct that appears valid, but | ||
10 | one particular GCC snapshot version complains about. | ||
11 | |||
12 | In constructor ‘symresolution_info::symresolution_info(systemtap_session&, bool)’, | ||
13 | inlined from ‘int semantic_pass_symbols(systemtap_session&)’ at ../systemtap/elaborate.cxx:1872:28: | ||
14 | ../systemtap/elaborate.cxx:2659:21: error: storing the address of local variable ‘sym’ in ‘*s.systemtap_session::symbol_resolver’ [-Werror=dangling-pointer=] | ||
15 | 2659 | s.symbol_resolver = this; // save resolver for early PR25841 function resolution | ||
16 | | ~~~~~~~~~~~~~~~~~~^~~~~~ | ||
17 | ../systemtap/elaborate.cxx: In function ‘int semantic_pass_symbols(systemtap_session&)’: | ||
18 | ../systemtap/elaborate.cxx:1872:22: note: ‘sym’ declared here | ||
19 | 1872 | symresolution_info sym (s); | ||
20 | | ^~~ | ||
21 | ../systemtap/elaborate.cxx:1870:43: note: ‘s’ declared here | ||
22 | 1870 | semantic_pass_symbols (systemtap_session& s) | ||
23 | | ~~~~~~~~~~~~~~~~~~~^ | ||
24 | cc1plus: all warnings being treated as errors | ||
25 | |||
26 | Upstream-Status: Backport [https://sourceware.org/git/?p=systemtap.git;a=commit;h=d11241bdd05bc4c745c8aef53a2725331e1a93b4] | ||
27 | Signed-off-by: Victor Kamensky <victor.kamensky7@gmail.com> | ||
28 | --- | ||
29 | elaborate.cxx | 5 +++++ | ||
30 | 1 file changed, 5 insertions(+) | ||
31 | |||
32 | diff --git a/elaborate.cxx b/elaborate.cxx | ||
33 | index 8bf9e6c06..88505559b 100644 | ||
34 | --- a/elaborate.cxx | ||
35 | +++ b/elaborate.cxx | ||
36 | @@ -2655,8 +2655,13 @@ semantic_pass (systemtap_session& s) | ||
37 | symresolution_info::symresolution_info (systemtap_session& s, bool omniscient_unmangled): | ||
38 | session (s), unmangled_p(omniscient_unmangled), current_function (0), current_probe (0) | ||
39 | { | ||
40 | + #pragma GCC diagnostic push | ||
41 | + // c10s early snapshot GCC complains about this construct, which is | ||
42 | + // made safe via our dtor usage | ||
43 | + #pragma GCC diagnostic ignored "-Wdangling-pointer" | ||
44 | saved_session_symbol_resolver = s.symbol_resolver; | ||
45 | s.symbol_resolver = this; // save resolver for early PR25841 function resolution | ||
46 | + #pragma GCC diagnostic pop | ||
47 | } | ||
48 | |||
49 | |||
50 | -- | ||
51 | 2.45.2 | ||
52 | |||
diff --git a/meta/recipes-kernel/systemtap/systemtap_git.inc b/meta/recipes-kernel/systemtap/systemtap_git.inc index c574bcb2ba..7cbc0fcbb4 100644 --- a/meta/recipes-kernel/systemtap/systemtap_git.inc +++ b/meta/recipes-kernel/systemtap/systemtap_git.inc | |||
@@ -12,6 +12,8 @@ SRC_URI = "git://sourceware.org/git/systemtap.git;branch=master;protocol=https \ | |||
12 | file://0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch \ | 12 | file://0001-configure.ac-fix-broken-libdebuginfod-library-auto-d.patch \ |
13 | file://0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch \ | 13 | file://0001-bpf-translate.cxx-fix-build-against-upcoming-gcc-14-.patch \ |
14 | file://0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch \ | 14 | file://0001-staprun-fix-build-against-upcoming-gcc-14-Werror-cal.patch \ |
15 | file://0001-elaborate.cxx-gcc-version-compatibility-hack.patch \ | ||
16 | file://0001-elaborate.cxx-gcc-version-compatibility-hack-redux.patch \ | ||
15 | " | 17 | " |
16 | 18 | ||
17 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips|riscv64).*-linux' | 19 | COMPATIBLE_HOST = '(x86_64|i.86|powerpc|arm|aarch64|microblazeel|mips|riscv64).*-linux' |