Skip to content

Tools: Restrict toolchains reported by mbed compile -S to official ones #8249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 4 additions & 14 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1072,20 +1072,10 @@ def get_unique_supported_toolchains(release_targets=None):
If release_targets is not specified, then it queries all
known targets
"""
unique_supported_toolchains = []

if not release_targets:
for target in TARGET_NAMES:
for toolchain in TARGET_MAP[target].supported_toolchains:
if toolchain not in unique_supported_toolchains:
unique_supported_toolchains.append(toolchain)
else:
for target in release_targets:
for toolchain in target[1]:
if toolchain not in unique_supported_toolchains:
unique_supported_toolchains.append(toolchain)

return unique_supported_toolchains
return [
name for name, cls in TOOLCHAIN_CLASSES.items()
if cls.OFFICIALLY_SUPPORTED
]


def _lowercase_release_version(release_version):
Expand Down
2 changes: 2 additions & 0 deletions tools/toolchains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
CPU_COEF = 1

class mbedToolchain:
OFFICIALLY_SUPPORTED = False

# Verbose logging
VERBOSE = True

Expand Down
3 changes: 3 additions & 0 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def redirect_symbol(source, sync, build_dir):


class ARM_STD(ARM):
OFFICIALLY_SUPPORTED = True
def __init__(self, target, notify=None, macros=None,
build_profile=None, build_dir=None):
ARM.__init__(self, target, notify, macros, build_dir=build_dir,
Expand All @@ -347,6 +348,7 @@ def __init__(self, target, notify=None, macros=None,

class ARM_MICRO(ARM):
PATCHED_LIBRARY = False
OFFICIALLY_SUPPORTED = True
def __init__(self, target, notify=None, macros=None,
silent=False, extra_verbose=False, build_profile=None,
build_dir=None):
Expand All @@ -357,6 +359,7 @@ def __init__(self, target, notify=None, macros=None,
raise NotSupportedException("ARM/uARM compiler support is required for ARM build")

class ARMC6(ARM_STD):
OFFICIALLY_SUPPORTED = False
SHEBANG = "#! armclang -E --target=arm-arm-none-eabi -x c"
SUPPORTED_CORES = ["Cortex-M0", "Cortex-M0+", "Cortex-M3", "Cortex-M4",
"Cortex-M4F", "Cortex-M7", "Cortex-M7F", "Cortex-M7FD",
Expand Down
1 change: 1 addition & 0 deletions tools/toolchains/gcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from tools.utils import run_cmd, NotSupportedException

class GCC(mbedToolchain):
OFFICIALLY_SUPPORTED = True
LINKER_EXT = '.ld'
LIBRARY_EXT = '.a'

Expand Down
1 change: 1 addition & 0 deletions tools/toolchains/iar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from tools.utils import run_cmd, NotSupportedException

class IAR(mbedToolchain):
OFFICIALLY_SUPPORTED = True
LIBRARY_EXT = '.a'
LINKER_EXT = '.icf'
STD_LIB_NAME = "%s.a"
Expand Down