From: Yu Watanabe Date: Sun, 17 Aug 2025 13:19:50 +0000 (+0900) Subject: Bump required minimum version of elfutils to 0.177 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ba0e5674b97291aa975b6f137d8b92199f25606;p=thirdparty%2Fsystemd.git Bump required minimum version of elfutils to 0.177 Major distributions already have elfutils >= 0.190. Let's bump the required minimum version. Note, elfutils 0.177 was released on 2019-08-14. See also #38608. --- diff --git a/README b/README index 2985d5c4fa5..a75f4175e90 100644 --- a/README +++ b/README @@ -247,7 +247,7 @@ REQUIREMENTS: p11-kit >= 0.23.3 (optional) libfido2 (optional) tpm2-tss (optional) - elfutils >= 158 (optional) + elfutils >= 177 (optional) polkit (optional) tzdata >= 2014f (optional) pkg-config diff --git a/meson.build b/meson.build index 90604e41910..96197002d1c 100644 --- a/meson.build +++ b/meson.build @@ -1380,6 +1380,7 @@ conf.set10('HAVE_TSS2_ESYS3', tpm2.found() and tpm2.version().version_compare('> conf.set('TPM2_NVPCR_BASE', get_option('tpm2-nvpcr-base')) libdw = dependency('libdw', + version : '>=0.177', required : get_option('elfutils')) libdw_cflags = libdw.partial_dependency(includes: true, compile_args: true) libelf = dependency('libelf', @@ -1387,10 +1388,6 @@ libelf = dependency('libelf', libelf_cflags = libelf.partial_dependency(includes: true, compile_args: true) conf.set10('HAVE_ELFUTILS', libdw.found() and libelf.found()) -# New in elfutils 0.177 -conf.set10('HAVE_DWELF_ELF_E_MACHINE_STRING', - libdw.found() and cc.has_function('dwelf_elf_e_machine_string', dependencies : libdw)) - # New in elfutils 0.192 conf.set10('HAVE_DWFL_SET_SYSROOT', libdw.found() and cc.has_function('dwfl_set_sysroot', dependencies : libdw)) diff --git a/src/shared/elf-util.c b/src/shared/elf-util.c index a8cfb8cd22c..9a09352ca7f 100644 --- a/src/shared/elf-util.c +++ b/src/shared/elf-util.c @@ -47,9 +47,7 @@ static DLSYM_PROTOTYPE(dwarf_formstring) = NULL; static DLSYM_PROTOTYPE(dwarf_getscopes) = NULL; static DLSYM_PROTOTYPE(dwarf_getscopes_die) = NULL; static DLSYM_PROTOTYPE(dwelf_elf_begin) = NULL; -#if HAVE_DWELF_ELF_E_MACHINE_STRING static DLSYM_PROTOTYPE(dwelf_elf_e_machine_string) = NULL; -#endif static DLSYM_PROTOTYPE(dwelf_elf_gnu_build_id) = NULL; static DLSYM_PROTOTYPE(dwarf_tag) = NULL; static DLSYM_PROTOTYPE(dwfl_addrmodule) = NULL; @@ -111,9 +109,7 @@ int dlopen_dw(void) { DLSYM_ARG(dwarf_diename), DLSYM_ARG(dwelf_elf_gnu_build_id), DLSYM_ARG(dwelf_elf_begin), -#if HAVE_DWELF_ELF_E_MACHINE_STRING DLSYM_ARG(dwelf_elf_e_machine_string), -#endif DLSYM_ARG(dwfl_addrmodule), DLSYM_ARG(dwfl_frame_pc), DLSYM_ARG(dwfl_module_addrdie), @@ -773,7 +769,6 @@ static int parse_elf( if (r < 0) return log_warning_errno(r, "Failed to build JSON object: %m"); -#if HAVE_DWELF_ELF_E_MACHINE_STRING const char *elf_architecture = sym_dwelf_elf_e_machine_string(elf_header.e_machine); if (elf_architecture) { r = sd_json_variant_merge_objectbo( @@ -785,7 +780,6 @@ static int parse_elf( if (ret) fprintf(c.m.f, "ELF object binary architecture: %s\n", elf_architecture); } -#endif /* We always at least have the ELF type, so merge that (and possibly the arch). */ r = sd_json_variant_merge_object(&elf_metadata, package_metadata);