Update buidlroot to version 2016.08.1

This commit is contained in:
2016-11-16 22:07:29 +01:00
parent 807ab03547
commit a1061efbc2
3636 changed files with 59539 additions and 25783 deletions

View File

@@ -6,62 +6,15 @@
# toolchain logic, and the glibc package, so care must be taken when
# changing this function.
#
# Most toolchains (CodeSourcery ones) have their libraries either in
# /lib or /usr/lib relative to their ARCH_SYSROOT_DIR, so we search
# libraries in:
#
# $${ARCH_LIB_DIR}
# usr/$${ARCH_LIB_DIR}
#
# Buildroot toolchains, however, have basic libraries in /lib, and
# libstdc++/libgcc_s in /usr/<target-name>/lib(64), so we also need to
# search libraries in:
#
# usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR}
#
# Linaro toolchains have most libraries in lib/<target-name>/, so we
# need to search libraries in:
#
# $${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX)
#
# And recent Linaro toolchains have the GCC support libraries
# (libstdc++, libgcc_s, etc.) into a separate directory, outside of
# the sysroot, that we called the "SUPPORT_LIB_DIR", into which we
# need to search as well.
#
# Thanks to ARCH_LIB_DIR we also take into account toolchains that
# have the libraries in lib64 and usr/lib64.
#
# Please be very careful to check the major toolchain sources:
# Buildroot, Crosstool-NG, CodeSourcery and Linaro before doing any
# modification on the below logic.
#
# $1: arch specific sysroot directory
# $2: support libraries directory (can be empty)
# $3: library directory ('lib' or 'lib64') from which libraries must be copied
# $4: library name
# $5: destination directory of the libary, relative to $(TARGET_DIR)
# $1: library name
#
copy_toolchain_lib_root = \
ARCH_SYSROOT_DIR="$(strip $1)"; \
SUPPORT_LIB_DIR="$(strip $2)" ; \
ARCH_LIB_DIR="$(strip $3)" ; \
LIB="$(strip $4)"; \
DESTDIR="$(strip $5)" ; \
LIB="$(strip $1)"; \
\
for dir in \
$${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR}/$(TOOLCHAIN_EXTERNAL_PREFIX) \
$${ARCH_SYSROOT_DIR}/usr/$(TOOLCHAIN_EXTERNAL_PREFIX)/$${ARCH_LIB_DIR} \
$${ARCH_SYSROOT_DIR}/$${ARCH_LIB_DIR} \
$${ARCH_SYSROOT_DIR}/usr/$${ARCH_LIB_DIR} \
$${SUPPORT_LIB_DIR} ; do \
LIBPATHS=`find $${dir} -maxdepth 1 -name "$${LIB}" 2>/dev/null` ; \
if test -n "$${LIBPATHS}" ; then \
break ; \
fi \
done ; \
mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
LIBPATHS=`find $(STAGING_DIR)/ -name "$${LIB}" 2>/dev/null` ; \
for LIBPATH in $${LIBPATHS} ; do \
DESTDIR=`echo $${LIBPATH} | sed "s,^$(STAGING_DIR)/,," | xargs dirname` ; \
mkdir -p $(TARGET_DIR)/$${DESTDIR}; \
while true ; do \
LIBNAME=`basename $${LIBPATH}`; \
LIBDIR=`dirname $${LIBPATH}` ; \
@@ -97,22 +50,10 @@ copy_toolchain_lib_root = \
# corresponding architecture variants), and we don't want to import
# them.
#
# Then, we need to support two types of multilib toolchains:
# Then, if the selected architecture variant is not the default one
# (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR), then we :
#
# - The toolchains that have nested sysroots: a main sysroot, and
# then additional sysroots available as subdirectories of the main
# one. This is for example used by Sourcery CodeBench toolchains.
#
# - The toolchains that have side-by-side sysroots. Each sysroot is a
# complete one, they simply leave one next to each other. This is
# for example used by MIPS Codescape toolchains.
#
# So, we first detect if the selected architecture variant is not the
# default one (i.e, if SYSROOT_DIR != ARCH_SYSROOT_DIR).
#
# If we are in the situation of a nested sysroot, we:
#
# * If needed, import the header files from the default architecture
# * Import the header files from the default architecture
# variant. Header files are typically shared between the sysroots
# for the different architecture variants. If we use the
# non-default one, header files were not copied by the previous
@@ -126,14 +67,10 @@ copy_toolchain_lib_root = \
# non-default architecture variant is used. Without this, the
# compiler fails to find libraries and headers.
#
# If we are in the situation of a side-by-side sysroot, we:
#
# * Create a symbolic link
#
# Finally, some toolchains (i.e Linaro binary toolchains) store
# support libraries (libstdc++, libgcc_s) outside of the sysroot, so
# we simply copy all the libraries from the "support lib directory"
# into our sysroot.
# Some toolchains (i.e Linaro binary toolchains) store support
# libraries (libstdc++, libgcc_s) outside of the sysroot, so we simply
# copy all the libraries from the "support lib directory" into our
# sysroot.
#
# Note that the 'locale' directories are not copied. They are huge
# (400+MB) in CodeSourcery toolchains, and they are not really useful.
@@ -158,25 +95,18 @@ copy_toolchain_sysroot = \
$${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
fi ; \
done ; \
SYSROOT_DIR_CANON=`readlink -f $${SYSROOT_DIR}` ; \
ARCH_SYSROOT_DIR_CANON=`readlink -f $${ARCH_SYSROOT_DIR}` ; \
if [ $${SYSROOT_DIR_CANON} != $${ARCH_SYSROOT_DIR_CANON} ] ; then \
relpath="./" ; \
if [ $${ARCH_SYSROOT_DIR_CANON:0:$${\#SYSROOT_DIR_CANON}} == $${SYSROOT_DIR_CANON} ] ; then \
if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
fi ; \
mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \
nbslashs=`printf $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \
for slash in `seq 1 $${nbslashs}` ; do \
relpath=$${relpath}"../" ; \
done ; \
ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \
echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \
elif [ `dirname $${ARCH_SYSROOT_DIR_CANON}` == `dirname $${SYSROOT_DIR_CANON}` ] ; then \
ln -snf $${relpath} $(STAGING_DIR)/`basename $${ARCH_SYSROOT_DIR_CANON}` ; \
echo "Symlinking $(STAGING_DIR)/`basename $${ARCH_SYSROOT_DIR_CANON}` -> $${relpath}" ; \
if [ `readlink -f $${SYSROOT_DIR}` != `readlink -f $${ARCH_SYSROOT_DIR}` ] ; then \
if [ ! -d $${ARCH_SYSROOT_DIR}/usr/include ] ; then \
cp -a $${SYSROOT_DIR}/usr/include $(STAGING_DIR)/usr ; \
fi ; \
mkdir -p `dirname $(STAGING_DIR)/$${ARCH_SUBDIR}` ; \
relpath="./" ; \
nbslashs=`printf $${ARCH_SUBDIR} | sed 's%[^/]%%g' | wc -c` ; \
for slash in `seq 1 $${nbslashs}` ; do \
relpath=$${relpath}"../" ; \
done ; \
ln -s $${relpath} $(STAGING_DIR)/$${ARCH_SUBDIR} ; \
echo "Symlinking $(STAGING_DIR)/$${ARCH_SUBDIR} -> $${relpath}" ; \
fi ; \
if test -n "$${SUPPORT_LIB_DIR}" ; then \
cp -a $${SUPPORT_LIB_DIR}/* $(STAGING_DIR)/lib/ ; \
@@ -341,8 +271,7 @@ check_uclibc = \
$(call check_uclibc_feature,__UCLIBC_HAS_WCHAR__,BR2_USE_WCHAR,$${UCLIBC_CONFIG_FILE},Wide char support) ;\
$(call check_uclibc_feature,__UCLIBC_HAS_THREADS__,BR2_TOOLCHAIN_HAS_THREADS,$${UCLIBC_CONFIG_FILE},Thread support) ;\
$(call check_uclibc_feature,__PTHREADS_DEBUG_SUPPORT__,BR2_TOOLCHAIN_HAS_THREADS_DEBUG,$${UCLIBC_CONFIG_FILE},Thread debugging support) ;\
$(call check_uclibc_feature,__UCLIBC_HAS_THREADS_NATIVE__,BR2_TOOLCHAIN_HAS_THREADS_NPTL,$${UCLIBC_CONFIG_FILE},NPTL thread support) ;\
$(call check_uclibc_feature,__UCLIBC_HAS_SSP__,BR2_TOOLCHAIN_HAS_SSP,$${UCLIBC_CONFIG_FILE},Stack Smashing Protection support)
$(call check_uclibc_feature,__UCLIBC_HAS_THREADS_NATIVE__,BR2_TOOLCHAIN_HAS_THREADS_NPTL,$${UCLIBC_CONFIG_FILE},NPTL thread support)
#
# Check that the Buildroot configuration of the ABI matches the
@@ -381,6 +310,24 @@ check_cplusplus = \
exit 1 ; \
fi
#
#
# Check that the external toolchain supports Fortran
#
# $1: cross-gfortran path
#
check_fortran = \
__CROSS_FC=$(strip $1) ; \
__o=$(BUILD_DIR)/.br-toolchain-test-fortran.tmp ; \
printf 'program hello\n\tprint *, "Hello Fortran!\\n"\nend program hello\n' | \
$${__CROSS_FC} -x f95 -o $${__o} - ; \
if test $$? -ne 0 ; then \
rm -f $${__o}* ; \
echo "Fortran support is selected but is not available in external toolchain" ; \
exit 1 ; \
fi ; \
rm -f $${__o}* \
#
# Check that the cross-compiler given in the configuration exists
#
@@ -395,9 +342,12 @@ check_cross_compiler_exists = \
fi
#
# Check for toolchains known not to work with Buildroot. For now, we
# only check for Angstrom toolchains, by looking at the vendor part of
# the host tuple.
# Check for toolchains known not to work with Buildroot.
# - For the Angstrom toolchains, we check by looking at the vendor part of
# the host tuple.
# - Exclude distro-class toolchains which are not relocatable.
# - Exclude broken toolchains which return "libc.a" with -print-file-name.
# - Exclude toolchains which doesn't support --sysroot option.
#
# $1: cross-gcc path
#
@@ -418,8 +368,36 @@ check_unusable_toolchain = \
echo "and contain a lot of pre-built libraries that would conflict with"; \
echo "the ones Buildroot wants to build."; \
exit 1; \
fi; \
libc_a_path=`$${__CROSS_CC} -print-file-name=libc.a` ; \
if test "$${libc_a_path}" = "libc.a" ; then \
echo "Unable to detect the toolchain sysroot, Buildroot cannot use this toolchain." ; \
exit 1 ; \
fi ; \
sysroot_dir="$(call toolchain_find_sysroot,$${__CROSS_CC})" ; \
if test -z "$${sysroot_dir}" ; then \
echo "External toolchain doesn't support --sysroot. Cannot use." ; \
exit 1 ; \
fi
#
# Check if the toolchain has SSP (stack smashing protector) support
#
# $1: cross-gcc path
#
check_toolchain_ssp = \
__CROSS_CC=$(strip $1) ; \
__HAS_SSP=`echo 'void main(){}' | $${__CROSS_CC} -fstack-protector -x c - -o $(BUILD_DIR)/.br-toolchain-test.tmp >/dev/null 2>&1 && echo y` ; \
if [ "$(BR2_TOOLCHAIN_HAS_SSP)" != "y" -a "$${__HAS_SSP}" = "y" ] ; then \
echo "SSP support available in this toolchain, please enable BR2_TOOLCHAIN_EXTERNAL_HAS_SSP" ; \
exit 1 ; \
fi ; \
if [ "$(BR2_TOOLCHAIN_HAS_SSP)" = "y" -a "$${__HAS_SSP}" != "y" ] ; then \
echo "SSP support not available in this toolchain, please disable BR2_TOOLCHAIN_EXTERNAL_HAS_SSP" ; \
exit 1 ; \
fi ; \
rm -f $(BUILD_DIR)/.br-toolchain-test.tmp*
#
# Generate gdbinit file for use with Buildroot
#