* [PATCH 0/3] external-arm-toolchain: fix build when usrmege enabled
@ 2024-04-17 11:30 Vasyl Vavrychuk
2024-04-17 11:30 ` [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check Vasyl Vavrychuk
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Vasyl Vavrychuk @ 2024-04-17 11:30 UTC (permalink / raw)
To: Ross Burton, Denys Dmytriyenko, meta-arm; +Cc: Vasyl Vavrychuk
Vasyl Vavrychuk (3):
external-arm-toolchain: wrap base_libdir vs libdir manipulations under
usrmerge check
external-arm-toolchain: in libc.so GNU ld script use base_libdir
external-arm-toolchain: remove ${base_libdir}/libpthread*.so from
FILES:${PN}
.../external-arm-toolchain.bb | 67 ++++++++++---------
1 file changed, 34 insertions(+), 33 deletions(-)
--
2.40.0
^ permalink raw reply [flat|nested] 12+ messages in thread* [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check 2024-04-17 11:30 [PATCH 0/3] external-arm-toolchain: fix build when usrmege enabled Vasyl Vavrychuk @ 2024-04-17 11:30 ` Vasyl Vavrychuk 2024-04-17 20:06 ` [meta-arm] " Denys Dmytriyenko 2024-04-17 11:30 ` [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir Vasyl Vavrychuk 2024-04-17 11:30 ` [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} Vasyl Vavrychuk 2 siblings, 1 reply; 12+ messages in thread From: Vasyl Vavrychuk @ 2024-04-17 11:30 UTC (permalink / raw) To: Ross Burton, Denys Dmytriyenko, meta-arm; +Cc: Vasyl Vavrychuk With `usrmerge` disto feature `base_libdir` and `libdir` are the same, so it does not make sense to: * removing "duplicates" between them * move files from `base_libdir` to `libdir` This fixes build error | mv: '.../tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/external-arm-toolchain/12.2.Rel1/image/usr/lib/libasan.a' and '.../tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/external-arm-toolchain/12.2.Rel1/image/usr/lib/libasan.a' are the same file in case of `usrmerge` feature enabled. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> --- .../external-arm-toolchain.bb | 62 ++++++++++--------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb index fab17611..27aadffd 100644 --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb @@ -135,37 +135,39 @@ do_install() { ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so ln -sf ../../lib/libc_malloc_debug.so.0 ${D}${libdir}/libc_malloc_debug.so - # remove potential .so duplicates from base_libdir - # for all symlinks created above in libdir - rm -f ${D}${base_libdir}/librt.so - rm -f ${D}${base_libdir}/libcrypt.so - rm -f ${D}${base_libdir}/libresolv.so - rm -f ${D}${base_libdir}/libnss_hesiod.so - rm -f ${D}${base_libdir}/libutil.so - rm -f ${D}${base_libdir}/libBrokenLocale.so - rm -f ${D}${base_libdir}/libpthread.so - rm -f ${D}${base_libdir}/libthread_db.so - rm -f ${D}${base_libdir}/libanl.so - rm -f ${D}${base_libdir}/libdl.so - rm -f ${D}${base_libdir}/libnss_db.so - rm -f ${D}${base_libdir}/libnss_dns.so - rm -f ${D}${base_libdir}/libnss_files.so - rm -f ${D}${base_libdir}/libnss_compat.so - rm -f ${D}${base_libdir}/libm.so - - # Move these completely to ${libdir} and delete duplicates in ${base_libdir} - for lib in asan hwasan atomic gfortran gomp itm lsan sanitizer stdc++ tsan ubsan; do - if [ -e ${D}${base_libdir}/lib${lib}.spec ] ; then - mv ${D}${base_libdir}/lib${lib}.spec ${D}${libdir} - fi - if [ -e ${D}${base_libdir}/lib${lib}.a ] ; then - mv ${D}${base_libdir}/lib${lib}.a ${D}${libdir} - fi - rm -f ${D}${base_libdir}/lib${lib}* - done + if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'false', 'true', d)}; then + # remove potential .so duplicates from base_libdir + # for all symlinks created above in libdir + rm -f ${D}${base_libdir}/librt.so + rm -f ${D}${base_libdir}/libcrypt.so + rm -f ${D}${base_libdir}/libresolv.so + rm -f ${D}${base_libdir}/libnss_hesiod.so + rm -f ${D}${base_libdir}/libutil.so + rm -f ${D}${base_libdir}/libBrokenLocale.so + rm -f ${D}${base_libdir}/libpthread.so + rm -f ${D}${base_libdir}/libthread_db.so + rm -f ${D}${base_libdir}/libanl.so + rm -f ${D}${base_libdir}/libdl.so + rm -f ${D}${base_libdir}/libnss_db.so + rm -f ${D}${base_libdir}/libnss_dns.so + rm -f ${D}${base_libdir}/libnss_files.so + rm -f ${D}${base_libdir}/libnss_compat.so + rm -f ${D}${base_libdir}/libm.so + + # Move these completely to ${libdir} and delete duplicates in ${base_libdir} + for lib in asan hwasan atomic gfortran gomp itm lsan sanitizer stdc++ tsan ubsan; do + if [ -e ${D}${base_libdir}/lib${lib}.spec ] ; then + mv ${D}${base_libdir}/lib${lib}.spec ${D}${libdir} + fi + if [ -e ${D}${base_libdir}/lib${lib}.a ] ; then + mv ${D}${base_libdir}/lib${lib}.a ${D}${libdir} + fi + rm -f ${D}${base_libdir}/lib${lib}* + done - # Clean up duplicate libs that are both in base_libdir and libdir - rm -f ${D}${libdir}/libgcc* + # Clean up duplicate libs that are both in base_libdir and libdir + rm -f ${D}${libdir}/libgcc* + fi # Besides ld-${EAT_VER_LIBC}.so, other libs can have duplicates like lib*-${EAT_VER_LIBC}.so # Only remove them if both are regular files and are identical -- 2.40.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check 2024-04-17 11:30 ` [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check Vasyl Vavrychuk @ 2024-04-17 20:06 ` Denys Dmytriyenko 0 siblings, 0 replies; 12+ messages in thread From: Denys Dmytriyenko @ 2024-04-17 20:06 UTC (permalink / raw) To: Vasyl Vavrychuk; +Cc: Ross Burton, Denys Dmytriyenko, meta-arm On Wed, Apr 17, 2024 at 02:30:40PM +0300, Vasyl Vavrychuk wrote: > With `usrmerge` disto feature `base_libdir` and `libdir` are the same, > so it does not make sense to: > > * removing "duplicates" between them > * move files from `base_libdir` to `libdir` > > This fixes build error > > | mv: '.../tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/external-arm-toolchain/12.2.Rel1/image/usr/lib/libasan.a' and '.../tmp/work/cortexa15t2hf-neon-poky-linux-gnueabi/external-arm-toolchain/12.2.Rel1/image/usr/lib/libasan.a' are the same file > > in case of `usrmerge` feature enabled. > > Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> Acked-by: Denys Dmytriyenko <denys@konsulko.com> > --- > .../external-arm-toolchain.bb | 62 ++++++++++--------- > 1 file changed, 32 insertions(+), 30 deletions(-) > > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > index fab17611..27aadffd 100644 > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > @@ -135,37 +135,39 @@ do_install() { > ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so > ln -sf ../../lib/libc_malloc_debug.so.0 ${D}${libdir}/libc_malloc_debug.so > > - # remove potential .so duplicates from base_libdir > - # for all symlinks created above in libdir > - rm -f ${D}${base_libdir}/librt.so > - rm -f ${D}${base_libdir}/libcrypt.so > - rm -f ${D}${base_libdir}/libresolv.so > - rm -f ${D}${base_libdir}/libnss_hesiod.so > - rm -f ${D}${base_libdir}/libutil.so > - rm -f ${D}${base_libdir}/libBrokenLocale.so > - rm -f ${D}${base_libdir}/libpthread.so > - rm -f ${D}${base_libdir}/libthread_db.so > - rm -f ${D}${base_libdir}/libanl.so > - rm -f ${D}${base_libdir}/libdl.so > - rm -f ${D}${base_libdir}/libnss_db.so > - rm -f ${D}${base_libdir}/libnss_dns.so > - rm -f ${D}${base_libdir}/libnss_files.so > - rm -f ${D}${base_libdir}/libnss_compat.so > - rm -f ${D}${base_libdir}/libm.so > - > - # Move these completely to ${libdir} and delete duplicates in ${base_libdir} > - for lib in asan hwasan atomic gfortran gomp itm lsan sanitizer stdc++ tsan ubsan; do > - if [ -e ${D}${base_libdir}/lib${lib}.spec ] ; then > - mv ${D}${base_libdir}/lib${lib}.spec ${D}${libdir} > - fi > - if [ -e ${D}${base_libdir}/lib${lib}.a ] ; then > - mv ${D}${base_libdir}/lib${lib}.a ${D}${libdir} > - fi > - rm -f ${D}${base_libdir}/lib${lib}* > - done > + if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'false', 'true', d)}; then > + # remove potential .so duplicates from base_libdir > + # for all symlinks created above in libdir > + rm -f ${D}${base_libdir}/librt.so > + rm -f ${D}${base_libdir}/libcrypt.so > + rm -f ${D}${base_libdir}/libresolv.so > + rm -f ${D}${base_libdir}/libnss_hesiod.so > + rm -f ${D}${base_libdir}/libutil.so > + rm -f ${D}${base_libdir}/libBrokenLocale.so > + rm -f ${D}${base_libdir}/libpthread.so > + rm -f ${D}${base_libdir}/libthread_db.so > + rm -f ${D}${base_libdir}/libanl.so > + rm -f ${D}${base_libdir}/libdl.so > + rm -f ${D}${base_libdir}/libnss_db.so > + rm -f ${D}${base_libdir}/libnss_dns.so > + rm -f ${D}${base_libdir}/libnss_files.so > + rm -f ${D}${base_libdir}/libnss_compat.so > + rm -f ${D}${base_libdir}/libm.so > + > + # Move these completely to ${libdir} and delete duplicates in ${base_libdir} > + for lib in asan hwasan atomic gfortran gomp itm lsan sanitizer stdc++ tsan ubsan; do > + if [ -e ${D}${base_libdir}/lib${lib}.spec ] ; then > + mv ${D}${base_libdir}/lib${lib}.spec ${D}${libdir} > + fi > + if [ -e ${D}${base_libdir}/lib${lib}.a ] ; then > + mv ${D}${base_libdir}/lib${lib}.a ${D}${libdir} > + fi > + rm -f ${D}${base_libdir}/lib${lib}* > + done > > - # Clean up duplicate libs that are both in base_libdir and libdir > - rm -f ${D}${libdir}/libgcc* > + # Clean up duplicate libs that are both in base_libdir and libdir > + rm -f ${D}${libdir}/libgcc* > + fi > > # Besides ld-${EAT_VER_LIBC}.so, other libs can have duplicates like lib*-${EAT_VER_LIBC}.so > # Only remove them if both are regular files and are identical > -- > 2.40.0 ^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-17 11:30 [PATCH 0/3] external-arm-toolchain: fix build when usrmege enabled Vasyl Vavrychuk 2024-04-17 11:30 ` [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check Vasyl Vavrychuk @ 2024-04-17 11:30 ` Vasyl Vavrychuk 2024-04-17 20:12 ` [meta-arm] " Denys Dmytriyenko 2024-04-17 11:30 ` [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} Vasyl Vavrychuk 2 siblings, 1 reply; 12+ messages in thread From: Vasyl Vavrychuk @ 2024-04-17 11:30 UTC (permalink / raw) To: Ross Burton, Denys Dmytriyenko, meta-arm; +Cc: Vasyl Vavrychuk `base_libdir` gets replaced with `/lib` or `/usr/lib` depending on `usrmerge` distro feature. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> --- .../external-arm-toolchain/external-arm-toolchain.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb index 27aadffd..ab608128 100644 --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb @@ -207,9 +207,9 @@ do_install() { rm -rf ${D}${includedir}/rpcsvc/rquota.* if [ -f ${D}${libdir}/libc.so ];then - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so sed -i -e "s# /${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" ${D}${libdir}/libc.so - sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so + sed -i -e "s# /lib# ../../${base_libdir}#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so fi if [ -f ${D}${base_libdir}/libc.so ];then -- 2.40.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-17 11:30 ` [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir Vasyl Vavrychuk @ 2024-04-17 20:12 ` Denys Dmytriyenko 2024-04-18 13:54 ` Vasyl Vavrychuk 0 siblings, 1 reply; 12+ messages in thread From: Denys Dmytriyenko @ 2024-04-17 20:12 UTC (permalink / raw) To: Vasyl Vavrychuk; +Cc: Ross Burton, Denys Dmytriyenko, meta-arm On Wed, Apr 17, 2024 at 02:30:41PM +0300, Vasyl Vavrychuk wrote: > `base_libdir` gets replaced with `/lib` or `/usr/lib` depending on > `usrmerge` distro feature. > > Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> > --- > .../external-arm-toolchain/external-arm-toolchain.bb | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > index 27aadffd..ab608128 100644 > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > @@ -207,9 +207,9 @@ do_install() { > rm -rf ${D}${includedir}/rpcsvc/rquota.* > > if [ -f ${D}${libdir}/libc.so ];then > - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so > + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so Here ^^^ it's not clear why only the last of the sed replacements gets updated, not all of them? > sed -i -e "s# /${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" ${D}${libdir}/libc.so > - sed -i -e "s# /lib# ../../lib#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so > + sed -i -e "s# /lib# ../../${base_libdir}#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so > fi > > if [ -f ${D}${base_libdir}/libc.so ];then > -- > 2.40.0 > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-17 20:12 ` [meta-arm] " Denys Dmytriyenko @ 2024-04-18 13:54 ` Vasyl Vavrychuk 2024-04-18 15:57 ` Denys Dmytriyenko 0 siblings, 1 reply; 12+ messages in thread From: Vasyl Vavrychuk @ 2024-04-18 13:54 UTC (permalink / raw) To: Denys Dmytriyenko; +Cc: Ross Burton, Denys Dmytriyenko, meta-arm On Wed, Apr 17, 2024 at 11:12 PM Denys Dmytriyenko <denis@denix.org> wrote: > > On Wed, Apr 17, 2024 at 02:30:41PM +0300, Vasyl Vavrychuk wrote: > > - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so > > + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so > > Here ^^^ it's not clear why only the last of the sed replacements gets > updated, not all of them? 1. `/${EAT_LIBDIR}/${EAT_TARGET_SYS}` path is not used in libc.so in Arm GNU Toolchain v13.2.Rel1 in targets "arm-none-linux-gnueabihf" and "aarch64-none-linux-gnu". I am not sure in which versions for ARM or Linaro toolchain this path was used in libc.so. Should I replace it blindly? 2. Rest two expressions replace input string to "/usr/lib" or ".", so they are not affected by usrmerge. ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-18 13:54 ` Vasyl Vavrychuk @ 2024-04-18 15:57 ` Denys Dmytriyenko 2024-04-29 13:54 ` Jon Mason 2024-05-24 11:19 ` Parthiban 0 siblings, 2 replies; 12+ messages in thread From: Denys Dmytriyenko @ 2024-04-18 15:57 UTC (permalink / raw) To: Vasyl Vavrychuk; +Cc: Ross Burton, Denys Dmytriyenko, meta-arm On Thu, Apr 18, 2024 at 04:54:05PM +0300, Vasyl Vavrychuk wrote: > On Wed, Apr 17, 2024 at 11:12 PM Denys Dmytriyenko <denis@denix.org> wrote: > > > > On Wed, Apr 17, 2024 at 02:30:41PM +0300, Vasyl Vavrychuk wrote: > > > - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so > > > + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so > > > > Here ^^^ it's not clear why only the last of the sed replacements gets > > updated, not all of them? > > 1. `/${EAT_LIBDIR}/${EAT_TARGET_SYS}` path is not used in libc.so in > Arm GNU Toolchain v13.2.Rel1 in targets "arm-none-linux-gnueabihf" and > "aarch64-none-linux-gnu". I am not sure in which versions for ARM or > Linaro toolchain this path was used in libc.so. Should I replace it > blindly? Yeah, this list has grown with different versions of the toolchain, where almost every new version required a slightly different adjustment in the past. And the external toolchain recipe was always trying to be version agnostic and work with a wide range of toolchain versions. But I guess we could simplify the list of supported versions to what is currently available for download - I see that 11.x and 12.x are supported now. Can you please check if libc.so is the same in those versions? If so, we can potentially drop all other sed mods from here. Thanks. > 2. Rest two expressions replace input string to "/usr/lib" or ".", so > they are not affected by usrmerge. -- Denys ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-18 15:57 ` Denys Dmytriyenko @ 2024-04-29 13:54 ` Jon Mason 2024-08-30 15:57 ` Romain Naour 2024-05-24 11:19 ` Parthiban 1 sibling, 1 reply; 12+ messages in thread From: Jon Mason @ 2024-04-29 13:54 UTC (permalink / raw) To: Denys Dmytriyenko Cc: Vasyl Vavrychuk, Ross Burton, Denys Dmytriyenko, meta-arm On Thu, Apr 18, 2024 at 11:57:38AM -0400, Denys Dmytriyenko wrote: > On Thu, Apr 18, 2024 at 04:54:05PM +0300, Vasyl Vavrychuk wrote: > > On Wed, Apr 17, 2024 at 11:12 PM Denys Dmytriyenko <denis@denix.org> wrote: > > > > > > On Wed, Apr 17, 2024 at 02:30:41PM +0300, Vasyl Vavrychuk wrote: > > > > - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so > > > > + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so > > > > > > Here ^^^ it's not clear why only the last of the sed replacements gets > > > updated, not all of them? > > > > 1. `/${EAT_LIBDIR}/${EAT_TARGET_SYS}` path is not used in libc.so in > > Arm GNU Toolchain v13.2.Rel1 in targets "arm-none-linux-gnueabihf" and > > "aarch64-none-linux-gnu". I am not sure in which versions for ARM or > > Linaro toolchain this path was used in libc.so. Should I replace it > > blindly? > > Yeah, this list has grown with different versions of the toolchain, where > almost every new version required a slightly different adjustment in the > past. > > And the external toolchain recipe was always trying to be version agnostic > and work with a wide range of toolchain versions. > > But I guess we could simplify the list of supported versions to what is > currently available for download - I see that 11.x and 12.x are supported > now. > > Can you please check if libc.so is the same in those versions? If so, we > can potentially drop all other sed mods from here. Thanks. meta-arm is going to release very, very soon. If this series should go in, then this needs to get wrapped up ASAP. Vasyl, can you check about libc.so (per Denys's question/comment above, and possibly do another version if his suggestion is correct)? Thanks, Jon > > > > 2. Rest two expressions replace input string to "/usr/lib" or ".", so > > they are not affected by usrmerge. > > -- > Denys > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-29 13:54 ` Jon Mason @ 2024-08-30 15:57 ` Romain Naour 0 siblings, 0 replies; 12+ messages in thread From: Romain Naour @ 2024-08-30 15:57 UTC (permalink / raw) To: Jon Mason, Denys Dmytriyenko Cc: Vasyl Vavrychuk, Ross Burton, Denys Dmytriyenko, meta-arm Hello, Le 29/04/2024 à 15:54, Jon Mason a écrit : > On Thu, Apr 18, 2024 at 11:57:38AM -0400, Denys Dmytriyenko wrote: >> On Thu, Apr 18, 2024 at 04:54:05PM +0300, Vasyl Vavrychuk wrote: >>> On Wed, Apr 17, 2024 at 11:12 PM Denys Dmytriyenko <denis@denix.org> wrote: >>>> >>>> On Wed, Apr 17, 2024 at 02:30:41PM +0300, Vasyl Vavrychuk wrote: >>>>> - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${EAT_LIBDIR}/ld-linux#g" ${D}${libdir}/libc.so >>>>> + sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so >>>> >>>> Here ^^^ it's not clear why only the last of the sed replacements gets >>>> updated, not all of them? >>> >>> 1. `/${EAT_LIBDIR}/${EAT_TARGET_SYS}` path is not used in libc.so in >>> Arm GNU Toolchain v13.2.Rel1 in targets "arm-none-linux-gnueabihf" and >>> "aarch64-none-linux-gnu". I am not sure in which versions for ARM or >>> Linaro toolchain this path was used in libc.so. Should I replace it >>> blindly? >> >> Yeah, this list has grown with different versions of the toolchain, where >> almost every new version required a slightly different adjustment in the >> past. >> >> And the external toolchain recipe was always trying to be version agnostic >> and work with a wide range of toolchain versions. >> >> But I guess we could simplify the list of supported versions to what is >> currently available for download - I see that 11.x and 12.x are supported >> now. >> >> Can you please check if libc.so is the same in those versions? If so, we >> can potentially drop all other sed mods from here. Thanks. > > meta-arm is going to release very, very soon. If this series should > go in, then this needs to get wrapped up ASAP. > > Vasyl, can you check about libc.so (per Denys's question/comment > above, and possibly do another version if his suggestion is correct)? There is a new TI SDK release based on Yocto-Scarthgap [1][2] and the external-arm-toolchain doesn't work due usrmerge nowaday required by systemd. I applied this series but there is still an issue with the meson-qemuwrapper: qemu-aarch64: Could not open '/lib/ld-linux-aarch64.so.1': No such file or directory Indeed ld-linux-aarch64.so.1 is under /usr/lib: lmsensors-config/1.0/recipe-sysroot/usr/lib/ld-linux-aarch64.so.1 ^^^^^^^^ [1] https://www.ti.com/tool/download/PROCESSOR-SDK-LINUX-SK-TDA4VM/10.00.00.08 [2] https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-sk-tda4vm/10_00_00/exports/edgeai-docs/devices/TDA4VM/linux/release_notes_10_00.html#new-in-this-release Best regards, Romain > > Thanks, > Jon > >> >> >>> 2. Rest two expressions replace input string to "/usr/lib" or ".", so >>> they are not affected by usrmerge. >> >> -- >> Denys >> > > ^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir 2024-04-18 15:57 ` Denys Dmytriyenko 2024-04-29 13:54 ` Jon Mason @ 2024-05-24 11:19 ` Parthiban 1 sibling, 0 replies; 12+ messages in thread From: Parthiban @ 2024-05-24 11:19 UTC (permalink / raw) To: meta-arm [-- Attachment #1: Type: text/plain, Size: 998 bytes --] Thanks for pointing to this thread from https://lists.yoctoproject.org/g/meta-arm/message/5764 I have tried applying this patch series and it failed in other places. Specifically libm.a, libm.so LD script paths. I have tried adjusting them (attached the diff) and also few changes related to symbolic links (which was dead one). But still the compilation failed with | ../git/meson.build:3:0: ERROR: Executables created by c compiler aarch64-none-linux-gnu-gcc -mcpu=cortex-a53+crc -mbranch-protection=standard -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security --sysroot=build/tmp/work/cortexa53-poky-linux/systemd/255.4/recipe-sysroot are not runnable. | | A full log can be found atbuild/tmp/work/cortexa53-poky-linux/systemd/255.4/build/meson-logs/meson-log.txt for packages like systemd, glib. Underlying error is still not clear to me. Is this related to multilib support in the external toolchain? Many thanks, Parthiban N [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: aarch64.patch --] [-- Type: text/x-patch; name="aarch64.patch", Size: 5228 bytes --] diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb index 279ddffa..233dba5e 100644 --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb @@ -57,6 +57,15 @@ BINV = "${EAT_VER_GCC}" SRC_URI = "file://SUPPORTED" +# /lib || /lib64 || /usr/lib64 ->/usr/lib +update_ld_script_path() { + if [ -f $1 ];then + sed -i -e "s# /lib/# ${base_libdir}/#g" $1 + sed -i -e "s# /lib64/# ${base_libdir}/#g" $1 + sed -i -e "s# /usr/lib64/# ${base_libdir}/#g" $1 + fi +} + do_install() { # Add stubs for files OE-core expects install -d ${S}/nscd/ @@ -118,24 +127,25 @@ do_install() { else cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/lib/${linker_name} ${D}${base_libdir}/ fi - ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so - ln -sf ../../lib/libcrypt.so.1 ${D}${libdir}/libcrypt.so - ln -sf ../../lib/libresolv.so.2 ${D}${libdir}/libresolv.so - ln -sf ../../lib/libnss_hesiod.so.2 ${D}${libdir}/libnss_hesiod.so - ln -sf ../../lib/libutil.so.1 ${D}${libdir}/libutil.so - ln -sf ../../lib/libBrokenLocale.so.1 ${D}${libdir}/libBrokenLocale.so - ln -sf ../../lib/libpthread.so.0 ${D}${libdir}/libpthread.so - ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db.so - ln -sf ../../lib/libanl.so.1 ${D}${libdir}/libanl.so - ln -sf ../../lib/libdl.so.2 ${D}${libdir}/libdl.so - ln -sf ../../lib/libnss_db.so.2 ${D}${libdir}/libnss_db.so - ln -sf ../../lib/libnss_dns.so.2 ${D}${libdir}/libnss_dns.so - ln -sf ../../lib/libnss_files.so.2 ${D}${libdir}/libnss_files.so - ln -sf ../../lib/libnss_compat.so.2 ${D}${libdir}/libnss_compat.so - ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so - ln -sf ../../lib/libc_malloc_debug.so.0 ${D}${libdir}/libc_malloc_debug.so if ${@bb.utils.contains('DISTRO_FEATURES', 'usrmerge', 'false', 'true', d)}; then + ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so + ln -sf ../../lib/libcrypt.so.1 ${D}${libdir}/libcrypt.so + ln -sf ../../lib/libresolv.so.2 ${D}${libdir}/libresolv.so + ln -sf ../../lib/libnss_hesiod.so.2 ${D}${libdir}/libnss_hesiod.so + ln -sf ../../lib/libutil.so.1 ${D}${libdir}/libutil.so + ln -sf ../../lib/libBrokenLocale.so.1 ${D}${libdir}/libBrokenLocale.so + ln -sf ../../lib/libpthread.so.0 ${D}${libdir}/libpthread.so + ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db.so + ln -sf ../../lib/libanl.so.1 ${D}${libdir}/libanl.so + ln -sf ../../lib/libdl.so.2 ${D}${libdir}/libdl.so + ln -sf ../../lib/libnss_db.so.2 ${D}${libdir}/libnss_db.so + ln -sf ../../lib/libnss_dns.so.2 ${D}${libdir}/libnss_dns.so + ln -sf ../../lib/libnss_files.so.2 ${D}${libdir}/libnss_files.so + ln -sf ../../lib/libnss_compat.so.2 ${D}${libdir}/libnss_compat.so + ln -sf ../../lib/libm.so.6 ${D}${libdir}/libm.so + ln -sf ../../lib/libc_malloc_debug.so.0 ${D}${libdir}/libc_malloc_debug.so + # remove potential .so duplicates from base_libdir # for all symlinks created above in libdir rm -f ${D}${base_libdir}/librt.so @@ -167,6 +177,16 @@ do_install() { # Clean up duplicate libs that are both in base_libdir and libdir rm -f ${D}${libdir}/libgcc* + else + ln -sf libc_malloc_debug.so.0 ${D}${libdir}/libc_malloc_debug.so + ln -sf libthread_db.so.1 ${D}${libdir}/libthread_db.so + ln -sf libmvec.so.1 ${D}${libdir}/libmvec.so + ln -sf libcrypt.so.1 ${D}${libdir}/libcrypt.so + ln -sf libresolv.so.2 ${D}${libdir}/libresolv.so + ln -sf libnss_hesiod.so.2 ${D}${libdir}/libnss_hesiod.so + ln -sf libnss_db.so.2 ${D}${libdir}/libnss_db.so + ln -sf libnss_compat.so.2 ${D}${libdir}/libnss_compat.so + ln -sf libanl.so.1 ${D}${libdir}/libanl.so fi # Besides ld-${EAT_VER_LIBC}.so, other libs can have duplicates like lib*-${EAT_VER_LIBC}.so @@ -206,18 +226,10 @@ do_install() { # Provided by quota rm -rf ${D}${includedir}/rpcsvc/rquota.* - if [ -f ${D}${libdir}/libc.so ];then - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../${EAT_LIBDIR}#g" -e "s# /usr/${EAT_LIBDIR}/# /usr/lib/#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/ld-linux# ../../${base_libdir}/ld-linux#g" ${D}${libdir}/libc.so - sed -i -e "s# /${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" ${D}${libdir}/libc.so - sed -i -e "s# /lib# ../../${base_libdir}#g" -e "s# /usr/lib# .#g" ${D}${libdir}/libc.so - fi - - if [ -f ${D}${base_libdir}/libc.so ];then - sed -i -e "s# /${EAT_LIBDIR}/${EAT_TARGET_SYS}# ../../lib#g" -e "s# /usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}# .#g" -e "s# /${EAT_LIBDIR}/# /lib/#g" ${D}${base_libdir}/libc.so - if [ -f ${D}${base_libdir}/libc.so.6 ]; then - sed -i -e "s# /usr/${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" -e "s# /${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" ${D}${base_libdir}/libc.so.6 - fi - fi + update_ld_script_path ${D}${libdir}/libc.so + [ "${D}${base_libdir}/libc.so" != "${D}${libdir}/libc.so" ] && update_ld_script_path ${D}${libdir}/libc.so + update_ld_script_path ${D}${libdir}/libm.so + update_ld_script_path ${D}${libdir}/libm.a # Remove if empty rmdir ${D}${bindir} || true ^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} 2024-04-17 11:30 [PATCH 0/3] external-arm-toolchain: fix build when usrmege enabled Vasyl Vavrychuk 2024-04-17 11:30 ` [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check Vasyl Vavrychuk 2024-04-17 11:30 ` [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir Vasyl Vavrychuk @ 2024-04-17 11:30 ` Vasyl Vavrychuk 2024-04-17 20:13 ` [meta-arm] " Denys Dmytriyenko 2 siblings, 1 reply; 12+ messages in thread From: Vasyl Vavrychuk @ 2024-04-17 11:30 UTC (permalink / raw) To: Ross Burton, Denys Dmytriyenko, meta-arm; +Cc: Vasyl Vavrychuk When `usrmerge` distro feature is not enabled, then `${base_libdir}` resolves to `/lib` and `/lib/libpthread*.so` does not match any files. But, with `usrmerge` distro feature, `${base_libdir}` is `/usr/lib`, so removed line leads to `/usr/lib/libpthread.so` symlink included in `${PN}` which causes QA check failure. Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> --- .../external-arm-toolchain/external-arm-toolchain.bb | 1 - 1 file changed, 1 deletion(-) diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb index ab608128..f0955b29 100644 --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb @@ -528,7 +528,6 @@ FILES:${PN} += "\ ${base_libdir}/ld*.so.* \ ${base_libdir}/ld-*.so \ ${base_libdir}/libpthread*.so.* \ - ${base_libdir}/libpthread*.so \ ${base_libdir}/libpthread-*.so \ ${base_libdir}/libresolv*.so.* \ ${base_libdir}/libresolv-*.so \ -- 2.40.0 ^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [meta-arm] [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} 2024-04-17 11:30 ` [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} Vasyl Vavrychuk @ 2024-04-17 20:13 ` Denys Dmytriyenko 0 siblings, 0 replies; 12+ messages in thread From: Denys Dmytriyenko @ 2024-04-17 20:13 UTC (permalink / raw) To: Vasyl Vavrychuk; +Cc: Ross Burton, Denys Dmytriyenko, meta-arm On Wed, Apr 17, 2024 at 02:30:42PM +0300, Vasyl Vavrychuk wrote: > When `usrmerge` distro feature is not enabled, then `${base_libdir}` > resolves to `/lib` and `/lib/libpthread*.so` does not match any files. > But, with `usrmerge` distro feature, `${base_libdir}` is `/usr/lib`, so > removed line leads to `/usr/lib/libpthread.so` symlink included in > `${PN}` which causes QA check failure. > > Signed-off-by: Vasyl Vavrychuk <vvavrychuk@gmail.com> Acked-by: Denys Dmytriyenko <denys@konsulko.com> > --- > .../external-arm-toolchain/external-arm-toolchain.bb | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > index ab608128..f0955b29 100644 > --- a/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > +++ b/meta-arm-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb > @@ -528,7 +528,6 @@ FILES:${PN} += "\ > ${base_libdir}/ld*.so.* \ > ${base_libdir}/ld-*.so \ > ${base_libdir}/libpthread*.so.* \ > - ${base_libdir}/libpthread*.so \ > ${base_libdir}/libpthread-*.so \ > ${base_libdir}/libresolv*.so.* \ > ${base_libdir}/libresolv-*.so \ > -- > 2.40.0 ^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-08-30 15:57 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-17 11:30 [PATCH 0/3] external-arm-toolchain: fix build when usrmege enabled Vasyl Vavrychuk
2024-04-17 11:30 ` [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check Vasyl Vavrychuk
2024-04-17 20:06 ` [meta-arm] " Denys Dmytriyenko
2024-04-17 11:30 ` [PATCH 2/3] external-arm-toolchain: in libc.so GNU ld script use base_libdir Vasyl Vavrychuk
2024-04-17 20:12 ` [meta-arm] " Denys Dmytriyenko
2024-04-18 13:54 ` Vasyl Vavrychuk
2024-04-18 15:57 ` Denys Dmytriyenko
2024-04-29 13:54 ` Jon Mason
2024-08-30 15:57 ` Romain Naour
2024-05-24 11:19 ` Parthiban
2024-04-17 11:30 ` [PATCH 3/3] external-arm-toolchain: remove ${base_libdir}/libpthread*.so from FILES:${PN} Vasyl Vavrychuk
2024-04-17 20:13 ` [meta-arm] " Denys Dmytriyenko
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.