<div dir="ltr"><div dir="ltr">po 6. 4. 2020 v 4:02 odesílatel Rosen Penev <<a href="mailto:rosenp@gmail.com">rosenp@gmail.com</a>> napsal:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Removed sys/cdefs usage. The header is deprecated.<br>
<br>
Removed canonicalize_file_name define. It's already fixed upstream.<br>
<br>
Added --disable-debuginfod. Seems to be needed.<br>
<br>
Modified patch 005 to build more stuff. It was failing before. It still<br>
only builds libraries.<br>
<br>
Modified patch 100 to use strerror under non-glibc. It is used under<br>
glibc as strerror is not thread safe. It is under musl and uClibc-ng.<br>
strerror_l is not available under uClibc-ng.<br>
<br>
Signed-off-by: Rosen Penev <<a href="mailto:rosenp@gmail.com" target="_blank">rosenp@gmail.com</a>><br>
---<br>
package/libs/elfutils/Makefile | 7 +-<br>
.../patches/003-libintl-compatibility.patch | 75 +++++++++----------<br>
.../patches/005-build_only_libs.patch | 13 ++--<br>
.../elfutils/patches/100-musl-compat.patch | 22 ++----<br>
.../libs/elfutils/patches/101-no-fts.patch | 2 +-<br>
.../libs/elfutils/patches/110-no-cdefs.patch | 58 ++++++++++++++<br>
6 files changed, 113 insertions(+), 64 deletions(-)<br>
create mode 100644 package/libs/elfutils/patches/110-no-cdefs.patch<br>
<br>
diff --git a/package/libs/elfutils/Makefile b/package/libs/elfutils/Makefile<br>
index 630c48820a..e6868c56f4 100644<br>
--- a/package/libs/elfutils/Makefile<br>
+++ b/package/libs/elfutils/Makefile<br>
@@ -7,12 +7,12 @@<br>
include $(TOPDIR)/<a href="http://rules.mk" rel="noreferrer" target="_blank">rules.mk</a><br>
<br>
PKG_NAME:=elfutils<br>
-PKG_VERSION:=0.177<br>
-PKG_RELEASE:=2<br>
+PKG_VERSION:=0.179<br>
+PKG_RELEASE:=1<br>
<br>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2<br>
PKG_SOURCE_URL:=<a href="https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)-PKG_HASH:=fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e+PKG_HASH:=25a545566cbacaa37ae6222e58f1c48ea4570f53ba991886e2f5ce96e22a23a2" rel="noreferrer" target="_blank">https://sourceware.org/$(PKG_NAME)/ftp/$(PKG_VERSION)<br>
-PKG_HASH:=fa489deccbcae7d8c920f60d85906124c1989c591196d90e0fd668e3dc05042e<br>
+PKG_HASH:=25a545566cbacaa37ae6222e58f1c48ea4570f53ba991886e2f5ce96e22a23a2</a><br>
<br>
PKG_MAINTAINER:=Luiz Angelo Daros de Luca <<a href="mailto:luizluca@gmail.com" target="_blank">luizluca@gmail.com</a>><br>
PKG_LICENSE:=GPL-3.0-or-later<br>
@@ -63,6 +63,7 @@ endif<br>
<br>
CONFIGURE_ARGS += \<br>
--program-prefix=eu- \<br>
+ --disable-debuginfod \<br>
--without-lzma<br>
<br>
TARGET_CFLAGS += -D_GNU_SOURCE -Wno-unused-result -Wno-format-nonliteral<br>
diff --git a/package/libs/elfutils/patches/003-libintl-compatibility.patch b/package/libs/elfutils/patches/003-libintl-compatibility.patch<br>
index 32bfaf8e6d..ea0f4535a5 100644<br>
--- a/package/libs/elfutils/patches/003-libintl-compatibility.patch<br>
+++ b/package/libs/elfutils/patches/003-libintl-compatibility.patch<br>
@@ -1,8 +1,31 @@<br>
---- a/libelf/libelfP.h<br>
-+++ b/libelf/libelfP.h<br>
-@@ -39,6 +39,9 @@<br>
- #include <stdio.h><br>
- #include <string.h><br>
+--- a/config/<a href="http://libelf.pc.in" rel="noreferrer" target="_blank">libelf.pc.in</a><br>
++++ b/config/<a href="http://libelf.pc.in" rel="noreferrer" target="_blank">libelf.pc.in</a><br>
+@@ -8,7 +8,7 @@ Description: elfutils libelf library to read and write ELF files<br>
+ Version: @VERSION@<br>
+ URL: <a href="http://elfutils.org/" rel="noreferrer" target="_blank">http://elfutils.org/</a><br>
+ <br>
+-Libs: -L${libdir} -lelf<br>
++Libs: -L${libdir} -lelf @intl_LDFLAGS@<br>
+ Cflags: -I${includedir}<br>
+ <br>
+ Requires.private: zlib<br>
+--- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
++++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
+@@ -586,6 +586,9 @@ AC_CONFIG_FILES([config/libelf.pc config/libdw.pc config/libdebuginfod.pc])<br>
+ AC_SUBST(USE_NLS, yes)<br>
+ AM_PO_SUBDIRS<br>
+ <br>
++case "$USE_NLS" in yes) intl_LDFLAGS="-lintl" ;; esac<br>
++AC_SUBST([intl_LDFLAGS])<br>
++<br>
+ dnl Appended to the config.h file.<br>
+ dnl We hide all kinds of configuration magic in lib/eu-config.h.<br>
+ AH_BOTTOM([#include <eu-config.h>])<br>
+--- a/libasm/libasmP.h<br>
++++ b/libasm/libasmP.h<br>
+@@ -36,6 +36,9 @@<br>
+ <br>
+ #include "libdwelf.h"<br>
<br>
+#ifdef _ /* fix libintl-stub */<br>
+#undef _<br>
@@ -12,20 +35,19 @@<br>
<br>
--- a/libdw/libdwP.h<br>
+++ b/libdw/libdwP.h<br>
-@@ -35,7 +35,9 @@<br>
- #include <libdw.h><br>
+@@ -37,6 +37,9 @@<br>
#include <dwarf.h><br>
+ #include "atomics.h"<br>
<br>
--<br>
+#ifdef _ /* fix libintl-stub */<br>
+#undef _<br>
+#endif<br>
+ <br>
/* gettext helper macros. */<br>
#define _(Str) dgettext ("elfutils", Str)<br>
- <br>
--- a/libdwfl/libdwflP.h<br>
+++ b/libdwfl/libdwflP.h<br>
-@@ -43,6 +43,9 @@<br>
+@@ -44,6 +44,9 @@<br>
<br>
typedef struct Dwfl_Process Dwfl_Process;<br>
<br>
@@ -35,11 +57,11 @@<br>
/* gettext helper macros. */<br>
#define _(Str) dgettext ("elfutils", Str)<br>
<br>
---- a/libasm/libasmP.h<br>
-+++ b/libasm/libasmP.h<br>
-@@ -35,6 +35,9 @@<br>
- <br>
- #include "libdwelf.h"<br>
+--- a/libelf/libelfP.h<br>
++++ b/libelf/libelfP.h<br>
+@@ -39,6 +39,9 @@<br>
+ #include <stdio.h><br>
+ #include <string.h><br>
<br>
+#ifdef _ /* fix libintl-stub */<br>
+#undef _<br>
@@ -47,26 +69,3 @@<br>
/* gettext helper macros. */<br>
#define _(Str) dgettext ("elfutils", Str)<br>
<br>
---- a/config/<a href="http://libelf.pc.in" rel="noreferrer" target="_blank">libelf.pc.in</a><br>
-+++ b/config/<a href="http://libelf.pc.in" rel="noreferrer" target="_blank">libelf.pc.in</a><br>
-@@ -8,7 +8,7 @@ Description: elfutils libelf library to<br>
- Version: @VERSION@<br>
- URL: <a href="http://elfutils.org/" rel="noreferrer" target="_blank">http://elfutils.org/</a><br>
- <br>
--Libs: -L${libdir} -lelf<br>
-+Libs: -L${libdir} -lelf @intl_LDFLAGS@<br>
- Cflags: -I${includedir}<br>
- <br>
- Requires.private: zlib<br>
---- a/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
-+++ b/<a href="http://configure.ac" rel="noreferrer" target="_blank">configure.ac</a><br>
-@@ -543,6 +543,9 @@ AC_CONFIG_FILES([config/libelf.pc config<br>
- AC_SUBST(USE_NLS, yes)<br>
- AM_PO_SUBDIRS<br>
- <br>
-+case "$USE_NLS" in yes) intl_LDFLAGS="-lintl" ;; esac<br>
-+AC_SUBST([intl_LDFLAGS])<br>
-+<br>
- dnl Appended to the config.h file.<br>
- dnl We hide all kinds of configuration magic in lib/eu-config.h.<br>
- AH_BOTTOM([#include <eu-config.h>])<br>
diff --git a/package/libs/elfutils/patches/005-build_only_libs.patch b/package/libs/elfutils/patches/005-build_only_libs.patch<br>
index 93d593a0fc..a81d1d2cab 100644<br>
--- a/package/libs/elfutils/patches/005-build_only_libs.patch<br>
+++ b/package/libs/elfutils/patches/005-build_only_libs.patch<br>
@@ -1,12 +1,11 @@<br>
--- a/Makefile.am<br>
+++ b/Makefile.am<br>
-@@ -27,8 +27,7 @@ AM_MAKEFLAGS = --no-print-directory<br>
+@@ -27,7 +27,7 @@ AM_MAKEFLAGS = --no-print-directory<br>
pkginclude_HEADERS = version.h<br>
<br>
- # Add doc back when we have some real content.<br>
--SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libcpu libasm \<br>
-- backends src po tests<br>
-+SUBDIRS = config m4 lib libelf libebl libdwelf libdwfl libdw libasm<br>
+ SUBDIRS = config m4 lib libelf libcpu backends libebl libdwelf libdwfl libdw \<br>
+- libasm src po doc tests<br>
++ libasm<br>
<br>
- EXTRA_DIST = elfutils.spec GPG-KEY NOTES CONTRIBUTING \<br>
- COPYING COPYING-GPLV2 COPYING-LGPLV3<br>
+ if DEBUGINFOD<br>
+ SUBDIRS += debuginfod<br>
diff --git a/package/libs/elfutils/patches/100-musl-compat.patch b/package/libs/elfutils/patches/100-musl-compat.patch<br>
index 109b7ece08..374e832d3f 100644<br>
--- a/package/libs/elfutils/patches/100-musl-compat.patch<br>
+++ b/package/libs/elfutils/patches/100-musl-compat.patch<br>
@@ -22,20 +22,9 @@ <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=21002" rel="noreferrer" target="_blank">https://sourceware.org/bugzilla/show_bug.cgi?id=21002</a><br>
#include <stddef.h><br>
#include <stdint.h><br>
#include <sys/param.h><br>
-@@ -38,6 +49,10 @@<br>
- #include <byteswap.h><br>
- #include <unistd.h><br>
- <br>
-+#ifndef __GLIBC__<br>
-+#define canonicalize_file_name(name) realpath(name,NULL)<br>
-+#endif<br>
-+<br>
- #if __BYTE_ORDER == __LITTLE_ENDIAN<br>
- # define LE32(n) (n)<br>
- # define LE64(n) (n)<br>
--- a/libdw/libdw_alloc.c<br>
+++ b/libdw/libdw_alloc.c<br>
-@@ -73,5 +73,5 @@ __attribute ((noreturn)) attribute_hidde<br>
+@@ -147,5 +147,5 @@ __attribute ((noreturn)) attribute_hidde<br>
__libdw_oom (void)<br>
{<br>
while (1)<br>
@@ -44,12 +33,15 @@ <a href="https://sourceware.org/bugzilla/show_bug.cgi?id=21002" rel="noreferrer" target="_blank">https://sourceware.org/bugzilla/show_bug.cgi?id=21002</a><br>
}<br>
--- a/libdwfl/dwfl_error.c<br>
+++ b/libdwfl/dwfl_error.c<br>
-@@ -154,7 +154,7 @@ dwfl_errmsg (int error)<br>
+@@ -154,7 +154,11 @@ dwfl_errmsg (int error)<br>
switch (error &~ 0xffff)<br>
{<br>
case OTHER_ERROR (ERRNO):<br>
-- return strerror_r (error & 0xffff, "bad", 0);<br>
-+ return strerror_l (error & 0xffff, LC_GLOBAL_LOCALE);<br>
++#if defined(__GLIBC__) && !defined(__UCLIBC__)<br>
+ return strerror_r (error & 0xffff, "bad", 0);<br></blockquote><div><br></div><div>According to GNU documentation, this call uses insufficient buffer size (buflen is 0), so it should lead to error ERANGE. Moreover, supplying fixed string as a buffer does not look correct, so I doubt this does anything useful.</div><div><br></div><div>Regards,</div><div>Oldrich.</div><div><br></div></div></div>