]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Bump required minimum version of elfutils to 0.177
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 17 Aug 2025 13:19:50 +0000 (22:19 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 2 Jan 2026 02:12:27 +0000 (11:12 +0900)
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.

README
meson.build
src/shared/elf-util.c

diff --git a/README b/README
index 2985d5c4fa512a5e068cc69fc3ac0c23fbacb1c9..a75f4175e90e7d70080ad9039758a5a6602cabea 100644 (file)
--- 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
index 90604e41910fd5c0199b42b5ced6f828e55b9edd..96197002d1c053bafd99cdc8a44a905f5a05c648 100644 (file)
@@ -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))
index a8cfb8cd22cb4e9c48f91969b629d5ecc1d14862..9a09352ca7fea48a20eb86cc949bfb7cf35e2267 100644 (file)
@@ -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);