From fafc6d2942c6fcc82c58b48fd4f1931786cd4ae9 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 24 Jun 2026 23:39:01 +0000 Subject: [PATCH] procmail: drop target-only libs from native autoconf.h probe do_configure generates autoconf.h by compiling and running a small lock-feature probe with the build-host compiler. The Makefile hardcodes the target networking libs (-lnet -lnsl, from the libnet/libnsl2 DEPENDS) into LDFLAGS, but those only exist in the target sysroot, so the native link fails with 'cannot find -lnet/-lnsl' The probe does not use them, so override LDFLAGS for this native step with just what it needs. Signed-off-by: Khem Raj --- meta-oe/recipes-support/procmail/procmail_3.24.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meta-oe/recipes-support/procmail/procmail_3.24.bb b/meta-oe/recipes-support/procmail/procmail_3.24.bb index 6767f87db6..01b48cd148 100644 --- a/meta-oe/recipes-support/procmail/procmail_3.24.bb +++ b/meta-oe/recipes-support/procmail/procmail_3.24.bb @@ -28,7 +28,13 @@ do_configure() { export CFLAGS="${BUILD_CFLAGS}" export AR="${BUILD_AR}" export AS="${BUILD_AS}" - oe_runmake TARGET_CFLAGS="$TARGET_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS0="${BUILD_LDFLAGS}" LOCKINGTEST=100 autoconf.h + # autoconf.h is generated by compiling and running a small lock-feature + # probe with the build-host compiler. The Makefile hardcodes the target + # networking libs (-lnet -lnsl, from the libnet/libnsl2 DEPENDS) into + # LDFLAGS, but those only exist in the target sysroot, so the native link + # fails with "cannot find -lnet/-lnsl". The probe does not use them, so + # override LDFLAGS for this native step with just what it needs. + oe_runmake TARGET_CFLAGS="$TARGET_CFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" LDFLAGS0="${BUILD_LDFLAGS}" LDFLAGS="${BUILD_LDFLAGS} -lm -ldl -lc" LOCKINGTEST=100 autoconf.h } do_compile() {