diff mbox series

[meta-networking,6/6] keepalived: Make build reproducible

Message ID 20240816061915.2095711-6-raj.khem@gmail.com
State New
Headers show
Series [meta-oe,1/6] fvwm: Fix buildpaths QA Errors | expand

Commit Message

Khem Raj Aug. 16, 2024, 6:19 a.m. UTC
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 ...not-emit-compiler-flags-into-object-.patch | 29 +++++++++++++++++++
 .../keepalived/keepalived_2.2.8.bb            |  5 ++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta-networking/recipes-daemons/keepalived/keepalived/0001-configure.ac-Do-not-emit-compiler-flags-into-object-.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-daemons/keepalived/keepalived/0001-configure.ac-Do-not-emit-compiler-flags-into-object-.patch b/meta-networking/recipes-daemons/keepalived/keepalived/0001-configure.ac-Do-not-emit-compiler-flags-into-object-.patch
new file mode 100644
index 0000000000..1f9f8b30b1
--- /dev/null
+++ b/meta-networking/recipes-daemons/keepalived/keepalived/0001-configure.ac-Do-not-emit-compiler-flags-into-object-.patch
@@ -0,0 +1,29 @@ 
+From 5b1b04356f3efc08ae279cafc6ee86df11f10c9a Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Thu, 15 Aug 2024 23:13:02 -0700
+Subject: [PATCH] configure.ac: Do not emit compiler flags into object files
+
+They contain options which have absolute paths in them e.g. --sysroot
+therefore do not record them and make build reproducible
+
+Upstream-Status: Inappropriate [OE-Specific]
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ configure.ac | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index fae16f1..677b94a 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -904,8 +904,7 @@ if test "$enable_hardening" != no; then
+ 	  "-Wp,-D_FORTIFY_SOURCE=2" \
+ 	  "-fexceptions" \
+ 	  "-fstack-protector-strong" \
+-	  "--param=ssp-buffer-size=4" \
+-	  "-grecord-gcc-switches"
++	  "--param=ssp-buffer-size=4"
+   do
+     AC_MSG_CHECKING([for $FLAG support])
+     CFLAGS="$CFLAGS $FLAG"
diff --git a/meta-networking/recipes-daemons/keepalived/keepalived_2.2.8.bb b/meta-networking/recipes-daemons/keepalived/keepalived_2.2.8.bb
index 85f4a6aa59..c4d59d3caa 100644
--- a/meta-networking/recipes-daemons/keepalived/keepalived_2.2.8.bb
+++ b/meta-networking/recipes-daemons/keepalived/keepalived_2.2.8.bb
@@ -11,6 +11,7 @@  LICENSE = "GPL-2.0-only"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
 SRC_URI = "http://www.keepalived.org/software/${BP}.tar.gz \
+           file://0001-configure.ac-Do-not-emit-compiler-flags-into-object-.patch \
            "
 SRC_URI[sha256sum] = "85882eb62974f395d4c631be990a41a839594a7e62fbfebcb5649a937a7a1bb6"
 UPSTREAM_CHECK_URI = "https://github.com/acassen/keepalived/releases"
@@ -30,6 +31,10 @@  EXTRA_OEMAKE = "initdir=${sysconfdir}/init.d"
 
 export EXTRA_CFLAGS = "${CFLAGS}"
 
+do_configure:append() {
+    sed -i -e 's|${WORKDIR}|<scrubbed>|g' ${B}/lib/config.h
+}
+
 do_install:append() {
     if [ -f ${D}${sysconfdir}/init.d/${BPN} ]; then
         chmod 0755 ${D}${sysconfdir}/init.d/${BPN}