Github messages for voidlinux
 help / color / mirror / Atom feed
From: ericonr <ericonr@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] Update elfutils to 0.182.
Date: Fri, 06 Nov 2020 15:39:14 +0100	[thread overview]
Message-ID: <20201106143914.dgX9Qs0THiWDQf69iHCAq1gCk87Nw9jA7UjJtLLCJUo@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-26067@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 462 bytes --]

There is an updated pull request by ericonr against master on the void-packages repository

https://github.com/ericonr/void-packages debuginfod
https://github.com/void-linux/void-packages/pull/26067

Update elfutils to 0.182.
Also create the debuginfod subpackage and use it in gdb.

This PR can wait on some musl patches that I'd like to backport for the fregs patch.

A patch file from https://github.com/void-linux/void-packages/pull/26067.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-debuginfod-26067.patch --]
[-- Type: text/x-diff, Size: 25849 bytes --]

From 47f58f42470e0fa6e0d603cabffd6d3c8753847c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Fri, 6 Nov 2020 11:35:39 -0300
Subject: [PATCH 1/4] musl: add patch for aarch64 fregs and vregs.

Necessary for building elfutils for aarch64 without patches.
---
 srcpkgs/musl/patches/aarch64-fregs.patch | 37 ++++++++++++++++++++++++
 srcpkgs/musl/template                    |  2 +-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/musl/patches/aarch64-fregs.patch

