Skip to contentSkip to conversation

multilib.conf: overwrite conf files for debs

PATCH Applied Benjamin Bara 3 participants 6 messages Jan 8, 2025 – Mar 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 multilib.conf: overwrite conf files for debs

From: Benjamin Bara <[email protected]>

Similar to OPKG, overwrite conf files for APT (deb files).

---
 meta/conf/multilib.conf | 1 +
 1 file changed, 1 insertion(+)
meta/conf/multilib.conf +1 -0
index 7bdfcd56aa..979ae50c72 100644
@@ -21,6 +21,7 @@ BBCLASSEXTEND:append = " ${MULTILIBS}"
 MULTILIB_GLOBAL_VARIANTS ?= "lib32 lib64 libx32"
 
 OPKG_ARGS:append = " --force-maintainer --force-overwrite"
+APT_ARGS:append = " -o Dpkg::Options::=--force-confnew -o Dpkg::Options::=--force-overwrite"
 
 # These recipes don't need multilib variants, the ${BPN} PROVDES/RPROVDES
 # ${MLPREFIX}${BPN}
Signature · 1 line
2.47.1
#1 lore raw

PATCH 2/4 glibc: set ld.so.conf as conf file

From: Benjamin Bara <[email protected]>

This enables simple overwriting when multilib is in use.

---
 meta/recipes-core/glibc/glibc-package.inc | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-core/glibc/glibc-package.inc +1 -0
index 3352f3e2f5..ad34b87929 100644
@@ -26,6 +26,7 @@ INSANE_SKIP:${PN}-dev += "staticdev"
 INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so libdir"
 
 FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf"
+CONFFILES:${PN} = "${sysconfdir}/ld.so.conf"
 RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"
 FILES:ldconfig = "${base_sbindir}/ldconfig"
 FILES:ldd = "${bindir}/ldd"
Signature · 1 line
2.47.1
#2 lore raw

PATCH 3/4 glibc-package: move ldconfig to ML-specific file

In reply to Benjamin Bara

From: Benjamin Bara <[email protected]>

Otherwise, installing ldconfig via multilib results in overwriting.

---
 meta/recipes-core/glibc/glibc-package.inc | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +2 -1
index ad34b87929..1e7f3753c2 100644
@@ -28,7 +28,7 @@ INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so libdir"
 FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf"
 CONFFILES:${PN} = "${sysconfdir}/ld.so.conf"
 RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"
-FILES:ldconfig = "${base_sbindir}/ldconfig"
+FILES:ldconfig = "${base_sbindir}/${MLPREFIX}ldconfig"
 FILES:ldd = "${bindir}/ldd"
 FILES:ldso = "${bindir}/${MLPREFIX}ld.so"
 FILES:libmemusage = "${base_libdir}/libmemusage.so"
@@ -123,6 +123,7 @@ do_install() {
         ln -rs ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so
         if [ -n "${MLPREFIX}" ]; then
                 mv ${D}${bindir}/ld.so ${D}${bindir}/${MLPREFIX}ld.so
+                mv ${D}${base_sbindir}/ldconfig ${D}${base_sbindir}/${MLPREFIX}ldconfig
         fi
 }
 
Signature · 1 line
2.47.1
#3 lore raw

Re: [OE-core] [PATCH 3/4] glibc-package: move ldconfig to ML-specific file

Quoted 23 lines · Benjamin Bara via lists.openembedded.org

From: Benjamin Bara <[email protected]>

Otherwise, installing ldconfig via multilib results in overwriting.

---
 meta/recipes-core/glibc/glibc-package.inc | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +0 -0
index ad34b87929..1e7f3753c2 100644
@@ -28,7 +28,7 @@ INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so libdir"

 FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf" CONFFILES:${PN} = "${sysconfdir}/ld.so.conf"
 RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"

meta/recipes-core/glibc/glibc-package.inc +1 -1
-FILES:ldconfig = "${base_sbindir}/ldconfig"
+FILES:ldconfig = "${base_sbindir}/${MLPREFIX}ldconfig"

 FILES:ldd = "${bindir}/ldd"
 FILES:ldso = "${bindir}/${MLPREFIX}ld.so" FILES:libmemusage = "${base_libdir}/libmemusage.so"

meta/recipes-core/glibc/glibc-package.inc +0 -0
@@ -123,6 +123,7 @@ do_install() {
Quoted 6 lines

         ln -rs ${D}${base_libdir}/librt.so.1 ${D}${libdir}/librt.so
         if [ -n "${MLPREFIX}" ]; then
                 mv ${D}${bindir}/ld.so ${D}${bindir}/${MLPREFIX}ld.so
+                mv ${D}${base_sbindir}/ldconfig ${D}${base_sbindir}/${MLPREFIX}ldconfig fi
 }

