Configure fails with "crypt() not found" when building shadow-native on
hosts where libcrypt is no longer part of glibc and the libxcrypt
development files are not installed (e.g. fresh Ubuntu 24.04+, where
glibc 2.39 dropped libcrypt and libxcrypt-dev is not pulled in by
default).

virtual/crypt-native is in ASSUME_PROVIDED (meta/conf/bitbake.conf),
which is why a plain DEPENDS = "virtual/crypt" does not pull
libxcrypt-native into the native sysroot - the host is expected to
provide libcrypt. That assumption no longer holds on current
distributions.

A previous attempt to fix this by adding libxcrypt-native to DEPENDS
unconditionally (commit 65532fc751 "shadow: add libxcrypt-native
dependency") was reverted in 54eccb76eb because it incorrectly pulled
a -native recipe into the target build. Use class-specific overrides
so the target build is unaffected and only shadow-native (and
nativesdk-shadow) gain the explicit dependency on libxcrypt-native /
nativesdk-libxcrypt.

Signed-off-by: Igor Opaniuk <[email protected]>
---
 meta/recipes-extended/shadow/shadow_4.19.4.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-extended/shadow/shadow_4.19.4.bb 
b/meta/recipes-extended/shadow/shadow_4.19.4.bb
index 94f155641c..cc69864a2a 100644
--- a/meta/recipes-extended/shadow/shadow_4.19.4.bb
+++ b/meta/recipes-extended/shadow/shadow_4.19.4.bb
@@ -9,6 +9,8 @@ LIC_FILES_CHKSUM = 
"file://COPYING;md5=c9a450b7be84eac23e6353efecb60b5b \
                     "
 
 DEPENDS = "virtual/crypt"
+DEPENDS:append:class-native = " libxcrypt-native"
+DEPENDS:append:class-nativesdk = " nativesdk-libxcrypt"
 
 GITHUB_BASE_URI = "https://github.com/shadow-maint/shadow/releases";
 SRC_URI = "${GITHUB_BASE_URI}/download/${PV}/${BP}.tar.gz \
-- 
2.53.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#236551): 
https://lists.openembedded.org/g/openembedded-core/message/236551
Mute This Topic: https://lists.openembedded.org/mt/119185904/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to