diff mbox series

[4/5] elfutils: replace test_nlist CFLAGS patch with a make override

Message ID 20261204120821.88472-5-jaipaul.cheernam@est.tech
State New
Headers show
Series elfutils recipe cleanup and improvements | expand

Commit Message

Jaipaul Cheernam Dec. 4, 2026, 12:08 p.m. UTC
Override test_nlist_CFLAGS with $(CFLAGS) so test-nlist gets the debug
prefix maps; the binary is bit-identical.

AI-Generated: Uses Kiro CLI (claude-opus-5.5)
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 .../elfutils/elfutils_0.197.bb                |  6 +++--
 ...m-compile-test_nlist-with-standard-C.patch | 27 -------------------
 2 files changed, 4 insertions(+), 29 deletions(-)
 delete mode 100644 meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.197.bb b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
index bccbedb0330..07b74bc1e45 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.197.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.197.bb
@@ -16,7 +16,6 @@  SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
            file://0003-fixheadercheck.patch \
            file://0001-libelf-elf_end.c-check-data_list.data.d.d_buf-before.patch \
            file://ptest.patch \
-           file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
            file://0001-tests-run-stackprof-system-.sh-run-stackprof-with-ti.patch \
            "
 SRC_URI:append:libc-musl = " \
@@ -59,7 +58,10 @@  do_compile_ptest() {
 	# so pass the configured flags plus -Wno-error, which come after AM_CFLAGS
 	cflags="$(makefile-getvar Makefile CFLAGS) -Wno-error"
 	cxxflags="$(makefile-getvar Makefile CXXFLAGS) -Wno-error"
-	oe_runmake buildtest-TESTS oecheck "CFLAGS=$cflags" "CXXFLAGS=$cxxflags"
+	# test-nlist has a custom rule using test_nlist_CFLAGS (-g -O0), which lacks
+	# the debug prefix maps and leaks build paths; use the standard CFLAGS
+	oe_runmake buildtest-TESTS oecheck "CFLAGS=$cflags" "CXXFLAGS=$cxxflags" \
+		'test_nlist_CFLAGS=$(CFLAGS)'
 }
 PTEST_PARALLEL_MAKE = ""
 
diff --git a/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch b/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
deleted file mode 100644
index d5a1f281b0e..00000000000
--- a/meta/recipes-devtools/elfutils/files/0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch
+++ /dev/null
@@ -1,27 +0,0 @@ 
-From 4af78e885d764bcc4078ccf810c125159ad327f2 Mon Sep 17 00:00:00 2001
-From: Alexander Kanavin <alex.kanavin@gmail.com>
-Date: Tue, 23 Jun 2020 07:49:35 +0000
-Subject: [PATCH] tests/Makefile.am: compile test_nlist with standard CFLAGS
-
-Otherwise, it will contain build paths in it and wont
-be reproducible.
-
-Upstream-Status: Inappropriate [oe-core specific]
-Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
----
- tests/Makefile.am | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/Makefile.am b/tests/Makefile.am
-index bb36d3a..3e98162 100644
---- a/tests/Makefile.am
-+++ b/tests/Makefile.am
-@@ -122,7 +122,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)
-+	  $(CFLAGS) $(GCOV_FLAGS) -o $@ $< $(test_nlist_LDADD)
- 
- TESTS = run-arextract.sh run-arsymtest.sh run-ar.sh newfile test-nlist \
- 	run-ar-N.sh \