diff --git a/srcpkgs/musl/patches/aarch64-fregs.patch b/srcpkgs/musl/patches/aarch64-fregs.patch
new file mode 100644
index 00000000000..9c89de44732
--- /dev/null
+++ b/srcpkgs/musl/patches/aarch64-fregs.patch
@@ -0,0 +1,37 @@
+Use types compatible with glibc/kernel headers.
+
+diff --git a/arch/aarch64/bits/signal.h b/arch/aarch64/bits/signal.h
+index b71261f5..5098c734 100644
+--- arch/aarch64/bits/signal.h
++++ arch/aarch64/bits/signal.h
+@@ -11,7 +11,7 @@ typedef unsigned long greg_t;
+ typedef unsigned long gregset_t[34];
+ 
+ typedef struct {
+-	long double vregs[32];
++	__uint128_t vregs[32];
+ 	unsigned int fpsr;
+ 	unsigned int fpcr;
+ } fpregset_t;
+@@ -34,7 +34,7 @@ struct fpsimd_context {
+ 	struct _aarch64_ctx head;
+ 	unsigned int fpsr;
+ 	unsigned int fpcr;
+-	long double vregs[32];
++	__uint128_t vregs[32];
+ };
+ struct esr_context {
+ 	struct _aarch64_ctx head;
+diff --git a/arch/aarch64/bits/user.h b/arch/aarch64/bits/user.h
+index d12cdf7f..8a1002aa 100644
+--- arch/aarch64/bits/user.h
++++ arch/aarch64/bits/user.h
+@@ -6,7 +6,7 @@ struct user_regs_struct {
+ };
+ 
+ struct user_fpsimd_struct {
+-	long double vregs[32];
++	__uint128_t vregs[32];
+ 	unsigned int fpsr;
+ 	unsigned int fpcr;
+ };
diff --git a/srcpkgs/musl/template b/srcpkgs/musl/template
index 22e79588acd..6a0ac60b03c 100644
--- a/srcpkgs/musl/template
+++ b/srcpkgs/musl/template
@@ -2,7 +2,7 @@
 pkgname=musl
 reverts="1.2.0_1"
 version=1.1.24
-revision=3
+revision=4
 archs="*-musl"
 bootstrap=yes
 build_style=gnu-configure

From 71981a52c8617f09c5d5e25772491deb8b1a7cb1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Fri, 6 Nov 2020 11:36:42 -0300
Subject: [PATCH 2/4] cross-aarch64-linux-musl: revbump to apply musl patch.

Patch can be seen in the commit before this one.
---
 srcpkgs/cross-aarch64-linux-musl/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/cross-aarch64-linux-musl/template b/srcpkgs/cross-aarch64-linux-musl/template
index 8dba1d564ec..0ec44fad6f6 100644
--- a/srcpkgs/cross-aarch64-linux-musl/template
+++ b/srcpkgs/cross-aarch64-linux-musl/template
@@ -12,7 +12,7 @@ _sysroot="/usr/${_triplet}"
 
 pkgname=cross-${_triplet}
 version=0.33
-revision=3
+revision=4
 short_desc="Cross toolchain for ARM64 LE target (musl)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 homepage="https://www.voidlinux.org/"

From 49e64b38f65ae876fb69d367912409dca00ecfad Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 25 Oct 2020 18:57:17 -0300
Subject: [PATCH 3/4] elfutils: update to 0.182, add debuginfod subpkgs, adopt.

Cleaned up patches, remove the aarch64-fregs one (it was fixed with a
musl patch, instead), and moved closer to where upstream is moving
regarding musl compat.
---
 common/shlibs                                 |   1 +
 srcpkgs/debuginfod                            |   1 +
 srcpkgs/elfutils/patches/debuginfod.patch     |  13 ++
 .../elfutils/patches/fix-aarch64_fregs.patch  |  14 ---
 .../elfutils/patches/fix-uninitialized.patch  |  11 --
 srcpkgs/elfutils/patches/fts-obstack.patch    | 107 ++++++++++++++++
 srcpkgs/elfutils/patches/musl-cdefs.patch     |  30 -----
 .../elfutils/patches/musl-fts-obstack.patch   |  87 -------------
 srcpkgs/elfutils/patches/musl-macros.patch    | 118 ++++++++++--------
 srcpkgs/elfutils/patches/musl-strndupa.patch  |  18 ---
 srcpkgs/elfutils/template                     |  37 ++++--
 srcpkgs/libdebuginfod                         |   1 +
 12 files changed, 216 insertions(+), 222 deletions(-)
 create mode 120000 srcpkgs/debuginfod
 create mode 100644 srcpkgs/elfutils/patches/debuginfod.patch
 delete mode 100644 srcpkgs/elfutils/patches/fix-aarch64_fregs.patch
 delete mode 100644 srcpkgs/elfutils/patches/fix-uninitialized.patch
 create mode 100644 srcpkgs/elfutils/patches/fts-obstack.patch
 delete mode 100644 srcpkgs/elfutils/patches/musl-cdefs.patch
 delete mode 100644 srcpkgs/elfutils/patches/musl-fts-obstack.patch
 delete mode 100644 srcpkgs/elfutils/patches/musl-strndupa.patch
 create mode 120000 srcpkgs/libdebuginfod

diff --git a/common/shlibs b/common/shlibs
index ceb355ffac6..d33b9c2d6aa 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -736,6 +736,7 @@ libmtp.so.9 libmtp-1.1.4_1
 libelf.so.1 libelf-0.155_1
 libdw.so.1 libelf-0.155_1
 libasm.so.1 libelf-0.155_1
+libdebuginfod.so.1 libdebuginfod-0.182_1
 libgtksourceview-3.0.so.1 gtksourceview-3.8.0_1
 libtalloc.so.2 talloc-2.0.1_1
 libmount.so.1 libmount-2.18_1
diff --git a/srcpkgs/debuginfod b/srcpkgs/debuginfod
new file mode 120000
index 00000000000..b76b36cfac4
--- /dev/null
+++ b/srcpkgs/debuginfod
@@ -0,0 +1 @@
+elfutils
\ No newline at end of file
diff --git a/srcpkgs/elfutils/patches/debuginfod.patch b/srcpkgs/elfutils/patches/debuginfod.patch
new file mode 100644
index 00000000000..d26d945d1ff
--- /dev/null
+++ b/srcpkgs/elfutils/patches/debuginfod.patch
@@ -0,0 +1,13 @@
+diff --git debuginfod/debuginfod.cxx debuginfod/debuginfod.cxx
+index 3085f388..d2a434ee 100644
+--- debuginfod/debuginfod.cxx
++++ debuginfod/debuginfod.cxx
+@@ -46,7 +46,7 @@ extern "C" {
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <error.h>
+-// #include <libintl.h> // not until it supports C++ << better
++#include <libintl.h>
+ #include <locale.h>
+ #include <pthread.h>
+ #include <signal.h>
diff --git a/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch b/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch
deleted file mode 100644
index e9641542144..00000000000
--- a/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-It looks like fregs.vregs[] is an array of double?
-Casting to Dwarf_Word instead of & 0xFFFFFFF should do.
-
---- backends/aarch64_initreg.c	2015-11-27 14:36:29.000000000 +0100
-+++ backends/aarch64_initreg.c	2016-08-09 03:47:25.428560159 +0200
-@@ -82,7 +83,7 @@
- 
-   Dwarf_Word dwarf_fregs[32];
-   for (int r = 0; r < 32; r++)
--    dwarf_fregs[r] = fregs.vregs[r] & 0xFFFFFFFF;
-+    dwarf_fregs[r] = (Dwarf_Word)fregs.vregs[r];
- 
-   if (! setfunc (64, 32, dwarf_fregs, arg))
-     return false;
diff --git a/srcpkgs/elfutils/patches/fix-uninitialized.patch b/srcpkgs/elfutils/patches/fix-uninitialized.patch
deleted file mode 100644
index 6ab15e50e2b..00000000000
--- a/srcpkgs/elfutils/patches/fix-uninitialized.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-
---- libcpu/i386_disasm.c	2015-08-21 14:22:37.000000000 +0200
-+++ libcpu/i386_disasm.c	2015-11-20 06:30:59.250629957 +0100
-@@ -710,6 +710,7 @@
- 
- 		case 'm':
- 		  /* Mnemonic.  */
-+		  str = mnebuf;
- 
- 		  if (unlikely (instrtab[cnt].mnemonic == MNE_INVALID))
- 		    {
diff --git a/srcpkgs/elfutils/patches/fts-obstack.patch b/srcpkgs/elfutils/patches/fts-obstack.patch
new file mode 100644
index 00000000000..44ef0aee70e
--- /dev/null
+++ b/srcpkgs/elfutils/patches/fts-obstack.patch
@@ -0,0 +1,107 @@
+diff --git ChangeLog ChangeLog
+index 128da6c6..565d021c 100644
+--- ChangeLog
++++ ChangeLog
+@@ -1,3 +1,7 @@
++2020-11-01  Érico N. Rolim  <erico.erc@gmail.com>
++
++	* configure.ac: Check for fts and obstack from outside libc.
++
+ 2020-10-28  Mark Wielaard  <mark@klomp.org>
+ 
+ 	* configure.ac: Set version to 0.182.
+diff --git configure.ac configure.ac
+index 515ac704..c1a6954d 100644
+--- configure.ac
++++ configure.ac
+@@ -542,6 +542,26 @@ else
+ fi
+ AC_SUBST([argp_LDADD])
+ 
++saved_LIBS="$LIBS"
++AC_SEARCH_LIBS([fts_close], [fts])
++LIBS="$saved_LIBS"
++case "$ac_cv_search_fts_close" in
++        no) AC_MSG_FAILURE([failed to find fts_close]) ;;
++        -l*) fts_LIBS="$ac_cv_search_fts_close" ;;
++        *) fts_LIBS= ;;
++esac
++AC_SUBST([fts_LIBS])
++
++saved_LIBS="$LIBS"
++AC_SEARCH_LIBS([_obstack_free], [obstack])
++LIBS="$saved_LIBS"
++case "$ac_cv_search__obstack_free" in
++        no) AC_MSG_FAILURE([failed to find obstack_free]) ;;
++        -l*) obstack_LIBS="$ac_cv_search__obstack_free" ;;
++        *) obstack_LIBS= ;;
++esac
++AC_SUBST([obstack_LIBS])
++
+ dnl The directories with content.
+ 
+ dnl Documentation.
+diff --git debuginfod/Makefile.am debuginfod/Makefile.am
+index 01985600..0af3b58c 100644
+--- debuginfod/Makefile.am
++++ debuginfod/Makefile.am
+@@ -71,10 +71,10 @@ bin_PROGRAMS += debuginfod-find
+ endif
+ 
+ debuginfod_SOURCES = debuginfod.cxx
+-debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
++debuginfod_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) $(libmicrohttpd_LIBS) $(sqlite3_LIBS) $(libarchive_LIBS) -lpthread -ldl
+ 
+ debuginfod_find_SOURCES = debuginfod-find.c
+-debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod)
++debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS)
+ 
+ if LIBDEBUGINFOD
+ noinst_LIBRARIES = libdebuginfod.a
+@@ -98,7 +98,7 @@ libdebuginfod_so_LIBS = libdebuginfod_pic.a
+ if DUMMY_LIBDEBUGINFOD
+ libdebuginfod_so_LDLIBS =
+ else
+-libdebuginfod_so_LDLIBS = $(libcurl_LIBS)
++libdebuginfod_so_LDLIBS = $(libcurl_LIBS) $(fts_LIBS)
+ endif
+ libdebuginfod.so$(EXEEXT): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS)
+ 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
+diff --git libdw/Makefile.am libdw/Makefile.am
+index 33b5838d..1dbb3d5e 100644
+--- libdw/Makefile.am
++++ libdw/Makefile.am
+@@ -109,7 +109,7 @@ libdw_so_LIBS = ../libebl/libebl_pic.a ../backends/libebl_backends_pic.a \
+ 		../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
+ 		../libdwfl/libdwfl_pic.a
+ libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
+-libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
++libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread
+ libdw_so_SOURCES =
+ libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
+ 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
+diff --git src/Makefile.am src/Makefile.am
+index e462e7d7..88d0ac8f 100644
+--- src/Makefile.am
++++ src/Makefile.am
+@@ -69,7 +69,7 @@ ar_no_Wstack_usage = yes
+ unstrip_no_Wstack_usage = yes
+ 
+ readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD)
+-nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) \
++nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS) \
+ 	   $(demanglelib)
+ size_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+ strip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+@@ -78,9 +78,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+ addr2line_LDADD = $(libdw) $(libelf) $(libeu) $(argp_LDADD) $(demanglelib)
+ elfcmp_LDADD = $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+ objdump_LDADD  = $(libasm) $(libebl) $(libdw) $(libelf) $(libeu) $(argp_LDADD)
+-ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
++ranlib_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
+ strings_LDADD = $(libelf) $(libeu) $(argp_LDADD)
+-ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD)
++ar_LDADD = libar.a $(libelf) $(libeu) $(argp_LDADD) $(obstack_LIBS)
+ unstrip_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
+ stack_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) $(demanglelib)
+ elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD)
diff --git a/srcpkgs/elfutils/patches/musl-cdefs.patch b/srcpkgs/elfutils/patches/musl-cdefs.patch
deleted file mode 100644
index 65ef9f4d23c..00000000000
--- a/srcpkgs/elfutils/patches/musl-cdefs.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- libelf/elf.h	2015-08-21 14:22:37.000000000 +0200
-+++ libelf/elf.h	2015-11-20 04:54:33.948081321 +0100
-@@ -21,6 +21,17 @@
- 
- #include <features.h>
- 
-+#if !defined(__BEGIN_DECLS)
-+/* C++ needs to know that types and declarations are C, not C++.  */
-+#ifdef  __cplusplus
-+# define __BEGIN_DECLS  extern "C" {
-+# define __END_DECLS    }
-+#else
-+# define __BEGIN_DECLS
-+# define __END_DECLS
-+#endif
-+#endif
-+
- __BEGIN_DECLS
- 
- /* Standard ELF types.  */
---- lib/fixedsizehash.h.orig
-+++ lib/fixedsizehash.h
-@@ -30,7 +30,6 @@
- #include <errno.h>
- #include <stdlib.h>
- #include <string.h>
--#include <sys/cdefs.h>
- 
- #include <system.h>
- 
diff --git a/srcpkgs/elfutils/patches/musl-fts-obstack.patch b/srcpkgs/elfutils/patches/musl-fts-obstack.patch
deleted file mode 100644
index 77e3c4ea040..00000000000
--- a/srcpkgs/elfutils/patches/musl-fts-obstack.patch
+++ /dev/null
@@ -1,87 +0,0 @@
---- configure.ac	2015-10-15 15:16:57.000000000 +0200
-+++ configure.ac	2015-11-20 05:32:57.723901582 +0100
-@@ -305,6 +305,62 @@
- fi
- AC_SUBST([argp_LDADD])
- 
-+dnl Check if we have fts available from our libc
-+AC_LINK_IFELSE(
-+	[AC_LANG_PROGRAM(
-+		[#if !defined(__x86_64__)
-+		#undef  _FILE_OFFSET_BITS
-+		#define _FILE_OFFSET_BITS 32
-+		#endif
-+		#include <fts.h>],
-+		[FTS* fts = 0; return fts_close(fts); return 0;]
-+		)],
-+	[libc_has_fts="true"],
-+	[libc_has_fts="false"]
-+)
-+
-+dnl If our libc doesn't provide fts, then test for libfts
-+if test "$libc_has_fts" = "false" ; then
-+	AC_MSG_WARN("libc does not have fts")
-+	AC_CHECK_LIB([fts], [fts_close], [have_fts="true"], [have_fts="false"])
-+
-+	if test "$have_fts" = "false"; then
-+		AC_MSG_ERROR("no libfts found")
-+	else
-+		fts_LDADD="-lfts"
-+	fi
-+else
-+	fts_LDADD=""
-+fi
-+AC_SUBST([fts_LDADD])
-+
-+dnl Check if we have obstack available from our libc
-+AC_LINK_IFELSE(
-+	[AC_LANG_PROGRAM(
-+		[#include <obstack.h>],
-+		[_obstack_begin(0, 0, 0, NULL, NULL); return 0;]
-+		)],
-+	[libc_has_obstack="true"],
-+	[libc_has_obstack="false"]
-+)
-+
-+dnl If our libc doesn't provide obstack, then test for libobstack
-+if test "$libc_has_obstack" = "false" ; then
-+	AC_MSG_WARN("libc does not have obstack")
-+	AC_CHECK_LIB([obstack], [_obstack_begin], [have_obstack="true"], [have_obstack="false"])
-+
-+	if test "$have_obstack" = "false"; then
-+		AC_MSG_ERROR("no libobstack found")
-+	else
-+		obstack_LDADD="-lobstack"
-+	fi
-+else
-+	obstack_LDADD=""
-+fi
-+AC_SUBST([obstack_LDADD])
-+
-+dnl The directories with content.
-+
- dnl The directories with content.
- 
- dnl Documentation.
---- src/Makefile.am.orig
-+++ src/Makefile.am
-@@ -46,7 +46,7 @@
- else
- libasm = ../libasm/libasm.so
- libdw = ../libdw/libdw.so
--libelf = ../libelf/libelf.so
-+libelf = ../libelf/libelf.so $(fts_LDADD) $(obstack_LDADD)
- endif
- libebl = ../libebl/libebl.a
- libeu = ../lib/libeu.a
---- libdw/Makefile.am.orig
-+++ libdw/Makefile.am
-@@ -109,7 +109,7 @@
- 		../libcpu/libcpu_pic.a libdw_pic.a ../libdwelf/libdwelf_pic.a \
- 		../libdwfl/libdwfl_pic.a
- libdw_so_DEPS = ../lib/libeu.a ../libelf/libelf.so
--libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(zip_LIBS) -pthread
-+libdw_so_LDLIBS = $(libdw_so_DEPS) -ldl -lz $(argp_LDADD) $(fts_LDADD) $(obstack_LDADD) $(zip_LIBS) -pthread
- libdw_so_SOURCES =
- libdw.so$(EXEEXT): $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS)
- 	$(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \
diff --git a/srcpkgs/elfutils/patches/musl-macros.patch b/srcpkgs/elfutils/patches/musl-macros.patch
index 8ce586b2930..97a8c2bf352 100644
--- a/srcpkgs/elfutils/patches/musl-macros.patch
+++ b/srcpkgs/elfutils/patches/musl-macros.patch
@@ -1,66 +1,74 @@
---- src/arlib.h	2015-08-21 14:22:37.000000000 +0200
-+++ src/arlib.h	2015-11-20 08:02:55.153199611 +0100
-@@ -29,6 +29,16 @@
- #include <stdint.h>
- #include <sys/types.h>
+diff --git debuginfod/debuginfod-client.c debuginfod/debuginfod-client.c
+index 0e5177bc..ce1d819b 100644
+--- debuginfod/debuginfod-client.c
++++ debuginfod/debuginfod-client.c
+@@ -212,13 +212,13 @@ debuginfod_init_cache (char *cache_path, char *interval_path, char *maxage_path)
+     return 0;
  
-+#if !defined(ACCESSPERMS)
-+# define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
-+#endif
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
-+#endif
-+#if !defined(DEFFILEMODE)
-+# define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* 0666*/
-+#endif
-+
+   /* Create the cache and config files as necessary.  */
+-  if (stat(cache_path, &st) != 0 && mkdir(cache_path, 0777) < 0)
++  if (stat(cache_path, &st) != 0 && mkdir(cache_path, ACCESSPERMS) < 0)
+     return -errno;
  
- /* State of -D/-U flags.  */
- extern bool arlib_deterministic_output;
---- src/elfcompress.c.orig	2016-04-02 12:51:26.903848894 +0200
-+++ src/elfcompress.c	2016-04-02 12:55:15.076996338 +0200
-@@ -35,6 +35,14 @@
- #include <gelf.h>
- #include "system.h"
+   int fd = -1;
  
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
-+#endif
-+
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
+   /* init cleaning interval config file.  */
+-  fd = open(interval_path, O_CREAT | O_RDWR, 0666);
++  fd = open(interval_path, O_CREAT | O_RDWR, DEFFILEMODE);
+   if (fd < 0)
+     return -errno;
+ 
+@@ -227,7 +227,7 @@ debuginfod_init_cache (char *cache_path, char *interval_path, char *maxage_path)
+ 
+   /* init max age config file.  */
+   if (stat(maxage_path, &st) != 0
+-      && (fd = open(maxage_path, O_CREAT | O_RDWR, 0666)) < 0)
++      && (fd = open(maxage_path, O_CREAT | O_RDWR, DEFFILEMODE)) < 0)
+     return -errno;
+ 
+   if (dprintf(fd, "%ld", cache_default_max_unused_age_s) < 0)
+diff --git lib/system.h lib/system.h
+index 292082bd..5d16ebc6 100644
+--- lib/system.h
++++ lib/system.h
+@@ -85,6 +85,18 @@
+      __res; })
+ #endif
+ 
++#ifndef ACCESSPERMS
++#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO) /* 0777 */
 +#endif
 +
