Skip to content

Commit

Permalink
dev-util/oprofile: fix build with gcc12
Browse files Browse the repository at this point in the history
Patch by Sergei Trofimovich <[email protected]> from oprofile mail lists.

Package-Manager: Portage-3.0.29, Repoman-3.0.3
Signed-off-by: Andrew Savchenko <[email protected]>
  • Loading branch information
bircoph committed Dec 9, 2021
1 parent c9ab1c9 commit 378d17f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions dev-util/oprofile/files/gcc12.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
`gcc-12` will forbid std::string(nullptr_t) constructors
(as they never had a defined behaviour):

operf_stats.cpp:182:24: error: use of deleted function 'std::__cxx11::basic_string...; std::nullptr_t = std::nullptr_t]'
182 | return NULL;
| ^~~~

Signed-off-by: Sergei Trofimovich <[email protected]>
---
libperf_events/operf_stats.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libperf_events/operf_stats.cpp b/libperf_events/operf_stats.cpp
index 3cc28a75..a7bd0aec 100644
--- a/libperf_events/operf_stats.cpp
+++ b/libperf_events/operf_stats.cpp
@@ -179,7 +179,7 @@ static string create_stats_dir(string const & cur_sampledir)
if (rc && (errno != EEXIST)) {
cerr << "Error trying to create stats dir. " << endl;
perror("mkdir failed with");
- return NULL;
+ return "";
}
return stats_dir;
}
--
2.33.1
1 change: 1 addition & 0 deletions dev-util/oprofile/oprofile-1.4.0.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ pkg_setup() {

src_prepare() {
eapply "${FILESDIR}/musl.patch"
eapply "${FILESDIR}/gcc12.patch"
# bug 723092
sed -i 's/==/=/g' configure.ac || die

Expand Down

0 comments on commit 378d17f

Please sign in to comment.