From: Denys Dmytriyenko <denis@denix.org>
To: Vasyl Vavrychuk <vvavrychuk@gmail.com>
Cc: Ross Burton <ross.burton@arm.com>,
Denys Dmytriyenko <denys@konsulko.com>,
meta-arm@lists.yoctoproject.org
Subject: Re: [meta-arm] [PATCH 1/3] external-arm-toolchain: wrap base_libdir vs libdir manipulations under usrmerge check
Date: Wed, 17 Apr 2024 16:06:50 -0400 [thread overview]
Message-ID: <20240417200650.GT28791@denix.org> (raw)
In-Reply-To: <20240417113042.91880-2-vvavrychuk@gmail.com>
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
next prev parent reply other threads:[~2024-04-17 20:07 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Denys Dmytriyenko [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240417200650.GT28791@denix.org \
--to=denis@denix.org \
--cc=denys@konsulko.com \
--cc=meta-arm@lists.yoctoproject.org \
--cc=ross.burton@arm.com \
--cc=vvavrychuk@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.