From 3cabb1311663d0660e3109c26107edcdb60e05e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 25 Oct 2020 18:57:17 -0300 Subject: [PATCH 1/2] elfutils: update to 0.182, add debuginfod subpkgs, adopt. Cleaned up patches, fixed the aarch64-fregs one (it was doing the wrong thing), 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 | 22 ++-- .../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 | 36 ++++-- srcpkgs/libdebuginfod | 1 + 12 files changed, 230 insertions(+), 215 deletions(-) create mode 120000 srcpkgs/debuginfod create mode 100644 srcpkgs/elfutils/patches/debuginfod.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 e0e75cea1b4..54253148fd0 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 + #include + #include +-// #include // not until it supports C++ << better ++#include + #include + #include + #include diff --git a/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch b/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch index e9641542144..070d2527656 100644 --- a/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch +++ b/srcpkgs/elfutils/patches/fix-aarch64_fregs.patch @@ -1,14 +1,22 @@ -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 @@ +diff --git backends/aarch64_initreg.c backends/aarch64_initreg.c +index daf6f375..02ca1dc0 100644 +--- backends/aarch64_initreg.c ++++ backends/aarch64_initreg.c +@@ -46,6 +46,8 @@ + #define BACKEND aarch64_ + #include "libebl_CPU.h" + ++#include ++ + bool + aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), + ebl_tid_registers_t *setfunc __attribute__ ((unused)), +@@ -82,7 +84,7 @@ aarch64_set_initial_registers_tid (pid_t tid __attribute__ ((unused)), 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]; ++ memcpy(dwarf_fregs + r, fregs.vregs + r, sizeof(dwarf_fregs[0])); 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 ++ ++ * configure.ac: Check for fts and obstack from outside libc. ++ + 2020-10-28 Mark Wielaard + + * 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 - -+#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 - #include - #include --#include - - #include - 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* 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_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 - #include +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 - #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 - #include - -+#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..c41c9ee4aaa 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 " +maintainer="Érico Nogueira " 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,22 @@ pre_configure() { autoreconf -if } +libdebuginfod_package() { + short_desc+=" - debuginfod library" + pkg_install() { + vmove "usr/lib/libdebuginfod-*.so*" + } +} + +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 +58,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 154f60755cd02793fd6287a14d029afee29fe5fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Rolim?= Date: Sun, 25 Oct 2020 18:23:45 -0300 Subject: [PATCH 2/2] 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 " 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