From 5342f0fa003f6c3ee05a3b20b542380416602445 Mon Sep 17 00:00:00 2001 From: Kevin Bracey Date: Mon, 20 May 2019 13:58:07 +0300 Subject: [PATCH] Tools: check for GCC 9, rather than 6 Planning to update to supporting GCC 9 as found in GNU Tools for Arm Embedded Processors 9-2019q4-major. Newer GCC in particular supports ARMv8-M security extensions, and link-time optimisation - two areas of interest. Should be no code changes required, but need to change the warning in the toolchain script. --- tools/test/toolchains/api_test.py | 16 ++++++++++++---- tools/toolchains/gcc.py | 2 +- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/tools/test/toolchains/api_test.py b/tools/test/toolchains/api_test.py index 6dc6a143c4..fb7a4607b2 100644 --- a/tools/test/toolchains/api_test.py +++ b/tools/test/toolchains/api_test.py @@ -155,23 +155,31 @@ def test_gcc_version_check(_run_cmd): toolchain = TOOLCHAIN_CLASSES["GCC_ARM"]( TARGET_MAP["K64F"], notify=notifier) toolchain.version_check() - assert notifier.messages == [] + assert len(notifier.messages) == 1 _run_cmd.return_value = (""" - arm-none-eabi-gcc (Arch Repository) 8.1.0 - Copyright (C) 2018 Free Software Foundation, Inc. + arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 9-2019-q4-major) 9.2.1 20191025 (release) [ARM/arm-9-branch revision 277599] + Copyright (C) 2019 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. """, "", 0) toolchain.version_check() assert len(notifier.messages) == 1 _run_cmd.return_value = (""" + arm-none-eabi-gcc (GNU Tools for Arm Embedded Processors 10-2020-q4-major) 10.2.1 20201025 (release) [ARM/arm-10-branch revision 377599] + Copyright (C) 2020 Free Software Foundation, Inc. + This is free software; see the source for copying conditions. There is NO + warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + """, "", 0) + toolchain.version_check() + assert len(notifier.messages) == 2 + _run_cmd.return_value = (""" arm-none-eabi-gcc (Arch Repository) Copyright (C) 2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. """, "", 0) toolchain.version_check() - assert len(notifier.messages) == 2 + assert len(notifier.messages) == 3 @given(fixed_dictionaries({ diff --git a/tools/toolchains/gcc.py b/tools/toolchains/gcc.py index 24568d7c52..23b5e55586 100644 --- a/tools/toolchains/gcc.py +++ b/tools/toolchains/gcc.py @@ -32,7 +32,7 @@ class GCC(mbedToolchain): STD_LIB_NAME = "lib%s.a" DIAGNOSTIC_PATTERN = re.compile('((?P[^:]+):(?P\d+):)(?P\d+):? (?Pwarning|[eE]rror|fatal error): (?P.+)') - GCC_RANGE = (LooseVersion("6.0.0"), LooseVersion("7.0.0")) + GCC_RANGE = (LooseVersion("9.0.0"), LooseVersion("10.0.0")) GCC_VERSION_RE = re.compile(b"\d+\.\d+\.\d+") def __init__(self, target, notify=None, macros=None, build_profile=None,