From 447093ffdefd04481096562090cb7bcced5287ed Mon Sep 17 00:00:00 2001 From: Michael Pratt Date: Fri, 17 May 2024 23:47:54 -0400 Subject: [PATCH] tools/elfutils: simplify portability patch Several changes to the elfutils source files made during the process of figuring out how to successfully build elfutils on macOS turn out to not be necessary to do so, and were most likely leftover bits during testing. Remove the line changes that are not needed and add some line changes to adapt to sources as is: - Remove now unnecessary bump to autoconf version prereq - AC_CONFIG_MACRO_DIRS is not necessary to define as ACLOCAL_AMFLAGS is already defined in Makefiles - let libtool "enable_static" variable also decide the value of the local conditional BUILD_STATIC - override configure variables instead of removing checks for libraries or additions to LDFLAGS - only exclude "hidden" attribute for macOS instead of deleting - preserve original list of sources to build for libelf - use openwrt Makefile to add gnulib headers - use openwrt Makefile to add LIBADD variables - remove deletion of variables and rules for shared objects - prefer recursively expanded variables over muliple renames each time that a word is added to its value - remove changes to subdirectories that are not built and remove changes to target files of those subdirectories - prefer basic text rename over variables in cases where there would be no line number difference - give LT_INIT forced default values that match upstream - move gl_EARLY and gl_INIT down relative to compiler checks - reorganize some line changes to save some lines Signed-off-by: Michael Pratt Link: https://github.com/openwrt/openwrt/pull/15690 Signed-off-by: Robert Marko --- tools/elfutils/Makefile | 9 + tools/elfutils/patches/100-portability.patch | 538 +++++-------------- 2 files changed, 155 insertions(+), 392 deletions(-) diff --git a/tools/elfutils/Makefile b/tools/elfutils/Makefile index 0fbf1aedad..6b09f29c68 100644 --- a/tools/elfutils/Makefile +++ b/tools/elfutils/Makefile @@ -57,7 +57,10 @@ export $(PKG_GNULIB_BASE)=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE export $(PKG_GNULIB_BASE)_tsearch=$(HOST_BUILD_DIR)/$(PKG_GNULIB_BASE)/$(PKG_GNULIB_BASE)_la-tsearch.lo HOST_MAKE_FLAGS += \ + DEFAULT_INCLUDES='-I. -I$$$$(top_builddir) -I$$$$(top_srcdir)/$(PKG_GNULIB_BASE)' \ AM_LDFLAGS='$$$$(STACK_USAGE_NO_ERROR)' \ + libelf_la_LIBADD='../lib/libeu.la -lz $$$$(zstd_LIBS) -lpthread' \ + libdw_la_LIBADD='../libdwfl/libdwfl.la ../libdwelf/libdwelf.la ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la' \ LIBS+='$$$$(if $$$$(findstring $(lastword $(PKG_SUBDIRS)),$$$$(subdir)), $$$$($(PKG_GNULIB_BASE)))' \ LIBS+='$$$$(wildcard $$$$($(PKG_GNULIB_BASE)_tsearch))' \ REPLACE_FCNTL=0 REPLACE_FREE=0 REPLACE_FSTAT=0 REPLACE_OPEN=0 \ @@ -86,6 +89,12 @@ ifeq ($(HOST_OS),Darwin) HOST_CONFIGURE_ARGS += --disable-symbol-versioning endif +HOST_CONFIGURE_VARS += \ + ac_cv_search_argp_parse=yes \ + ac_cv_search_fts_close=yes \ + ac_cv_search__obstack_free=yes \ + ac_cv_buildid=yes + Hooks/HostConfigure/Pre := Host/Gnulib $(Hooks/HostConfigure/Pre) define Host/Gnulib $(STAGING_DIR_HOST)/bin/gnulib-tool $(PKG_GNULIB_ARGS) $(PKG_GNULIB_MODS); diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch index fb6f0299ac..1e4233c8fd 100644 --- a/tools/elfutils/patches/100-portability.patch +++ b/tools/elfutils/patches/100-portability.patch @@ -1,102 +1,59 @@ --- a/configure.ac +++ b/configure.ac -@@ -20,6 +20,7 @@ dnl You should have received a copy of - dnl along with this program. If not, see . - AC_INIT([elfutils],[0.191],[https://sourceware.org/bugzilla],[elfutils],[http://elfutils.org/]) - -+AC_CONFIG_MACRO_DIRS([m4]) - dnl Workaround for older autoconf < 2.64 - m4_ifndef([AC_PACKAGE_URL], - [AC_DEFINE([PACKAGE_URL], ["http://elfutils.org/"], -@@ -43,16 +44,17 @@ elif test "x$program_prefix" = "x"; then - fi +@@ -44,6 +44,7 @@ fi AC_CONFIG_AUX_DIR([config]) --AC_CONFIG_FILES([config/Makefile]) -+AC_CONFIG_FILES([config/Makefile libgnu/Makefile]) + AC_CONFIG_FILES([config/Makefile]) ++AC_CONFIG_FILES([libgnu/Makefile]) AC_COPYRIGHT([Copyright (C) 1996-2024 The elfutils developers.]) --AC_PREREQ(2.63) dnl Minimum Autoconf version required. -+AC_PREREQ(2.64) dnl Minimum Autoconf version required. - - dnl We use GNU make extensions; automake 1.10 defaults to -Wportability. - AM_INIT_AUTOMAKE([gnits 1.11 -Wno-portability dist-bzip2 no-dist-gzip parallel-tests]) - AM_MAINTAINER_MODE + AC_PREREQ(2.63) dnl Minimum Autoconf version required. +@@ -88,16 +89,21 @@ AS_IF([test "$use_locks" = yes], - AM_SILENT_RULES([yes]) -+AC_USE_SYSTEM_EXTENSIONS() - - AC_CONFIG_SRCDIR([libelf/libelf.h]) - AC_CONFIG_FILES([Makefile]) -@@ -89,12 +91,14 @@ AS_IF([test "$use_locks" = yes], AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) ++AC_USE_SYSTEM_EXTENSIONS() ++ m4_version_prereq([2.70], [AC_PROG_CC], [AC_PROG_CC_C99]) -+gl_EARLY -+gl_INIT AC_PROG_CXX --AC_PROG_RANLIB + AC_PROG_RANLIB AC_PROG_YACC AC_PROG_LEX([noyywrap]) ++gl_EARLY # Only available since automake 1.12 m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) -+LT_INIT() AC_CHECK_TOOL([READELF], [readelf]) AC_CHECK_TOOL([NM], [nm]) -@@ -195,7 +199,6 @@ AC_CACHE_CHECK([whether the compiler gen - AC_LINK_IFELSE([AC_LANG_PROGRAM()],[ac_cv_buildid=yes; $READELF -n conftest$EXEEXT | grep -q NT_GNU_BUILD_ID || ac_cv_buildid=no],AC_MSG_FAILURE([unexpected compile failure]))]) - if test "$ac_cv_buildid" = "no"; then - AC_MSG_WARN([compiler doesn't generate build-id by default]) -- LDFLAGS="$LDFLAGS -Wl,--build-id" - fi - - ZRELRO_LDFLAGS="-Wl,-z,relro" -@@ -635,36 +638,6 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], ++LT_INIT([shared disable-static]) ++ + AC_CACHE_CHECK([whether gcc supports __attribute__((visibility()))], + ac_cv_visibility, [dnl + save_CFLAGS="$CFLAGS" +@@ -415,7 +421,7 @@ AS_HELP_STRING([--enable-install-elfh],[ + AM_CONDITIONAL(INSTALL_ELFH, test "$install_elfh" = yes) + + AM_CONDITIONAL(BUILD_STATIC, [dnl +-test "$use_gprof" = yes -o "$use_gcov" = yes]) ++test "$use_gprof" = yes -o "$use_gcov" = yes -o "$enable_static" = yes]) + + AC_ARG_ENABLE([tests-rpath], + AS_HELP_STRING([--enable-tests-rpath],[build $ORIGIN-using rpath into tests]), +@@ -635,6 +641,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([])], CFLAGS="$old_CFLAGS"]) AS_IF([test "x$ac_cv_fno_addrsig" = "xyes"], CFLAGS="$CFLAGS -fno-addrsig") --saved_LIBS="$LIBS" --AC_SEARCH_LIBS([argp_parse], [argp]) --LIBS="$saved_LIBS" --case "$ac_cv_search_argp_parse" in -- no) AC_MSG_FAILURE([failed to find argp_parse]) ;; -- -l*) argp_LDADD="$ac_cv_search_argp_parse" ;; -- *) argp_LDADD= ;; --esac --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. ++gl_INIT ++ + saved_LIBS="$LIBS" + AC_SEARCH_LIBS([argp_parse], [argp]) + LIBS="$saved_LIBS" --- a/libelf/elf_update.c +++ b/libelf/elf_update.c -@@ -37,6 +37,33 @@ +@@ -37,6 +37,31 @@ #include "libelfP.h" -+#include "elf_fill.c" -+ +#ifdef __APPLE__ +static int posix_fallocate(int fd, off_t offset, off_t len) +{ @@ -147,20 +104,16 @@ #ifdef __i386__ # define internal_function __attribute__ ((regparm (3), stdcall)) -@@ -77,12 +81,7 @@ +@@ -77,7 +81,7 @@ #define internal_strong_alias(name, aliasname) \ extern __typeof (name) aliasname __attribute__ ((alias (#name))) internal_function; -#ifdef HAVE_VISIBILITY --#define attribute_hidden \ -- __attribute__ ((visibility ("hidden"))) --#else - #define attribute_hidden /* empty */ --#endif - - #ifdef HAVE_GCC_STRUCT - #define attribute_packed \ -@@ -166,7 +165,7 @@ asm (".section predict_data, \"aw\"; .pr ++#if defined(HAVE_VISIBILITY) && !defined(__APPLE__) + #define attribute_hidden \ + __attribute__ ((visibility ("hidden"))) + #else +@@ -166,7 +170,7 @@ asm (".section predict_data, \"aw\"; .pr #endif /* Avoid PLT entries. */ @@ -169,17 +122,6 @@ # define INTUSE(name) _INTUSE(name) # define _INTUSE(name) __##name##_internal # define INTDEF(name) _INTDEF(name) ---- a/config/eu.am -+++ b/config/eu.am -@@ -31,7 +31,7 @@ - ## - - DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' --AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. -+AM_CPPFLAGS = -I$(top_builddir)/libgnu -I$(top_srcdir)/libgnu -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. - - # Drop the 'u' flag that automake adds by default. It is incompatible - # with deterministic archives. --- a/libelf/Makefile.am +++ b/libelf/Makefile.am @@ -34,9 +34,7 @@ endif @@ -193,40 +135,19 @@ include_HEADERS = libelf.h gelf.h nlist.h noinst_HEADERS = abstract.h common.h exttypes.h gelf_xlate.h libelfP.h \ -@@ -51,7 +49,8 @@ endif +@@ -51,7 +49,7 @@ endif pkginclude_HEADERS = elf-knowledge.h -libelf_a_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ -+libelf_la_LIBADD = ../lib/libeu.la -lz $(zstd_LIBS) -lpthread -+libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c \ ++libelf_la_SOURCES = elf_version.c elf_hash.c elf_error.c elf_fill.c \ elf_begin.c elf_next.c elf_rand.c elf_end.c elf_kind.c \ gelf_getclass.c elf_getbase.c elf_getident.c \ elf32_fsize.c elf64_fsize.c gelf_fsize.c \ -@@ -102,37 +101,9 @@ libelf_a_SOURCES = elf_version.c elf_has - elf32_getchdr.c elf64_getchdr.c gelf_getchdr.c \ - elf_compress.c elf_compress_gnu.c - --libelf_pic_a_SOURCES = --am_libelf_pic_a_OBJECTS = $(libelf_a_SOURCES:.c=.os) -- --libelf_so_DEPS = ../lib/libeu.a --libelf_so_LDLIBS = $(libelf_so_DEPS) -lz $(zstd_LIBS) --if USE_LOCKS --libelf_so_LDLIBS += -lpthread --endif -- --libelf_so_LIBS = libelf_pic.a --libelf.so: $(srcdir)/libelf.map $(libelf_so_LIBS) $(libelf_so_DEPS) -- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -- -Wl,--soname,$@.$(VERSION) \ -- -Wl,--version-script,$< \ -- $(NO_UNDEFINED) \ -- -Wl,--whole-archive $(libelf_so_LIBS) -Wl,--no-whole-archive \ -- $(libelf_so_LDLIBS) -- @$(textrel_check) -- $(AM_V_at)ln -fs $@ $@.$(VERSION) -- +@@ -122,11 +120,8 @@ libelf.so: $(srcdir)/libelf.map $(libelf + @$(textrel_check) + $(AM_V_at)ln -fs $@ $@.$(VERSION) + -install: install-am libelf.so +install: install-am $(mkinstalldirs) $(DESTDIR)$(libdir) @@ -235,13 +156,7 @@ - ln -fs libelf.so.$(VERSION) $(DESTDIR)$(libdir)/libelf.so uninstall: uninstall-am -- rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so -- rm -f $(DESTDIR)$(libdir)/libelf.so.$(VERSION) -- rm -f $(DESTDIR)$(libdir)/libelf.so - - EXTRA_DIST = libelf.map -- --CLEANFILES += $(am_libelf_pic_a_OBJECTS) libelf.so libelf.so.$(VERSION) + rm -f $(DESTDIR)$(libdir)/libelf-$(PACKAGE_VERSION).so --- a/backends/i386_auxv.c +++ b/backends/i386_auxv.c @@ -48,5 +48,4 @@ EBLHOOK(auxv_info) (GElf_Xword a_type, c @@ -365,7 +280,7 @@ +#endif --- a/libdw/libdwP.h +++ b/libdw/libdwP.h -@@ -32,10 +32,10 @@ +@@ -32,6 +32,7 @@ #include #include @@ -373,10 +288,6 @@ #include #include -- - /* Known location expressions already decoded. */ - struct loc_s - { --- a/libdw/Makefile.am +++ b/libdw/Makefile.am @@ -34,14 +34,12 @@ endif @@ -396,63 +307,19 @@ dwarf_getpubnames.c dwarf_getabbrev.c dwarf_tag.c \ dwarf_error.c dwarf_nextcu.c dwarf_diename.c dwarf_offdie.c \ dwarf_attr.c dwarf_formstring.c \ -@@ -103,50 +101,12 @@ $(srcdir)/known-dwarf.h: $(top_srcdir)/c - mv -f $@.new $@ - endif +@@ -121,11 +119,8 @@ libdw.so: $(srcdir)/libdw.map $(libdw_so + @$(textrel_check) + $(AM_V_at)ln -fs $@ $@.$(VERSION) --libdw_pic_a_SOURCES = --am_libdw_pic_a_OBJECTS = $(libdw_a_SOURCES:.c=.os) -- --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) $(fts_LIBS) $(obstack_LIBS) $(zip_LIBS) -pthread --libdw.so: $(srcdir)/libdw.map $(libdw_so_LIBS) $(libdw_so_DEPS) -- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -- -Wl,--soname,$@.$(VERSION),--enable-new-dtags \ -- -Wl,--version-script,$< \ -- $(NO_UNDEFINED) \ -- -Wl,--whole-archive $(libdw_so_LIBS) -Wl,--no-whole-archive \ -- $(libdw_so_LDLIBS) -- @$(textrel_check) -- $(AM_V_at)ln -fs $@ $@.$(VERSION) -- -install: install-am libdw.so -- $(mkinstalldirs) $(DESTDIR)$(libdir) ++install: install-am + $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL_PROGRAM) libdw.so $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so - ln -fs libdw-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdw.so.$(VERSION) - ln -fs libdw.so.$(VERSION) $(DESTDIR)$(libdir)/libdw.so -- --uninstall: uninstall-am -- rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so -- rm -f $(DESTDIR)$(libdir)/libdw.so.$(VERSION) -- rm -f $(DESTDIR)$(libdir)/libdw.so -- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils -- --libdwfl_objects = $(shell $(AR) t ../libdwfl/libdwfl.a) --libdw_a_LIBADD = $(addprefix ../libdwfl/,$(libdwfl_objects)) -- --libdwelf_objects = $(shell $(AR) t ../libdwelf/libdwelf.a) --libdw_a_LIBADD += $(addprefix ../libdwelf/,$(libdwelf_objects)) -- --libebl_objects = $(shell $(AR) t ../libebl/libebl.a) --libdw_a_LIBADD += $(addprefix ../libebl/,$(libebl_objects)) -- --backends_objects = $(shell $(AR) t ../backends/libebl_backends.a) --libdw_a_LIBADD += $(addprefix ../backends/,$(backends_objects)) -- --libcpu_objects = $(shell $(AR) t ../libcpu/libcpu.a) --libdw_a_LIBADD += $(addprefix ../libcpu/,$(libcpu_objects)) -+libdw_la_LIBADD = \ -+ ../libdwfl/libdwfl.la \ -+ ../libdwelf/libdwelf.la \ -+ ../libebl/libebl.la \ -+ ../backends/libebl_backends.la \ -+ ../libcpu/libcpu.la - - noinst_HEADERS = libdwP.h memory-access.h dwarf_abbrev_hash.h \ - dwarf_sig8_hash.h cfi.h encoded-value.h + + uninstall: uninstall-am + rm -f $(DESTDIR)$(libdir)/libdw-$(PACKAGE_VERSION).so --- a/libasm/Makefile.am +++ b/libasm/Makefile.am @@ -32,12 +32,10 @@ AM_CPPFLAGS += -I$(top_srcdir)/libelf -I @@ -470,48 +337,22 @@ asm_getelf.c asm_newscn.c asm_newscn_ingrp.c \ asm_newsubscn.c asm_newsym.c asm_newcomsym.c \ asm_newabssym.c \ -@@ -51,38 +49,6 @@ libasm_a_SOURCES = asm_begin.c asm_abort - disasm_begin.c disasm_cb.c disasm_end.c disasm_str.c \ - symbolhash.c - --libasm_pic_a_SOURCES = --am_libasm_pic_a_OBJECTS = $(libasm_a_SOURCES:.c=.os) -- --libasm_so_DEPS = ../lib/libeu.a ../libebl/libebl_pic.a ../libelf/libelf.so ../libdw/libdw.so --libasm_so_LDLIBS = $(libasm_so_DEPS) --if USE_LOCKS --libasm_so_LDLIBS += -lpthread --endif -- --libasm_so_LIBS = libasm_pic.a --libasm.so: $(srcdir)/libasm.map $(libasm_so_LIBS) $(libasm_so_DEPS) -- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -- -Wl,--soname,$@.$(VERSION) \ -- -Wl,--version-script,$< \ -- $(NO_UNDEFINED) \ -- -Wl,--whole-archive $(libasm_so_LIBS) -Wl,--no-whole-archive \ -- $(libasm_so_LDLIBS) -- @$(textrel_check) -- $(AM_V_at)ln -fs $@ $@.$(VERSION) -- +@@ -71,11 +69,8 @@ libasm.so: $(srcdir)/libasm.map $(libasm + @$(textrel_check) + $(AM_V_at)ln -fs $@ $@.$(VERSION) + -install: install-am libasm.so -- $(mkinstalldirs) $(DESTDIR)$(libdir) ++install: install-am + $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL_PROGRAM) libasm.so $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so - ln -fs libasm-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libasm.so.$(VERSION) - ln -fs libasm.so.$(VERSION) $(DESTDIR)$(libdir)/libasm.so -- --uninstall: uninstall-am -- rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so -- rm -f $(DESTDIR)$(libdir)/libasm.so.$(VERSION) -- rm -f $(DESTDIR)$(libdir)/libasm.so -- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils -- - noinst_HEADERS = libasmP.h symbolhash.h - EXTRA_DIST = libasm.map + uninstall: uninstall-am + rm -f $(DESTDIR)$(libdir)/libasm-$(PACKAGE_VERSION).so --- a/libdwfl/Makefile.am +++ b/libdwfl/Makefile.am -@@ -34,13 +34,11 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/. +@@ -34,12 +34,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/. -I$(srcdir)/../libdw -I$(srcdir)/../libdwelf -I$(builddir)/../debuginfod VERSION = 1 @@ -521,40 +362,11 @@ pkginclude_HEADERS = libdwfl.h -- --libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ -+libdwfl_la_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ + ++libdwfl_la_SOURCES = $(libdwfl_a_SOURCES) + libdwfl_a_SOURCES = dwfl_begin.c dwfl_end.c dwfl_error.c dwfl_version.c \ dwfl_module.c dwfl_report_elf.c relocate.c \ dwfl_module_build_id.c dwfl_module_report_build_id.c \ - derelocate.c offline.c segment.c \ -@@ -73,24 +71,14 @@ libdwfl_a_SOURCES = dwfl_begin.c dwfl_en - gzip.c debuginfod-client.c - - if BZLIB --libdwfl_a_SOURCES += bzip2.c -+libdwfl_la_SOURCES += bzip2.c - endif - if LZMA --libdwfl_a_SOURCES += lzma.c -+libdwfl_la_SOURCES += lzma.c - endif - if ZSTD --libdwfl_a_SOURCES += zstd.c -+libdwfl_la_SOURCES += zstd.c - endif - --libdwfl = $(libdw) --libdw = ../libdw/libdw.so --libelf = ../libelf/libelf.so --libebl = ../libebl/libebl.a --libeu = ../lib/libeu.a -- --libdwfl_pic_a_SOURCES = --am_libdwfl_pic_a_OBJECTS = $(libdwfl_a_SOURCES:.c=.os) -- - noinst_HEADERS = libdwflP.h - --CLEANFILES += $(am_libdwfl_pic_a_OBJECTS) --- a/backends/Makefile.am +++ b/backends/Makefile.am @@ -34,7 +34,7 @@ endif @@ -566,7 +378,7 @@ modules = i386 sh x86_64 ia64 alpha arm aarch64 sparc ppc ppc64 s390 \ m68k bpf riscv csky loongarch arc mips -@@ -106,17 +106,13 @@ mips_SRCS = mips_init.c mips_symbol.c mi +@@ -106,7 +106,7 @@ mips_SRCS = mips_init.c mips_symbol.c mi mips_cfi.c mips_unwind.c mips_regs.c mips_retval.c \ mips_corenote.c mips64_corenote.c @@ -575,19 +387,9 @@ $(ia64_SRCS) $(alpha_SRCS) $(arm_SRCS) \ $(aarch64_SRCS) $(sparc_SRCS) $(ppc_SRCS) \ $(ppc64_SRCS) $(s390_SRCS) \ - $(m68k_SRCS) $(bpf_SRCS) $(riscv_SRCS) $(csky_SRCS) \ - $(loongarch_SRCS) $(arc_SRCS) $(mips_SRCS) - --libebl_backends_pic_a_SOURCES = --am_libebl_backends_pic_a_OBJECTS = $(libebl_backends_a_SOURCES:.c=.os) - - noinst_HEADERS = libebl_CPU.h common-reloc.c linux-core-note.c x86_corenote.c - EXTRA_DIST = $(modules:=_reloc.def) -- --MOSTLYCLEANFILES = $(am_libebl_backends_pic_a_OBJECTS) --- a/libdwelf/Makefile.am +++ b/libdwelf/Makefile.am -@@ -34,24 +34,12 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$ +@@ -34,12 +34,12 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$ -I$(srcdir)/../libdwfl -I$(srcdir)/../libebl VERSION = 1 @@ -602,18 +404,6 @@ dwelf_elf_gnu_build_id.c dwelf_scn_gnu_compressed_size.c \ dwelf_strtab.c dwelf_elf_begin.c \ dwelf_elf_e_machine_string.c -- --libdwelf = $(libdw) -- --libdw = ../libdw/libdw.so --libelf = ../libelf/libelf.so --libebl = ../libebl/libebl.a --libeu = ../lib/libeu.a -- --libdwelf_pic_a_SOURCES = --am_libdwelf_pic_a_OBJECTS = $(libdwelf_a_SOURCES:.c=.os) -- --CLEANFILES += $(am_libdwelf_pic_a_OBJECTS) --- a/libebl/Makefile.am +++ b/libebl/Makefile.am @@ -34,9 +34,9 @@ endif @@ -628,108 +418,66 @@ eblsegmenttypename.c eblsectiontypename.c \ eblmachineflagname.c eblsymboltypename.c \ ebldynamictagname.c eblsectionname.c \ -@@ -56,9 +56,4 @@ libebl_a_SOURCES = eblopenbackend.c eblc - eblresolvesym.c eblcheckreloctargettype.c \ - ebl_data_marker_symbol.c - --libebl_pic_a_SOURCES = --am_libebl_pic_a_OBJECTS = $(libebl_a_SOURCES:.c=.os) -- - noinst_HEADERS = libebl.h libeblP.h ebl-hooks.h -- --MOSTLYCLEANFILES = $(am_libebl_pic_a_OBJECTS) --- a/debuginfod/Makefile.am +++ b/debuginfod/Makefile.am -@@ -40,23 +40,12 @@ AM_CPPFLAGS += -I$(srcdir) -I$(srcdir)/. - program_prefix= +@@ -41,13 +41,13 @@ program_prefix= program_transform_name = s,x,x, --if BUILD_STATIC + if BUILD_STATIC -libasm = ../libasm/libasm.a -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread -libelf = ../libelf/libelf.a -lz --if DUMMY_LIBDEBUGINFOD --libdebuginfod = ./libdebuginfod.a --else --libdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS) --endif --else --libasm = ../libasm/libasm.so --libdw = ../libdw/libdw.so --libelf = ../libelf/libelf.so --libdebuginfod = ./libdebuginfod.so --endif --libebl = ../libebl/libebl.a --libeu = ../lib/libeu.a +libasm = ../libasm/libasm.la +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread +libelf = ../libelf/libelf.la + if DUMMY_LIBDEBUGINFOD +-libdebuginfod = ./libdebuginfod.a +libdebuginfod = ./libdebuginfod.la + else +-libdebuginfod = ./libdebuginfod.a -lpthread $(libcurl_LIBS) ++libdebuginfod = ./libdebuginfod.la -lpthread $(libcurl_LIBS) + endif + else + libasm = ../libasm/libasm.so +@@ -55,8 +55,8 @@ libdw = ../libdw/libdw.so + libelf = ../libelf/libelf.so + libdebuginfod = ./libdebuginfod.so + endif +-libebl = ../libebl/libebl.a +-libeu = ../lib/libeu.a +libebl = ../libebl/libebl.la +libeu = ../lib/libeu.la AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw:. -@@ -76,14 +65,10 @@ debuginfod_find_SOURCES = debuginfod-fin +@@ -76,11 +76,10 @@ debuginfod_find_SOURCES = debuginfod-fin debuginfod_find_LDADD = $(libdw) $(libelf) $(libeu) $(libdebuginfod) $(argp_LDADD) $(fts_LIBS) if LIBDEBUGINFOD -noinst_LIBRARIES = libdebuginfod.a -noinst_LIBRARIES += libdebuginfod_pic.a -+libdebuginfod_la_SOURCES = debuginfod-client.c +noinst_LTLIBRARIES = libdebuginfod.la endif -libdebuginfod_a_SOURCES = debuginfod-client.c --libdebuginfod_pic_a_SOURCES = debuginfod-client.c --am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os) -- - if DUMMY_LIBDEBUGINFOD - AM_CPPFLAGS += -Wno-unused-parameter - endif -@@ -92,42 +77,7 @@ if LIBDEBUGINFOD - pkginclude_HEADERS = debuginfod.h - endif ++libdebuginfod_la_SOURCES = debuginfod-client.c + libdebuginfod_pic_a_SOURCES = debuginfod-client.c + am_libdebuginfod_pic_a_OBJECTS = $(libdebuginfod_a_SOURCES:.c=.os) + +@@ -111,12 +110,8 @@ $(LIBDEBUGINFOD_SONAME): $(srcdir)/libde + libdebuginfod.so: $(LIBDEBUGINFOD_SONAME) + ln -fs $< $@ --if LIBDEBUGINFOD --libdebuginfod_so_LIBS = libdebuginfod_pic.a --if DUMMY_LIBDEBUGINFOD --libdebuginfod_so_LDLIBS = --else --libdebuginfod_so_LDLIBS = -lpthread $(libcurl_LIBS) $(fts_LIBS) $(libelf) --endif --$(LIBDEBUGINFOD_SONAME): $(srcdir)/libdebuginfod.map $(libdebuginfod_so_LIBS) -- $(AM_V_CCLD)$(LINK) $(dso_LDFLAGS) -o $@ \ -- -Wl,--soname,$(LIBDEBUGINFOD_SONAME) \ -- -Wl,--version-script,$< \ -- $(NO_UNDEFINED) \ -- -Wl,--whole-archive $(libdebuginfod_so_LIBS) -Wl,--no-whole-archive \ -- $(libdebuginfod_so_LDLIBS) -- @$(textrel_check) -- --libdebuginfod.so: $(LIBDEBUGINFOD_SONAME) -- ln -fs $< $@ -- -install: install-am libdebuginfod.so -- $(mkinstalldirs) $(DESTDIR)$(libdir) ++install: install-am + $(mkinstalldirs) $(DESTDIR)$(libdir) - $(INSTALL_PROGRAM) $(LIBDEBUGINFOD_SONAME) \ - $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME) - ln -fs libdebuginfod-$(PACKAGE_VERSION).so $(DESTDIR)$(libdir)/libdebuginfod.so -- --uninstall: uninstall-am -- rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so -- rm -f $(DESTDIR)$(libdir)/$(LIBDEBUGINFOD_SONAME) -- rm -f $(DESTDIR)$(libdir)/libdebuginfod.so -- rmdir --ignore-fail-on-non-empty $(DESTDIR)$(includedir)/elfutils --endif -- - EXTRA_DIST = libdebuginfod.map --MOSTLYCLEANFILES = $(am_libdebuginfod_pic_a_OBJECTS) $(LIBDEBUGINFOD_SONAME) --CLEANFILES += $(am_libdebuginfod_pic_a_OBJECTS) libdebuginfod.so - - # automake std-options override: arrange to pass LD_LIBRARY_PATH - installcheck-binPROGRAMS: $(bin_PROGRAMS) + + uninstall: uninstall-am + rm -f $(DESTDIR)$(libdir)/libdebuginfod-$(PACKAGE_VERSION).so --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -31,9 +31,9 @@ include $(top_srcdir)/config/eu.am @@ -758,11 +506,10 @@ EXTRA_DIST = arlib.h debugpred.h -@@ -39,27 +39,16 @@ bin_SCRIPTS = make-debug-archive - EXTRA_DIST += make-debug-archive.in +@@ -40,11 +40,11 @@ EXTRA_DIST += make-debug-archive.in CLEANFILES += make-debug-archive --if BUILD_STATIC + if BUILD_STATIC -libasm = ../libasm/libasm.a -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) -ldl -lpthread -libelf = ../libelf/libelf.a -lz $(zstd_LIBS) @@ -775,16 +522,10 @@ else libdebuginfod = endif --else --libasm = ../libasm/libasm.so --libdw = ../libdw/libdw.so --libelf = ../libelf/libelf.so --if LIBDEBUGINFOD --libdebuginfod = ../debuginfod/libdebuginfod.so --else --libdebuginfod = --endif --endif +@@ -58,8 +58,8 @@ else + libdebuginfod = + endif + endif -libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a -libeu = ../lib/libeu.a +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la @@ -792,7 +533,7 @@ if DEMANGLE demanglelib = -lstdc++ -@@ -87,9 +76,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $ +@@ -87,9 +87,9 @@ findtextrel_LDADD = $(libdw) $(libelf) $ 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) @@ -806,24 +547,50 @@ elfcompress_LDADD = $(libebl) $(libelf) $(libdw) $(libeu) $(argp_LDADD) --- a/tests/Makefile.am +++ b/tests/Makefile.am -@@ -690,17 +690,11 @@ installcheck-local: - TESTS_ENVIRONMENT="$(installed_TESTS_ENVIRONMENT)" \ +@@ -50,7 +50,7 @@ check_PROGRAMS = arextract arsymtest new + dwfl-report-offline-memory \ + varlocs backtrace backtrace-child \ + backtrace-data backtrace-dwarf debuglink debugaltlink \ +- buildid deleted deleted-lib.so aggregate_size peel_type \ ++ buildid aggregate_size peel_type \ + vdsosyms \ + getsrc_die strptr newdata elfstrtab dwfl-proc-attach \ + elfshphehdr elfstrmerge dwelfgnucompressed elfgetchdr \ +@@ -103,7 +103,7 @@ endif + test-nlist$(EXEEXT): test-nlist.c + $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) \ +- $(test_nlist_CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD) ++ $(test_nlist_CFLAGS) $(GCOV_FLAGS) -o $@ $< ../libelf/.libs/libelf.a -lz $(zstd_LIBS) + + TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \ + run-ar-N.sh \ +@@ -180,7 +180,7 @@ TESTS = run-arextract.sh run-arsymtest.s + run-readelf-addr.sh run-readelf-str.sh \ + run-readelf-multi-noline.sh \ + run-readelf-types.sh \ +- run-readelf-dwz-multi.sh run-allfcts-multi.sh run-deleted.sh \ ++ run-readelf-dwz-multi.sh run-allfcts-multi.sh \ + run-linkmap-cut.sh run-aggregate-size.sh run-peel-type.sh \ + vdsosyms run-readelf-A.sh \ + run-getsrc-die.sh run-strptr.sh newdata elfstrtab dwfl-proc-attach \ +@@ -691,16 +691,16 @@ installcheck-local: LOG_COMPILER="$(installed_LOG_COMPILER)" check-TESTS --if BUILD_STATIC + if BUILD_STATIC -libdw = ../libdw/libdw.a -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread -libelf = ../libelf/libelf.a -lz $(zstd_LIBS) -libasm = ../libasm/libasm.a --else --libdw = ../libdw/libdw.so --libelf = ../libelf/libelf.so --libasm = ../libasm/libasm.so --endif --libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a --libeu = ../lib/libeu.a +libdw = ../libdw/libdw.la -lz $(zip_LIBS) $(libelf) $(libebl) -ldl -lpthread -+libelf = ../libelf/libelf.la ++libelf = ../libelf/libelf.la -lz $(zstd_LIBS) +libasm = ../libasm/libasm.la + else + libdw = ../libdw/libdw.so + libelf = ../libelf/libelf.so + libasm = ../libasm/libasm.so + endif +-libebl = ../libebl/libebl.a ../backends/libebl_backends.a ../libcpu/libcpu.a +-libeu = ../lib/libeu.a +libebl = ../libebl/libebl.la ../backends/libebl_backends.la ../libcpu/libcpu.la +libeu = ../lib/libeu.la @@ -831,7 +598,7 @@ arsymtest_LDADD = $(libelf) --- a/libcpu/Makefile.am +++ b/libcpu/Makefile.am -@@ -38,19 +38,16 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAG +@@ -38,19 +38,19 @@ LEXCOMPILE = $(LEX) $(LFLAGS) $(AM_LFLAG LEX_OUTPUT_ROOT = lex.$( $@T -@@ -87,20 +84,15 @@ endif +@@ -87,7 +87,7 @@ endif i386_lex_no_Werror = yes @@ -864,19 +631,6 @@ i386_lex_CFLAGS = -Wno-unused-label -Wno-unused-function -Wno-sign-compare \ -Wno-implicit-fallthrough --i386_parse.o: i386_parse.c i386.mnemonics --i386_lex.o: i386_parse.h - i386_gendis_LDADD = $(libeu) -lm $(obstack_LIBS) - --i386_parse.h: i386_parse.c ; -- - bpf_disasm_CFLAGS = -Wno-format-nonliteral - - EXTRA_DIST = defs/i386 - --MOSTLYCLEANFILES = $(am_libcpu_pic_a_OBJECTS) - CLEANFILES += $(foreach P,i386 x86_64,$P_defs $P.mnemonics) - MAINTAINERCLEANFILES = $(foreach P,i386 x86_64, $P_dis.h) --- a/config/libelf.pc.in +++ b/config/libelf.pc.in @@ -8,7 +8,7 @@ Description: elfutils libelf library to -- 2.30.2