diff mbox series

[kirkstone,11/27] glibc-tests: Avoid reproducibility issues

Message ID 96f6badee73f35ededcb7d0172db07fcc305df0d.1657772638.git.steve@sakoman.com
State New, archived
Headers show
Series [kirkstone,01/27] ruby: add PACKAGECONFIG for capstone | expand

Commit Message

Steve Sakoman July 14, 2022, 4:35 a.m. UTC
From: Richard Purdie <richard.purdie@linuxfoundation.org>

Currently, there are hardcoded paths in the binaries installed by this
recipe, at least one some architectures. Change the compile definitions to
point to more appropriate paths. Ideally we'd rework this patch into a form
acceptable to upstream but I'm not entirely sure what that would look like
right now.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit ede7ab3bbf87cc7d7e713d435ea8a88035c2e46e)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 meta/recipes-core/glibc/glibc-tests_2.35.bb   |  3 +++
 .../glibc/glibc/reproducible-paths.patch      | 23 +++++++++++++++++++
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-core/glibc/glibc/reproducible-paths.patch
diff mbox series

Patch

diff --git a/meta/recipes-core/glibc/glibc-tests_2.35.bb b/meta/recipes-core/glibc/glibc-tests_2.35.bb
index 028e83e865..96d0569ff6 100644
--- a/meta/recipes-core/glibc/glibc-tests_2.35.bb
+++ b/meta/recipes-core/glibc/glibc-tests_2.35.bb
@@ -5,6 +5,7 @@  inherit ptest features_check
 REQUIRED_DISTRO_FEATURES = "ptest"
 
 SRC_URI:append = " \
+	file://reproducible-paths.patch \
 	file://run-ptest \
 "
 
@@ -31,6 +32,8 @@  RRECOMMENDS:${PN} = ""
 RDEPENDS:${PN} = " glibc sed"
 DEPENDS:append = " sed"
 
+export oe_srcdir="${exec_prefix}/src/debug/glibc/${PV}/"
+
 # Just build tests for target - do not run them
 do_check:append () {
 	oe_runmake -i check run-built-tests=no
diff --git a/meta/recipes-core/glibc/glibc/reproducible-paths.patch b/meta/recipes-core/glibc/glibc/reproducible-paths.patch
new file mode 100644
index 0000000000..0754dca62b
--- /dev/null
+++ b/meta/recipes-core/glibc/glibc/reproducible-paths.patch
@@ -0,0 +1,23 @@ 
+Avoid hardcoded build time paths in the output binaries by replacing the compile
+definitions with the output locations.
+
+Upstream-Status: Inappropriate [would need reworking somehow to be acceptable upstream]
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: git/support/Makefile
+===================================================================
+--- git.orig/support/Makefile
++++ git/support/Makefile
+@@ -216,9 +216,9 @@ libsupport-inhibit-o += .o
+ endif
+ 
+ CFLAGS-support_paths.c = \
+-		-DSRCDIR_PATH=\"`cd .. ; pwd`\" \
+-		-DOBJDIR_PATH=\"`cd $(objpfx)/..; pwd`\" \
+-		-DOBJDIR_ELF_LDSO_PATH=\"`cd $(objpfx)/..; pwd`/elf/$(rtld-installed-name)\" \
++		-DSRCDIR_PATH=\"$(oe_srcdir)\" \
++		-DOBJDIR_PATH=\"$(libdir)/glibc-tests/ptest/tests/glibc-ptest\" \
++		-DOBJDIR_ELF_LDSO_PATH=\"$(slibdir)/$(rtld-installed-name)\" \
+ 		-DINSTDIR_PATH=\"$(prefix)\" \
+ 		-DLIBDIR_PATH=\"$(libdir)\" \
+ 		-DBINDIR_PATH=\"$(bindir)\" \