public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/rpm] pmatilai-v6: Add fix for build-id warnings on object files (#1430587)
@ 2026-11-23  9:30 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2026-11-23  9:30 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 74c309943329bef7ad39ab98058b21b0c1ef83f6
Author : Mark Wielaard <mark@klomp.org>
Date   : 2017-03-09T13:18:23+01:00
Stats  : +59/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/74c309943329bef7ad39ab98058b21b0c1ef83f6?branch=pmatilai-v6

Log:
Add fix for build-id warnings on object files (#1430587)

---
diff --git a/0012-generateBuildIDs-Don-t-warn-or-error-for-object-file.patch b/0012-generateBuildIDs-Don-t-warn-or-error-for-object-file.patch
new file mode 100644
index 0000000..31c8df0
--- /dev/null
+++ b/0012-generateBuildIDs-Don-t-warn-or-error-for-object-file.patch
@@ -0,0 +1,52 @@
+From bbeaacd32e74b11264082407e520438373527740 Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Thu, 9 Mar 2017 09:30:17 +0100
+Subject: [PATCH] generateBuildIDs: Don't warn or error for object files
+ without build-id.
+
+Only loadable ELF images (executables, shared libraries, kernel modules)
+should have build-ids. So don't warn or error out when an object file is
+found without one.
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+---
+ build/files.c | 15 +++++++++++----
+ 1 file changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/build/files.c b/build/files.c
+index cbcc0a9..26f53bd 100644
+--- a/build/files.c
++++ b/build/files.c
+@@ -1709,8 +1709,10 @@ static int generateBuildIDs(FileList fl)
+ 	if (lstat(flp->diskPath, &sbuf) == 0 && S_ISREG (sbuf.st_mode)) {
+ 	    int fd = open (flp->diskPath, O_RDONLY);
+ 	    if (fd >= 0) {
++		GElf_Ehdr ehdr;
+ 		Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+-		if (elf != NULL && elf_kind(elf) == ELF_K_ELF) {
++		if (elf != NULL && elf_kind(elf) == ELF_K_ELF
++		    && gelf_getehdr(elf, &ehdr) != NULL) {
+ 		    const void *build_id;
+ 		    ssize_t len = dwelf_elf_gnu_build_id (elf, &build_id);
+ 		    /* len == -1 means error. Zero means no
+@@ -1759,9 +1761,14 @@ static int generateBuildIDs(FileList fl)
+ 				   _("error reading build-id in %s: %s\n"),
+ 				   flp->diskPath, elf_errmsg (-1));
+ 			} else if (len == 0) {
+-			    rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING,
+-				   _("Missing build-id in %s\n"),
+-				   flp->diskPath);
++			    /* Only ET_EXEC, ET_DYN or kernel modules
++			       have build-ids. */
++			    if (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN
++				|| (ehdr.e_type == ET_REL
++				    && rpmFileHasSuffix (flp->diskPath, ".ko")))
++			      rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING,
++				     _("Missing build-id in %s\n"),
++				     flp->diskPath);
+ 			} else {
+ 			    rpmlog(terminate ? RPMLOG_ERR : RPMLOG_WARNING,
+ 				   (len < 16
+-- 
+1.8.3.1
+

diff --git a/rpm.spec b/rpm.spec
index 741a239..92a7180 100644
--- a/rpm.spec
+++ b/rpm.spec
@@ -29,7 +29,7 @@
 Summary: The RPM package management system
 Name: rpm
 Version: %{rpmver}
-Release: %{?snapver:0.%{snapver}.}4%{?dist}
+Release: %{?snapver:0.%{snapver}.}5%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -82,6 +82,9 @@ Patch258: 0009-Fix-libdw-configure-check.patch
 Patch259: 0010-debugedit-Support-String-Line-table-rewriting-for-la.patch
 Patch260: 0011-Add-option-to-have-unique-debug-source-dirs-across-v.patch
 
+# debuginfo build-id warn/error fix (#1430587)
+Patch261: 0012-generateBuildIDs-Don-t-warn-or-error-for-object-file.patch
+
 # These are not yet upstream
 Patch302: rpm-4.7.1-geode-i686.patch
 # Probably to be upstreamed in slightly different form
@@ -582,6 +585,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Thu Mar 09 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-5
+- Add fix for build-id warnings on object files (#1430587)
+
 * Wed Mar 08 2017 Panu Matilainen <pmatilai@redhat.com> - 4.13.0.1-4
 - Mark Wielaard's backports for debuginfo parallel installation etc (#1427970)
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-23  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-23  9:30 [rpms/rpm] pmatilai-v6: Add fix for build-id warnings on object files (#1430587) Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox