aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSumit Garg <sumit.garg@linaro.org>2019-12-20 16:12:23 +0530
committerSumit Garg <sumit.garg@linaro.org>2020-01-02 16:02:39 +0530
commit11e022bd85d5659aaf8e564955ef629b2c8eb88c (patch)
tree01d8f2d93e1afb0d5c7388244785013642304cfb
parentd7acbaf565aa38aa930c98d45965f6ee51feeb42 (diff)
downloadmeta-linaro-11e022bd85d5659aaf8e564955ef629b2c8eb88c.tar.gz
external-arm-toolchain: fix libraries installation
- Don't follow symlinks (remove -H option) while copying libraries as this leads to redundant copies of libraries rather than using symlinks. - Correct symlink fixups of copied libraries. - libpthread.so.0 is no longer a linker script but rather a symbolic link to libpthread-<version>.so in toolchain, so remove linker script fixup. Signed-off-by: Sumit Garg <sumit.garg@linaro.org> Change-Id: Ied1295c197a2d6d872e783a6d80896776293aa18
-rw-r--r--meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb76
1 files changed, 24 insertions, 52 deletions
diff --git a/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
index 1fde8b39..4a22980d 100644
--- a/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
+++ b/meta-linaro-toolchain/recipes-devtools/external-arm-toolchain/external-arm-toolchain.bb
@@ -81,62 +81,57 @@ do_install() {
install -d ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}
CP_ARGS="-Prf --preserve=mode,timestamps --no-preserve=ownership"
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/${EAT_LIBDIR}/* ${D}${base_libdir}
if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/${EAT_TARGET_SYS} ]; then
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/${EAT_TARGET_SYS}/* ${D}${base_libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/${EAT_TARGET_SYS}/* ${D}${base_libdir}
else
if [ -f ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/ld-${EAT_VER_LIBC}.so ]; then
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/* ${D}${base_libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/* ${D}${base_libdir}
else
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/*.so* ${D}${base_libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/*.so* ${D}${base_libdir}
fi
fi
if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/${EAT_TARGET_SYS} ]; then
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}/* ${D}${libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/${EAT_TARGET_SYS}/* ${D}${libdir}
else
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/* ${D}${libdir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/${EAT_LIBDIR}/* ${D}${libdir}
if [ ! -f ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/${EAT_LIBDIR}/ld-${EAT_VER_LIBC}.so ]; then
rm -rf ${D}${libdir}/*.so*
fi
fi
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/share/* ${D}${datadir}
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/* ${D}${includedir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/share/* ${D}${datadir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/* ${D}${includedir}
if [ -d ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/${EAT_TARGET_SYS} ]; then
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/${EAT_TARGET_SYS}/* ${D}${includedir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/include/${EAT_TARGET_SYS}/* ${D}${includedir}
rm -r ${D}${includedir}/${EAT_TARGET_SYS}
fi
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/include/* ${D}${includedir}
ln -sf ../usr/include/c++ ${D}/include/c++
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/sbin/* ${D}${sbindir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/bin/* ${D}${bindir}
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/${EAT_TARGET_SYS}/libc/usr/sbin/* ${D}${sbindir}
rm -rf ${D}${bindir}/gdbserver
sed -i -e 's#/arm/tools/gnu/bash/4.2/rhe6-x86_64##' ${D}${bindir}/tzselect
sed -i -e 's#/arm/tools/gnu/bash/4.2/rhe6-x86_64##' ${D}${bindir}/ldd
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/crt*.o ${D}${libdir}/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
- cp ${CP_ARGS} -H ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/libgcov* ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/include ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
+ cp ${CP_ARGS} ${EXTERNAL_TOOLCHAIN}/lib/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/finclude ${D}${libdir}/gcc/${EAT_TARGET_SYS}/${EAT_VER_GCC}/
# fix up the copied symlinks (they are still pointing to the multiarch directory)
linker_name="${@bb.utils.contains("TUNE_FEATURES", "aarch64", "ld-linux-aarch64.so.1", bb.utils.contains("TUNE_FEATURES", "callconvention-hard", "ld-linux-armhf.so.3", "ld-linux.so.3",d), d)}"
ln -sf ld-${EAT_VER_LIBC}.so ${D}${base_libdir}/${linker_name}
ln -sf ../../lib/librt.so.1 ${D}${libdir}/librt.so
- ln -sf ../../lib/libgcc_s.so.1 ${D}${libdir}/libgcc_s.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_dns.so.2 ${D}${libdir}/libnss_dns.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/libnss_files.so.2 ${D}${libdir}/libnss_files.so
- ln -sf ../../lib/libnss_compat.so.2 ${D}${libdir}/libnss_compat.so
ln -sf ../../lib/libBrokenLocale.so.1 ${D}${libdir}/libBrokenLocale.so
- ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db.so
ln -sf ../../lib/libpthread.so.0 ${D}${libdir}/libpthread.so
- ln -sf ../../lib/libthread_db.so.1 ${D}${libdir}/libthread_db-1.0.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
@@ -144,44 +139,27 @@ do_install() {
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/libatomic.so.1 ${D}${libdir}/libatomic.so
- ln -sf ../../lib/libgomp.so.1 ${D}${libdir}/libgomp.so
- ln -sf ../../lib/libitm.so.1 ${D}${libdir}/libitm.so
- ln -sf ../../lib/libssp.so.0 ${D}${libdir}/libssp.so
- ln -sf ../../lib/libstdc++.so.6 ${D}${libdir}/libstdc++.so
- ln -sf ../../lib/libubsan.so.1 ${D}${libdir}/libubsan.so
- ln -sf ../../lib/libasan.so.5 ${D}${libdir}/libasan.so
- ln -sf ../../lib/libgfortran.so.5 ${D}${libdir}/libgfortran.so
-
- # lib?san is duplicated *and* the files are all hardlinks
- for lib in lsan tsan ; do
- rm -f ${D}${libdir}/lib${lib}.so.0 ${D}${libdir}/lib${lib}.so ${D}${base_libdir}/lib${lib}*
- ln -sf lib${lib}.so.0.0.0 ${D}${libdir}/lib${lib}.so.0
- ln -sf lib${lib}.so.0.0.0 ${D}${libdir}/lib${lib}t.so
- done
# 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}/libnss_nis.so
rm -f ${D}${base_libdir}/libresolv.so
- rm -f ${D}${base_libdir}/libnss_dns.so
rm -f ${D}${base_libdir}/libnss_hesiod.so
rm -f ${D}${base_libdir}/libutil.so
- rm -f ${D}${base_libdir}/libnss_files.so
- rm -f ${D}${base_libdir}/libnss_compat.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_nisplus.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
- rm -f ${D}${base_libdir}/libssp.so
- # Move these completely to ${libdir}
- for lib in asan atomic gfortran gomp itm sanitizer stdc++ ubsan; do
+ # Move these completely to ${libdir} and delete duplicates in ${base_libdir}
+ for lib in asan 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
@@ -239,9 +217,6 @@ do_install() {
sed -i -e "s# /usr/${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" "s# /${EAT_LIBDIR}/libc.so.6# /lib/libc.so.6#g" ${D}${base_libdir}/libc.so.6
fi
fi
- if [ -f ${D}${base_libdir}/libpthread.so.0 ]; then
- sed -i -e "s# /usr/${EAT_LIBDIR}/libpthread.so.0# /lib/libpthread.so.0#g" ${D}${base_libdir}/libpthread.so.0
- fi
# Remove if empty
rmdir ${D}${bindir} || true
@@ -499,10 +474,7 @@ FILES_gcc-sanitizers = "${libdir}/*.spec ${libdir}/gcc/${TARGET_SYS}/${BINV}/inc
# From libgcc.inc:
-FILES_libgcc = "\
- ${base_libdir}/libgcc_s.so.1 \
- ${base_libdir}/libgcc_s.so \
-"
+FILES_libgcc = "${base_libdir}/libgcc_s.so.1"
FILES_libgcc-dev = "\
${base_libdir}/libgcc*.so \