commit:     44046f58059e057b3cddd7ce286cd71e6de81955
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sat Sep  5 10:59:57 2020 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sat Sep  5 11:05:18 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44046f58

dev-util/oprofile: fix build with musl

Package-Manager: Portage-3.0.3, Repoman-3.0.0
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 dev-util/oprofile/files/musl.patch      | 23 +++++++++++++++++++++++
 dev-util/oprofile/oprofile-1.4.0.ebuild |  3 ++-
 2 files changed, 25 insertions(+), 1 deletion(-)

diff --git a/dev-util/oprofile/files/musl.patch 
b/dev-util/oprofile/files/musl.patch
new file mode 100644
index 00000000000..985eeece7bd
--- /dev/null
+++ b/dev-util/oprofile/files/musl.patch
@@ -0,0 +1,23 @@
+--- oprofile-1.4.0/pe_profiling/operf.cpp.orig 2016-08-08 18:03:27.000000000 
+0300
++++ oprofile-1.4.0/pe_profiling/operf.cpp      2020-09-05 12:45:55.237558495 
+0300
+@@ -860,9 +860,9 @@
+ {
+       if (remove(fpath)) {
+               perror("sample data removal error");
+-              return FTW_STOP;
++              return 1;
+       } else {
+-              return FTW_CONTINUE;
++              return 0;
+       }
+ }
+ 
+@@ -897,7 +897,7 @@
+               return;
+ 
+       if (!operf_options::append) {
+-                int flags = FTW_DEPTH | FTW_ACTIONRETVAL;
++                int flags = FTW_DEPTH;
+               errno = 0;
+               if (nftw(previous_sampledir.c_str(), 
__delete_old_previous_sample_data, 32, flags) !=0 &&
+                               errno != ENOENT) {

diff --git a/dev-util/oprofile/oprofile-1.4.0.ebuild 
b/dev-util/oprofile/oprofile-1.4.0.ebuild
index e881632d5f3..485fdf66c1f 100644
--- a/dev-util/oprofile/oprofile-1.4.0.ebuild
+++ b/dev-util/oprofile/oprofile-1.4.0.ebuild
@@ -20,7 +20,7 @@ BDEPEND="
 CDEPEND="
        >=dev-libs/popt-1.7-r1
        sys-libs/binutils-libs:=
-       >=sys-libs/glibc-2.3.2-r1
+       elibc_glibc? ( >=sys-libs/glibc-2.3.2-r1 )
        ppc64? ( dev-libs/libpfm )
 "
 DEPEND="${CDEPEND}
@@ -46,6 +46,7 @@ pkg_setup() {
 }
 
 src_prepare() {
+       eapply "${FILESDIR}/musl.patch"
        # bug 723092
        sed -i 's/==/=/g' configure.ac || die
 

Reply via email to