|
@@ -422,12 +422,16 @@ check_cross_compiler_exists = \
|
|
# the host tuple.
|
|
# the host tuple.
|
|
# - Exclude distro-class toolchains which are not relocatable.
|
|
# - Exclude distro-class toolchains which are not relocatable.
|
|
# - Exclude broken toolchains which return "libc.a" with -print-file-name.
|
|
# - Exclude broken toolchains which return "libc.a" with -print-file-name.
|
|
|
|
+# - Exclude toolchains used with wrong toolchain cflags or broken toolchains
|
|
|
|
+# which return "libc.a" with -print-file-name and toolchain cflags.
|
|
# - Exclude toolchains which doesn't support --sysroot option.
|
|
# - Exclude toolchains which doesn't support --sysroot option.
|
|
#
|
|
#
|
|
# $1: cross-gcc path
|
|
# $1: cross-gcc path
|
|
|
|
+# $1: toolchain cflags
|
|
#
|
|
#
|
|
check_unusable_toolchain = \
|
|
check_unusable_toolchain = \
|
|
__CROSS_CC=$(strip $1) ; \
|
|
__CROSS_CC=$(strip $1) ; \
|
|
|
|
+ __TOOLCHAIN_CFLAGS=$(strip $2) ; \
|
|
vendor=`$${__CROSS_CC} -dumpmachine | cut -f2 -d'-'` ; \
|
|
vendor=`$${__CROSS_CC} -dumpmachine | cut -f2 -d'-'` ; \
|
|
if test "$${vendor}" = "angstrom" ; then \
|
|
if test "$${vendor}" = "angstrom" ; then \
|
|
echo "Angstrom toolchains are not pure toolchains: they contain" ; \
|
|
echo "Angstrom toolchains are not pure toolchains: they contain" ; \
|
|
@@ -449,6 +453,13 @@ check_unusable_toolchain = \
|
|
echo "Unable to detect the toolchain sysroot, Buildroot cannot use this toolchain." ; \
|
|
echo "Unable to detect the toolchain sysroot, Buildroot cannot use this toolchain." ; \
|
|
exit 1 ; \
|
|
exit 1 ; \
|
|
fi ; \
|
|
fi ; \
|
|
|
|
+ libc_a_archsysroot_path=`$${__CROSS_CC} $${__TOOLCHAIN_CFLAGS} -print-file-name=libc.a` ; \
|
|
|
|
+ if test "$${libc_a_archsysroot_path}" = "libc.a" ; then \
|
|
|
|
+ echo "Unable to detect the toolchain architecture sysroot." ; \
|
|
|
|
+ echo "Please check the Target Architecture Variant selected, the toolchains may not support it." ; \
|
|
|
|
+ echo "Buildroot cannot use this toolchain." ; \
|
|
|
|
+ exit 1 ; \
|
|
|
|
+ fi; \
|
|
sysroot_dir="$(call toolchain_find_sysroot,$${__CROSS_CC})" ; \
|
|
sysroot_dir="$(call toolchain_find_sysroot,$${__CROSS_CC})" ; \
|
|
if test -z "$${sysroot_dir}" ; then \
|
|
if test -z "$${sysroot_dir}" ; then \
|
|
echo "External toolchain doesn't support --sysroot. Cannot use." ; \
|
|
echo "External toolchain doesn't support --sysroot. Cannot use." ; \
|