I'm a bit puzzled by what would use this in real world use. Do you have systems where you have two different ld caches? Can our postinst code call the right prefixed ldconfig binaries?

I merged the other patches in the series, thanks.

Cheers,

Richard

#4 lore raw

Re: [OE-core] [PATCH 3/4] glibc-package: move ldconfig to ML-specific file

Hi Richard!

Thanks for your feedback and sorry for the late response.

Quoted 33 lines · Richard Purdie
Quoted 31 lines · Benjamin Bara via lists.openembedded.org

From: Benjamin Bara <[email protected]>

Otherwise, installing ldconfig via multilib results in overwriting.

---
 meta/recipes-core/glibc/glibc-package.inc | 3 ++-

 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-core/glibc/glibc-package.inc +0 -0
index ad34b87929..1e7f3753c2 100644
@@ -28,7 +28,7 @@ INSANE_SKIP:${MLPREFIX}ldso:append = " dev-so

libdir"
 FILES:${PN} = "${libc_baselibs} ${libexecdir}/* ${sysconfdir}/ld.so.conf"
 CONFFILES:${PN} = "${sysconfdir}/ld.so.conf" RRECOMMENDS:${PN} = "${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)}"

meta/recipes-core/glibc/glibc-package.inc +1 -1
-FILES:ldconfig = "${base_sbindir}/ldconfig"
+FILES:ldconfig = "${base_sbindir}/${MLPREFIX}ldconfig"

 FILES:ldd = "${bindir}/ldd"
 FILES:ldso = "${bindir}/${MLPREFIX}ld.so" FILES:libmemusage = "${base_libdir}/libmemusage.so"

meta/recipes-core/glibc/glibc-package.inc +0 -0
@@ -123,6 +123,7 @@ do_install() {

         ln -rs ${D}${base_libdir}/librt.so.1
${D}${libdir}/librt.so
         if [ -n "${MLPREFIX}" ]; then
                 mv ${D}${bindir}/ld.so

Quoted 8 lines
Quoted 5 lines

${D}${bindir}/${MLPREFIX}ld.so
+                mv ${D}${base_sbindir}/ldconfig
${D}${base_sbindir}/${MLPREFIX}ldconfig
         fi
 }

I'm a bit puzzled by what would use this in real world use. Do you have systems where you have two different ld caches?

I haven't. My problem is that lib32-ldconfig is pulled in as a runtime dependency (I think by dpkg; it isn't visible in the task-depends.dot but during my tests I just added lib32-glibc so the possibilities where it could come from are quite limited). This leads to a clash during dpkg installation, because there are two /usr/bin/ldconfigs to install.

Unfortunately, I am not sure how to deal with this situation "correctly". In fact, I think what I want to have is a single NON-ML ldconfig binary which also considers the ML paths. ldconfig-native is doing something similar with hardcoded paths[1], and I think something like that might also be needed for a correctly working ${MLPREFIX}ldconfig. But probably I am wrong - I am quite inexperienced when it comes to multilib environments or ld.so and its caching...

Quoted 1 line

Can our postinst code call the right prefixed ldconfig binaries?

It just calls the NON-ML ldconfig one, which doesn't consider the ML libraries. However, when calling the other, the non-ML libraries are removed - so not really an ideal situation.

Thanks & kind regards
Benjamin

[1]
https://git.openembedded.org/openembedded-core/tree/meta/recipes-core/glibc/ldconfig-native-2.12.1/ldconfig-default-to-all-multilib-dirs.patch?h=yocto-5.0.7

#5 lore raw

PATCH 4/4 multilib-example.conf: explicitly overwrite the BASELIB

In reply to Benjamin Bara

From: Benjamin Bara <[email protected]>

Currently, meta/conf/machine/include/x86/arch-x86.inc sets the BASE_LIB for tune-x86 to "lib". Instead, explicitly overwrite the BASELIB to better showcase what is happening inside.

---
 meta-skeleton/conf/multilib-example.conf | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
meta-skeleton/conf/multilib-example.conf +3 -2
index 07fd7b6ce4..cddbfc17ae 100644
@@ -3,11 +3,12 @@
 # or specific in an configuration file like this, then require it.
 #
 # This configuration specifies an x86 64 bit machine as the main machine
-# type and then adds a multilib in the "lib32" directory where those
-# libraries are compiled with the "x86" tune.
+# type and then adds a multilib in the explicitly overwritten "lib32" directory
+# where those libraries are compiled with the "x86" tune.
 #
 
 MACHINE = "qemux86-64"
 require conf/multilib.conf
 MULTILIBS = "multilib:lib32"
 DEFAULTTUNE:virtclass-multilib-lib32 = "x86"
+BASELIB:virtclass-multilib-lib32 = "lib32"
Signature · 1 line
2.47.1