public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: git-commits@fedoraproject.org
Subject: [rpms/rpm] pmatilai-v6: Add fixup fix for build-id warnings on object files (#1430587)
Date: Mon, 23 Nov 2026 09:30:40 GMT	[thread overview]
Message-ID: <179542624093.1.17526754581161449915.rpms-rpm-1a7230a63a11@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/rpm
Branch : pmatilai-v6
Commit : 1a7230a63a110c091b4a0475c1ed2e8d92e906d8
Author : Mark Wielaard <mark@klomp.org>
Date   : 2017-03-10T10:07:16+01:00
Stats  : +74/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/rpm/c/1a7230a63a110c091b4a0475c1ed2e8d92e906d8?branch=pmatilai-v6

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

---
diff --git a/0014-generateBuildIDs-Fix-error-handling.patch b/0014-generateBuildIDs-Fix-error-handling.patch
new file mode 100644
index 0000000..9878465
--- /dev/null
+++ b/0014-generateBuildIDs-Fix-error-handling.patch
@@ -0,0 +1,69 @@
+From 7e053a6d843b141fc6b5a89d050082233ed034d6 Mon Sep 17 00:00:00 2001
+From: Mark Wielaard <mark@klomp.org>
+Date: Thu, 9 Mar 2017 22:13:01 +0100
+Subject: [PATCH] generateBuildIDs: Fix error handling.
+
+commit e6bdf7 made it so that we don't give a warning or error message
+for non-kernel ET_REL object files with missing or bad build-ids. But
+we still (unintentionally) failed generateBuildIDs which made us skip
+generating the cpioList causing an obscure failure message.
+
+Move the sanity check earlier so we don't process such object files at
+all. And if there is any real error from generateBuildIDs give a clear
+error message and explicitly set processingFailed.
+
+Signed-off-by: Mark Wielaard <mark@klomp.org>
+---
+ build/files.c | 18 +++++++++++-------
+ 1 file changed, 11 insertions(+), 7 deletions(-)
+
+diff --git a/build/files.c b/build/files.c
+index b19abf2..fef0c69 100644
+--- a/build/files.c
++++ b/build/files.c
+@@ -1686,10 +1686,16 @@ 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) {
++		/* Only real ELF files, that are ET_EXEC, ET_DYN or
++		   kernel modules (ET_REL files with names ending in .ko)
++		   should have build-ids. */
+ 		GElf_Ehdr ehdr;
+ 		Elf *elf = elf_begin (fd, ELF_C_READ, NULL);
+ 		if (elf != NULL && elf_kind(elf) == ELF_K_ELF
+-		    && gelf_getehdr(elf, &ehdr) != NULL) {
++		    && gelf_getehdr(elf, &ehdr) != NULL
++		    && (ehdr.e_type == ET_EXEC || ehdr.e_type == ET_DYN
++			|| (ehdr.e_type == ET_REL
++			    && rpmFileHasSuffix (flp->diskPath, ".ko")))) {
+ 		    const void *build_id;
+ 		    ssize_t len = dwelf_elf_gnu_build_id (elf, &build_id);
+ 		    /* len == -1 means error. Zero means no
+@@ -1738,11 +1744,6 @@ static int generateBuildIDs(FileList fl)
+ 				   _("error reading build-id in %s: %s\n"),
+ 				   flp->diskPath, elf_errmsg (-1));
+ 			} else if (len == 0) {
+-			    /* 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);
+@@ -2354,8 +2355,11 @@ static rpmRC processPackageFiles(rpmSpec spec, rpmBuildPkgFlags pkgFlags,
+ 	goto exit;
+ 
+ #if HAVE_LIBDW
+-    if (generateBuildIDs (&fl) != 0)
++    if (generateBuildIDs (&fl) != 0) {
++	rpmlog(RPMLOG_ERR, _("Generating build-id links failed\n"));
++	fl.processingFailed = 1;
+ 	goto exit;
++    }
+ #endif
+ 
+     /* Verify that file attributes scope over hardlinks correctly. */
+-- 
+1.8.3.1
+

diff --git a/rpm.spec b/rpm.spec
index c9d739c..ff584da 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}.}6%{?dist}
+Release: %{?snapver:0.%{snapver}.}7%{?dist}
 Group: System Environment/Base
 Url: http://www.rpm.org/
 Source0: http://rpm.org/releases/%{srcdir}/%{name}-%{srcver}.tar.bz2
@@ -85,6 +85,7 @@ 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
 Patch262: 0013-missing_build_ids_terminate_build.patch
+Patch263: 0014-generateBuildIDs-Fix-error-handling.patch
 
 # These are not yet upstream
 Patch302: rpm-4.7.1-geode-i686.patch
@@ -586,6 +587,9 @@ exit 0
 %doc doc/librpm/html/*
 
 %changelog
+* Fri Mar 10 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-7
+- Add fixup fix for build-id warnings on object files (#1430587)
+
 * Thu Mar 09 2017 Mark Wielaard <mjw@redhat.com> - 4.13.0.1-6
 - Add fix for missing_build_ids_terminate_build without __debug_package.
 

                 reply	other threads:[~2026-11-23  9:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542624093.1.17526754581161449915.rpms-rpm-1a7230a63a11@fedoraproject.org \
    --to=mark@klomp.org \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox