toolchain-external: Fix external toolchains when BR2_ROOTFS_MERGED_USR
PATCH v3 1/1 toolchain-external: Fix external toolchains when BR2_ROOTFS_MERGED_USR
External toolchains like crosstool-ng place libraries at /usr/lib and /usr/lib64. When BR2_ROOTFS_MERGED_USR is enabled, these libraries were not being copied into the target. This caused these toolchains to be unusable with this option.
When BR2_ROOTFS_MERGED_USR is selected, copy the /usr/lib and /usr/lib64 directories to the target respectively.
---
I originally reported this issue here [1].
[1] https://lore.kernel.org/buildroot/Z86AGdrKHaUqgLVt@ghost/T/#t
---
Changes in v3:
- Simplify patch further to fix the core of the problem
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Reduce rsync to root cause. The previous solution was very
heavy-handed as pointed out by Arnout. This seems to be the proper way
of doing this.
- Link to v1: https://lore.kernel.org/r/[email protected]
--- toolchain/helpers.mk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
toolchain/helpers.mk +4 -1
@@ -55,6 +55,9 @@ copy_toolchain_lib_root = \ # corresponding architecture variants), and we don't want to import # them. # +# Furthermore, when BR2_ROOTFS_MERGED_USR is enabled, the 'lib*' directories +# need to be copied over to usr/'lib*'. +# # If ARCH_LIB_DIR is not a singular directory component, e.g. # 'lib32/octeon2', then symbolic links in ARCH_LIB_DIR and # usr/ARCH_LIB_DIR may be broken because Buildroot will flatten the
@@ -113,7 +116,7 @@ copy_toolchain_sysroot = \ if [ ! -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \ continue ; \ fi ; \ - if [ "$$i" = "usr" ]; then \ + if [ "$$i" = "usr" ] && [ "$(BR2_ROOTFS_MERGED_USR)" != "y" ]; then \ rsync -au --chmod=u=rwX,go=rX --exclude 'locale/' \ --include '/libexec*/' --exclude '/lib*/' \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
---
base-commit: 4809690d42f9b395ccb76ee7583c199fdd8d42c5
change-id: 20250310-fix_external_toolchains-d1b8c4da0be8
Signature · 6 lines
- Charlie _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot