Skip to contentSkip to conversation

glibc: Move DISTRO_FEATURE specific do_install code for target recipe only

PATCH New Khem Raj 1 participant 2 messages Sep 15, 2019

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 glibc: Move DISTRO_FEATURE specific do_install code for target recipe only

nativesdk-glibc should be spared of recompile when the distro features are changed e.g. ldconfig is not in
DISTRO_FEATURES, this happens when sdk with musl and another one with glibc is built

Fixes
Variable do_install value changed:
...
-DISTRO_FEATURES{ldconfig} = Set
+DISTRO_FEATURES{ldconfig} = Unset

s

---
 meta/recipes-core/glibc/glibc-package.inc | 39 ++++++++++++-----------
 1 file changed, 20 insertions(+), 19 deletions(-)
meta/recipes-core/glibc/glibc-package.inc +20 -19
index 9b1e7b7903..2e8f9f3e02 100644
@@ -83,14 +83,6 @@ do_install_append () {
 		rm -f ${D}${infodir}/dir
 	fi
 
-	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
-		# The distro doesn't want these files so let's not install them
-		rm -f ${D}${sysconfdir}/ld.so.conf
-		rm -f ${D}${base_sbindir}/ldconfig
-		# This directory will be empty now so remove it too.
-		rmdir ${D}${sysconfdir}
-	fi
-
 	install -d ${D}${sysconfdir}/init.d
 	install -d ${D}${localstatedir}/db/nscd
 	install -m 0755 ${S}/nscd/nscd.init ${D}${sysconfdir}/init.d/nscd
@@ -102,6 +94,26 @@ do_install_append () {
 	install -d ${D}${systemd_unitdir}/system
 	install -m 0644 ${S}/nscd/nscd.service ${D}${systemd_unitdir}/system/
 
+	# The dynamic loader will have been installed into
+	# ${base_libdir}. However, if that isn't going to end up being
+	# available in the ABI-mandated location, then a symlink must
+        # be created.
+
+	if [ -n "${ARCH_DYNAMIC_LOADER}" -a ! -e "${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then
+		install -d ${D}${root_prefix}/lib
+		ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \
+				${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}
+	fi
+}
+
+do_install_append_class-target() {
+	if ! ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', 'true', 'false', d)}; then
+		# The distro doesn't want these files so let's not install them
+		rm -f ${D}${sysconfdir}/ld.so.conf
+		rm -f ${D}${base_sbindir}/ldconfig
+		# This directory will be empty now so remove it too.
+		rmdir ${D}${sysconfdir}
+	fi
 	if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
 		install -d ${D}${sysconfdir}/tmpfiles.d
 		echo "d /run/nscd 755 root root -" \
@@ -114,18 +126,7 @@ do_install_append () {
 			> ${D}${sysconfdir}/default/volatiles/98_nscd
 	fi
 
-	# The dynamic loader will have been installed into
-	# ${base_libdir}. However, if that isn't going to end up being
-	# available in the ABI-mandated location, then a symlink must
-        # be created.
-
-	if [ -n "${ARCH_DYNAMIC_LOADER}" -a ! -e "${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}" ]; then
-		install -d ${D}${root_prefix}/lib
-		ln -s ${@oe.path.relative('${root_prefix}/lib', '${base_libdir}')}/${ARCH_DYNAMIC_LOADER} \
-				${D}${root_prefix}/lib/${ARCH_DYNAMIC_LOADER}
-	fi
 }
-
 do_install_append_aarch64 () {
 	do_install_armmultilib
 }
Signature · 1 line
2.23.0
author
#1 lore raw

PATCH 2/2 populate_sdk_base.bbclass: nativesdk-glibc-locale is required on musl too

musl based extensible sdk fails to install

ERROR: OE-core's config sanity checker detected a potential misconfiguration.
Either fix the cause of this error or at your own risk disable the checker (see sanity.conf). Following is the list of potential problems / advisories:

Your system needs to support the en_US.UTF-8 locale.

The real reason is that its missing locale-archive in buildtools-tarball hence python3 from buildtools-tarball fails to run bitbake when installing esdk

---
 meta/classes/populate_sdk_base.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/classes/populate_sdk_base.bbclass +1 -1
index 59920a57a7..4e3794f75c 100644
@@ -63,7 +63,7 @@ python () {
 SDK_RDEPENDS = "${TOOLCHAIN_TARGET_TASK} ${TOOLCHAIN_HOST_TASK}"
 SDK_DEPENDS = "virtual/fakeroot-native ${SDK_ARCHIVE_DEPENDS} cross-localedef-native nativesdk-qemuwrapper-cross ${@' '.join(["%s-qemuwrapper-cross" % m for m in d.getVar("MULTILIB_VARIANTS").split()])} qemuwrapper-cross"
 PATH_prepend = "${STAGING_DIR_HOST}${SDKPATHNATIVE}${bindir}/crossscripts:${@":".join(all_multilib_tune_values(d, 'STAGING_BINDIR_CROSS').split())}:"
-SDK_DEPENDS_append_libc-glibc = " nativesdk-glibc-locale"
+SDK_DEPENDS += "nativesdk-glibc-locale"
 
 # We want the MULTIARCH_TARGET_SYS to point to the TUNE_PKGARCH, not PACKAGE_ARCH as it
 # could be set to the MACHINE_ARCH
Signature · 1 line
2.23.0