Skip to contentSkip to conversation

gettext: Fix falsely flagged static linking issue

PATCH New Sana Kazi 1 participant 1 message Nov 20

lore
Share & tools
lore

Sana Kazi

author
#0 lore raw

PATCH 1/1 gettext: Fix falsely flagged static linking issue

From: Sana Kazi <[email protected]>

autotools_do_configure in autotools.bbclass deletes the shipped configure scripts and runs one recursive autoreconf --install --force. --install --force runs libtoolize --copy --force per libtool subproject, re-copying the lt*.m4 files with new timestamps.
The aclocal.m4 of gettext-runtime/intl is not refreshed afterwards (gettext misconfiguration), so make considers intl out of date and regenerates/reconfigures it in do_compile. when make runs it sees the files with old timestamp and runs config.status --recheck which is why we get false positive.

$ rg -n 'config.status --recheck|static flag -static works' tmp/work/x86-64-v3-oe-linux/gettext/1.0/temp/log.do_compile
124:checking if x86_64-oe-linux-gcc  -m64 -march=x86-64-v3 -fstack-protector-strong  -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=/home/sana/bsys/upstream/yocto/build/tmp/work/x86-64-v3-oe-linux/gettext/1.0/recipe-sysroot static flag -static works... (cached) yes

touch <file> just updates a file's "last modified" time to right now, so that when make runs it knows that those files are not stale and need not run config.status --recheck which throws the false positive

---
 meta/recipes-core/gettext/gettext_1.0.bb | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-core/gettext/gettext_1.0.bb +11 -0
index 8a93ce1b49..353eb46edd 100644
@@ -70,6 +70,17 @@ PACKAGECONFIG[libunistring] = "--with-libunistring-prefix=${STAGING_DIR_HOST},--
 PACKAGECONFIG[msgcat-curses] = "--with-libncurses-prefix=${STAGING_DIR_HOST},--disable-curses,ncurses,"
 PACKAGECONFIG[selinux] = "--with-selinux,--without-selinux --disable-acl,attr libselinux"
 
+
+do_configure:append() {
+    touch "${S}/gettext-runtime/intl/aclocal.m4"
+    touch "${S}/gettext-runtime/intl/configure"
+    touch "${S}/gettext-runtime/intl/config.h.in"
+    touch "${S}/gettext-runtime/intl/Makefile.in"
+    touch "${B}/gettext-runtime/intl/config.status"
+    touch "${B}/gettext-runtime/intl/config.h"
+    touch "${B}/gettext-runtime/intl/Makefile"
+}
+
 do_install:append:libc-musl () {
 	rm -f ${D}${libdir}/charset.alias
 	rm -f ${D}${includedir}/libintl.h
Signature · 1 line
2.43.0