From b833f4525987ada40a718970819013d76f1d35d8 Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Wed, 23 Dec 2020 17:31:11 +0300 Subject: gcc: Make it aware of Newlib nano IO feature Even though GCC as a compiler has nothing to do with a C library being used it still makes sense to know about Newlib's compact implementation of IO functions: * For targets like MSP430 which require to have such a tuned Newlib if "-mtiny-printf" is passed to the GCC's command-line [1] * For correct compilation of the following GCC's own DejaGnu tests [2]: - gcc/testsuite/gcc.c-torture/execute/920501-8.c - gcc/testsuite/gcc.c-torture/execute/930513-1.c - gcc/testsuite/gcc.dg/torture/builtin-sprintf.c - gcc/testsuite/gcc.c-torture/execute/ieee/920810-1.x [1] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=02afb6a9321fbfb435452636cedc2cd43f0c4fd2 [2] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=571bbd0d48d5872eacbd0b681fce6e1ae754520b So we add that missing cross-dependency now. Signed-off-by: Alexey Brodkin diff --git a/scripts/build/cc/gcc.sh b/scripts/build/cc/gcc.sh index 3d4db35..a3f3af1 100644 --- a/scripts/build/cc/gcc.sh +++ b/scripts/build/cc/gcc.sh @@ -361,6 +361,11 @@ do_gcc_core_backend() { [ -n "${CT_PKGVERSION}" ] && extra_config+=("--with-pkgversion=${CT_PKGVERSION}") [ -n "${CT_TOOLCHAIN_BUGURL}" ] && extra_config+=("--with-bugurl=${CT_TOOLCHAIN_BUGURL}") + # Hint GCC we'll use a bit special version of Newlib + if [ "${CT_LIBC_NEWLIB_NANO_FORMATTED_IO}" = "y" ]; then + extra_config+=("--enable-newlib-nano-formatted-io") + fi + if [ "${CT_CC_CXA_ATEXIT}" = "y" ]; then extra_config+=("--enable-__cxa_atexit") else -- cgit v0.10.2-6-g49f6