TERMUX_PKG_HOMEPAGE=https://sourceware.org/elfutils/
TERMUX_PKG_DESCRIPTION="ELF object file access library"
-TERMUX_PKG_VERSION=0.168
-TERMUX_PKG_REVISION=2
+TERMUX_PKG_VERSION=0.170
+TERMUX_PKG_SHA256=1f844775576b79bdc9f9c717a50058d08620323c1e935458223a12f249c9e066
TERMUX_PKG_SRCURL=ftp://sourceware.org/pub/elfutils/${TERMUX_PKG_VERSION}/elfutils-${TERMUX_PKG_VERSION}.tar.bz2
-TERMUX_PKG_SHA256=b88d07893ba1373c7dd69a7855974706d05377766568a7d9002706d5de72c276
# libandroid-support for langinfo.
TERMUX_PKG_DEPENDS="libandroid-support, liblzma, libbz2"
TERMUX_PKG_CLANG=no
# Exposes ACCESSPERMS in <sys/stat.h> which elfutils uses:
CFLAGS+=" -D__USE_BSD"
+ CFLAGS+=" -DFNM_EXTMATCH=0"
+
# Install argp lib.
ARGP_FILE=$TERMUX_PKG_CACHEDIR/argp-standalone.1.3.tar.gz
termux_download http://www.lysator.liu.se/~nisse/archive/argp-standalone-1.3.tar.gz \
static int
read_number_entries (uint64_t *nump, Elf *elf, size_t *offp, bool index64_p)
-@@ -166,7 +284,7 @@
-
- /* We have an archive. The first word in there is the number of
- entries in the table. */
-- uint64_t n;
-+ uint64_t n = 0;
- size_t off = elf->start_offset + SARMAG + sizeof (struct ar_hdr);
- if (read_number_entries (&n, elf, &off, index64_p) < 0)
- {
+++ /dev/null
-diff -u -r ../elfutils-0.166/src/elfcompress.c ./src/elfcompress.c
---- ../elfutils-0.166/src/elfcompress.c 2016-03-02 11:25:38.000000000 -0500
-+++ ./src/elfcompress.c 2016-05-04 14:33:03.812183632 -0400
-@@ -166,7 +166,7 @@
- struct section_pattern *pattern = patterns;
- while (pattern != NULL)
- {
-- if (fnmatch (pattern->pattern, name, FNM_EXTMATCH) == 0)
-+ if (fnmatch (pattern->pattern, name, 0) == 0)
- return true;
- pattern = pattern->next;
- }
+++ /dev/null
-diff -u -r ../elfutils-0.166/src/readelf.c ./src/readelf.c
---- ../elfutils-0.166/src/readelf.c 2016-03-02 11:25:38.000000000 -0500
-+++ ./src/readelf.c 2016-05-04 14:13:42.967553723 -0400
-@@ -43,6 +43,7 @@
- #include <sys/param.h>
- #include <sys/stat.h>
- #include <signal.h>
-+#include <qsort_r.h>
-
- #include <system.h>
- #include "../libelf/libelfP.h"
-@@ -6128,7 +6129,7 @@
-
- printf (" %*s%-20s (%s) %s\n",
- (int) (level * 2), "", dwarf_attr_name (attr),
-- dwarf_form_name (form), nl_langinfo (flag ? YESSTR : NOSTR));
-+ dwarf_form_name (form), flag ? "yes" : "no");
- break;
-
- case DW_FORM_flag_present:
-@@ -6136,7 +6137,7 @@
- break;
- printf (" %*s%-20s (%s) %s\n",
- (int) (level * 2), "", dwarf_attr_name (attr),
-- dwarf_form_name (form), nl_langinfo (YESSTR));
-+ dwarf_form_name (form), "yes");
- break;
-
- case DW_FORM_exprloc:
-@@ -7646,7 +7647,7 @@
- if (readp + 1 > readendp)
- goto invalid_data;
- val = *readp++;
-- printf (" %s", nl_langinfo (val != 0 ? YESSTR : NOSTR));
-+ printf (" %s", val != 0 ? "yes" : "no");
- break;
-
- case DW_FORM_string:
-diff -u -r ../elfutils-0.168/src/ar.c ./src/ar.c
---- ../elfutils-0.168/src/ar.c 2016-12-28 04:32:01.000000000 -0500
-+++ ./src/ar.c 2017-01-14 19:32:22.921445583 -0500
-@@ -1,1528 +1 @@
+diff -u -r ../elfutils-0.170/src/ar.c ./src/ar.c
+--- ../elfutils-0.170/src/ar.c 2017-06-19 16:45:16.000000000 +0200
++++ ./src/ar.c 2017-12-10 01:12:10.164427616 +0100
+@@ -1,1529 +1 @@
-/* Create, modify, and extract from archives.
- Copyright (C) 2005-2012, 2016 Red Hat, Inc.
- This file is part of elfutils.
-#include <sys/time.h>
-
-#include <system.h>
+-#include <printversion.h>
-
-#include "arlib.h"
-
--- /dev/null
+diff -u -r ../elfutils-0.170/src/readelf.c ./src/readelf.c
+--- ../elfutils-0.170/src/readelf.c 2017-08-02 14:06:25.000000000 +0200
++++ ./src/readelf.c 2017-12-10 01:14:25.898858528 +0100
+@@ -43,6 +43,7 @@
+ #include <unistd.h>
+ #include <sys/stat.h>
+ #include <signal.h>
++#include <qsort_r.h>
+
+ #include <libeu.h>
+ #include <system.h>
diff -u -r ../elfutils-0.166/src/unstrip.c ./src/unstrip.c
--- ../elfutils-0.166/src/unstrip.c 2016-01-12 07:49:19.000000000 -0500
+++ ./src/unstrip.c 2016-05-04 15:22:24.975567076 -0400
-@@ -294,6 +294,7 @@
- static void
- make_directories (const char *path)
- {
-+ size_t substr_len;
- const char *lastslash = strrchr (path, '/');
- if (lastslash == NULL)
- return;
@@ -303,7 +304,11 @@
if (lastslash == path)
return;
- char *dir = strndupa (path, lastslash - path);
-+ substr_len = lastslash - path;
++ size_t substr_len = lastslash - path;
+ char *dir = alloca(substr_len+1);
+ strncpy(dir, path, substr_len);
+ dir[substr_len] = 0;