- /* Name and version of program.  */
- static void print_version (FILE *stream, struct argp_state *state);
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
---- src/strip.c.orig	2017-08-02 12:06:25.000000000 +0000
-+++ src/strip.c	2017-08-05 01:58:01.523493062 +0000
-@@ -47,6 +47,14 @@
- #include <system.h>
- #include <printversion.h>
- 
-+#if !defined(FNM_EXTMATCH)
-+# define FNM_EXTMATCH 0
++#ifndef ALLPERMS
++#define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
 +#endif
 +
-+#if !defined(ACCESSPERMS)
-+#define ACCESSPERMS (S_IRWXU|S_IRWXG|S_IRWXO)
++#ifndef DEFFILEMODE
++#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)/* DEFFILEMODE*/
 +#endif
 +
- typedef uint8_t GElf_Byte;
+ static inline ssize_t __attribute__ ((unused))
+ pwrite_retry (int fd, const void *buf, size_t len, off_t off)
+ {
+diff --git src/unstrip.c src/unstrip.c
+index 0257d9cc..c99ee612 100644
+--- src/unstrip.c
++++ src/unstrip.c
+@@ -315,7 +315,7 @@ make_directories (const char *path)
+   if (dir == NULL)
+     error(EXIT_FAILURE, errno, _("memory exhausted"));
  
- /* Name and version of program.  */
---- tests/elfstrmerge.c.orig	2020-09-13 08:20:50.538492600 +0700
-+++ tests/elfstrmerge.c	2020-09-13 08:21:40.205734827 +0700
-@@ -33,6 +33,10 @@
- #include ELFUTILS_HEADER(dwelf)
- #include "elf-knowledge.h"
+-  while (mkdir (dir, 0777) < 0 && errno != EEXIST)
++  while (mkdir (dir, ACCESSPERMS) < 0 && errno != EEXIST)
+     {
+       if (errno == ENOENT)
+         make_directories (dir);
+@@ -2192,7 +2192,7 @@ DWARF data in '%s' not adjusted for prelinking bias; consider prelink -u"),
  
-+#if !defined(ALLPERMS)
-+# define ALLPERMS (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO) /* 07777 */
-+#endif
-+
- /* The original ELF file.  */
- static int fd = -1;
- static Elf *elf = NULL;
+       /* Copy the unstripped file and then modify it.  */
+       int outfd = open (output_file, O_RDWR | O_CREAT,
+-			  stripped_ehdr->e_type == ET_REL ? 0666 : 0777);
++			  stripped_ehdr->e_type == ET_REL ? DEFFILEMODE : ACCESSPERMS);
+       if (outfd < 0)
+ 	error (EXIT_FAILURE, errno, _("cannot open '%s'"), output_file);
+       Elf *outelf = elf_begin (outfd, ELF_C_WRITE, NULL);
diff --git a/srcpkgs/elfutils/patches/musl-strndupa.patch b/srcpkgs/elfutils/patches/musl-strndupa.patch
deleted file mode 100644
index f365fb019f2..00000000000
--- a/srcpkgs/elfutils/patches/musl-strndupa.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- src/unstrip.c.orig	2017-04-27 14:26:26.000000000 +0000
-+++ src/unstrip.c	2017-05-05 15:51:33.515154220 +0000
-@@ -56,6 +56,15 @@
- # define _(str) gettext (str)
- #endif
- 
-+#ifndef strndupa
-+#define strndupa(s, n) \
-+       (__extension__ ({const char *__in = (s);                    \
-+                        size_t __len = strnlen (__in, (n)) + 1;    \
-+                        char *__out = (char *) alloca (__len);     \
-+                        __out[__len-1] = '\0';                     \
-+                        (char *) memcpy (__out, __in, __len-1);}))
-+#endif
-+
- /* Name and version of program.  */
- ARGP_PROGRAM_VERSION_HOOK_DEF = print_version;
- 
diff --git a/srcpkgs/elfutils/template b/srcpkgs/elfutils/template
index 02e6e20c64b..99159a2be41 100644
--- a/srcpkgs/elfutils/template
+++ b/srcpkgs/elfutils/template
@@ -1,22 +1,26 @@
 # Template file for 'elfutils'
 pkgname=elfutils
-version=0.181
+version=0.182
 revision=1
 build_style=gnu-configure
-configure_args="--program-prefix=eu- --disable-debuginfod --disable-libdebuginfod"
+configure_args="--program-prefix=eu-"
 hostmakedepends="automake libtool pkg-config"
-makedepends="bzip2-devel liblzma-devel zlib-devel"
+makedepends="bzip2-devel liblzma-devel zlib-devel
+ libcurl-devel libarchive-devel sqlite-devel libmicrohttpd-devel"
 short_desc="Utilities to handle ELF object files"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="GPL-3.0-or-later"
 homepage="https://sourceware.org/elfutils/"
 distfiles="https://sourceware.org/${pkgname}/ftp/${version}/${pkgname}-${version}.tar.bz2"
-checksum=29a6ad7421ec2acfee489bb4a699908281ead2cb63a20a027ce8804a165f0eb3
+checksum=ecc406914edf335f0b7fc084ebe6c460c4d6d5175bfdd6688c1c78d9146b8858
 
 CFLAGS="-Wno-error"
+CXXFLAGS="-Wl,-z,stack-size=2097152"
 
 if [ "$XBPS_TARGET_LIBC" = musl ]; then
-	makedepends+=" argp-standalone musl-fts-devel musl-obstack-devel"
+	makedepends+=" argp-standalone musl-fts-devel musl-obstack-devel musl-legacy-compat"
+	# XXX: breaks some expected functionality
+	CFLAGS+=" -DFNM_EXTMATCH=0"
 fi
 
 post_extract() {
@@ -30,6 +34,23 @@ pre_configure() {
 	autoreconf -if
 }
 
+libdebuginfod_package() {
+	short_desc+=" - debuginfod library"
+	pkg_install() {
+		vmove "usr/lib/libdebuginfod-*.so*"
+		vmove etc/profile.d
+	}
+}
+
+debuginfod_package() {
+	short_desc+=" - debuginfod programs"
+	pkg_install() {
+		vmove "usr/bin/debuginfod*"
+		vmove "usr/share/man/man1/debuginfod-find.1"
+		vmove "usr/share/man/man8/debuginfod.8"
+	}
+}
+
 libelf_package() {
 	short_desc+=" - runtime library"
 	pkg_install() {
@@ -38,11 +59,13 @@ libelf_package() {
 }
 
 elfutils-devel_package() {
-	depends="libelf>=${version}_${revision} ${makedepends}"
+	depends="libelf>=${version}_${revision} libdebuginfod>=${version}_${revision}
+	 ${makedepends}"
 	short_desc+=" - development files"
 	pkg_install() {
 		vmove usr/include
 		vmove usr/lib/pkgconfig
 		vmove "usr/lib/*.a"
+		vmove usr/share/man/man3
 	}
 }
diff --git a/srcpkgs/libdebuginfod b/srcpkgs/libdebuginfod
new file mode 120000
index 00000000000..b76b36cfac4
--- /dev/null
+++ b/srcpkgs/libdebuginfod
@@ -0,0 +1 @@
+elfutils
\ No newline at end of file

From 3d184997a53801acaf720f22954a36659125c479 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
Date: Sun, 25 Oct 2020 18:23:45 -0300
Subject: [PATCH 4/4] gdb: add debuginfod option, enable by default.

---
 srcpkgs/gdb/template | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/srcpkgs/gdb/template b/srcpkgs/gdb/template
index 0e2e399e798..e2a39e7d103 100644
--- a/srcpkgs/gdb/template
+++ b/srcpkgs/gdb/template
@@ -1,16 +1,18 @@
 # Template file for 'gdb'
 pkgname=gdb
 version=10.1
-revision=1
+revision=2
 build_style=gnu-configure
 pycompile_dirs="/usr/share/gdb/python"
 configure_args="--disable-werror --disable-nls --with-system-readline
  --with-system-gdbinit=/etc/gdb/gdbinit --with-system-zlib $(vopt_enable gdbserver)
  $(vopt_if static 'CFLAGS=-static CXXFLAGS=-static LDFLAGS=-static')
- $(vopt_if python --with-python=/usr/bin/python3)"
-hostmakedepends="texinfo perl $(vopt_if python python3-devel)"
+ $(vopt_if python --with-python=/usr/bin/python3)
+ $(vopt_with debuginfod)"
+hostmakedepends="texinfo perl pkg-config $(vopt_if python python3-devel)"
 makedepends="ncurses-devel zlib-devel readline-devel expat-devel
- $(vopt_if python 'python3-devel gettext-libs')"
+ $(vopt_if python 'python3-devel gettext-libs')
+ $(vopt_if debuginfod elfutils-devel)"
 short_desc="GNU Debugger"
 maintainer="Anthony Iliopoulos <ailiop@altatus.com>"
 license="GPL-3.0-or-later"
@@ -28,10 +30,11 @@ fi
 CFLAGS+=" -fcommon"
 CXXFLAGS+=" -fcommon"
 # Package build options
-build_options="gdbserver static python"
+build_options="gdbserver static python debuginfod"
 desc_option_gdbserver="Enable support for building GDB server"
+desc_option_debuginfod="Enable support for libdebuginfod"
 # Enable gdbserver if !static.
-build_options_default="gdbserver python"
+build_options_default="gdbserver python debuginfod"
 # Both options cannot be enabled at the same time
 vopt_conflict gdbserver static
 

  parent reply	other threads:[~2020-11-06 14:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02  1:56 [PR PATCH] " ericonr
2020-11-02  1:58 ` [PR PATCH] [Updated] " ericonr
2020-11-02  2:01 ` ericonr
2020-11-02  2:02 ` ericonr
2020-11-02  2:03 ` ericonr
2020-11-02 18:21 ` ericonr
2020-11-06 14:39 ` ericonr [this message]
2020-11-17 13:56 ` ericonr
2020-11-18  2:32 ` ericonr
2020-11-18  3:00 ` [PR PATCH] [Merged]: " ericonr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201106143914.dgX9Qs0THiWDQf69iHCAq1gCk87Nw9jA7UjJtLLCJUo@z \
    --to=ericonr@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).