diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index f3fdaaec07..21c710d0fb 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -96,6 +96,10 @@ copy_toolchain_lib_root = \ # Note that the 'locale' directories are not copied. They are huge # (400+MB) in CodeSourcery toolchains, and they are not really useful. # +# usr/sbin may be a directory in the source toolchain, but a symlink +# in the destination sysroot, when we are using a merged-bin. Account +# for that. +# # $1: main sysroot directory of the toolchain # $2: arch specific sysroot directory of the toolchain # $3: arch specific subdirectory in the sysroot @@ -109,13 +113,13 @@ copy_toolchain_sysroot = \ ARCH_SUBDIR="$(strip $3)"; \ ARCH_LIB_DIR="$(strip $4)" ; \ SUPPORT_LIB_DIR="$(strip $5)" ; \ - for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \ + for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR} usr/sbin; do \ if [ ! -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \ continue ; \ fi ; \ if [ "$$i" = "usr" ]; then \ rsync -au --chmod=u=rwX,go=rX --exclude 'locale/' \ - --include '/libexec*/' --exclude '/lib*/' \ + --include '/libexec*/' --exclude '/lib*/' --exclude '/sbin' \ $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \ else \ rsync -au --chmod=u=rwX,go=rX --exclude 'locale/' \