buildroot/toolchain
Thomas De Schampheleire beddd71c57 toolchain-external: don't exclude too much lib in sysroot rsync
The copy_toolchain_sysroot helper in toolchain/helpers.mk performs an
rsync of various directories from the extracted external toolchain to the
corresponding directory in staging.

The relevant (simplified) snippet is:
    for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \
            rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \
                    --exclude lib --exclude lib32 --exclude lib64 \
                    $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
    done ; \

The exclusion logic of lib/lib32/lib64 has been added by commit
5628776c4a with the purpose of only copying
the relevant usr/lib* directory from the toolchain to staging, instead of
all. For example, if ARCH_LIB_DIR is 'lib64', then only usr/lib64 would be
copied and usr/lib and usr/lib32 are ignored. It works by ignoring any
lib/lib32/lib64 subdirectory on the rsync of 'usr' and then separately
copying usr/{lib,lib32,lib64} as appropriate. (The exclusion rules only have
impact on the files beneath the main source directory.)

However, on the rsync of 'usr', ANY of the following directories AND files
would be excluded:
    lib/
    lib
    lib32/
    foobar/something/lib/
    something-else/lib64/

while it is only the intention to skip directories directly under usr.

Therefore, add a leading (to restrict the scope to first-level) and trailing
(to restrict to directories) slash to the exclude pattern. From 'man rsync':

    - if the pattern starts with a / then it is anchored to [..] the root of
      the transfer.
    - if the pattern ends with a / then it will only match a directory, not
      a regular file, symlink, or device.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Cc: Samuel Martin <s.martin49@gmail.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Arnout Vandecappelle <arnout@mind.be>
Reviewed-by: Romain Naour <romain.naour@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2016-02-01 14:19:34 +01:00
..
toolchain toolchain/toolchain-buildroot: migrate to virtual package infrastructure 2014-06-14 19:10:13 +02:00
toolchain-buildroot package/c-libraries: need linux-headers 2015-12-30 09:54:33 +01:00
toolchain-external toolchain/external: add MIPS Codescape IMG GNU Linux toolchain 2016-01-20 10:28:05 +01:00
Config.in toolchain: like glibc, musl always provides SSP support 2015-10-18 15:35:42 +02:00
helpers.mk toolchain-external: don't exclude too much lib in sysroot rsync 2016-02-01 14:19:34 +01:00
toolchain-common.in package, toolchain: remove BR2_TOOLCHAIN_HAS_GCC_BUG_* options 2016-01-30 11:02:30 +01:00
toolchain-wrapper.c arch/x86: add support for Intel X1000 2015-10-20 10:04:52 +02:00
toolchain-wrapper.mk toolchain/wrapper: fix potential bug in foreach loop 2015-10-25 23:01:48 +01:00
toolchain.mk toolchain: fix installing gconv libs with multi-arch toolchain 2015-04-22 22:30:34 +02:00