Skip to content

Disable Arm Compiler 5 and Use Arm Compiler 6 by default #5406

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 7 commits into from
Nov 16, 2017
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
2 changes: 1 addition & 1 deletion cmsis/core_cm4.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#endif

#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#if defined __ARM_PCS_VFP
#if defined (__ARM_FP) && (__ARM_FP >= 2)
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
Expand Down
2 changes: 1 addition & 1 deletion cmsis/core_cm7.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
#endif

#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#if defined __ARM_PCS_VFP
#if defined (__ARM_FP) && (__ARM_FP >= 2)
#if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)
#define __FPU_USED 1U
#else
Expand Down
5 changes: 5 additions & 0 deletions platform/mbed_retarget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1091,3 +1091,8 @@ MBED_WEAK const ticker_info_t* lp_ticker_get_info()
};
return &info;
}

#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
#include <vector>
template class std::__1::__vector_base_common<1>;
#endif
2 changes: 2 additions & 0 deletions targets/TARGET_ONSEMI/TARGET_NCS36510/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ void fncs36510_deepsleep(void)
__WFI();
__NOP();
__NOP();
__NOP();
__NOP();

/** Wait for the external 32MHz to be power-ed up & running
* Re-power down the 32MHz internal osc
Expand Down
23 changes: 1 addition & 22 deletions tools/profiles/debug.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
},
"ARMC6": {
"ARM": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-g", "-O0",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
Expand All @@ -26,27 +26,6 @@
"ld": ["--verbose", "--remove", "--legacyalign", "--no_strict_wchar_size",
"--no_strict_enum_size"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O0", "-g", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path"]
},
"uARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O0", "-D__MICROLIB", "-g",
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DMBED_DEBUG",
"-DMBED_TRAP_ERRORS_ENABLED=1"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--library_type=microlib"]
},
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
Expand Down
21 changes: 1 addition & 20 deletions tools/profiles/develop.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
},
"ARMC6": {
"ARM": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Os",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
Expand All @@ -24,25 +24,6 @@
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--legacyalign", "--no_strict_wchar_size", "--no_strict_enum_size"]
},
"ARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path"]
},
"uARM": {
"common": ["-c", "--gnu", "-Otime", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3", "-D__MICROLIB",
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--library_type=microlib"]
},
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
Expand Down
21 changes: 1 addition & 20 deletions tools/profiles/release.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"-Wl,--wrap,_calloc_r", "-Wl,--wrap,exit", "-Wl,--wrap,atexit",
"-Wl,-n"]
},
"ARMC6": {
"ARM": {
"common": ["-c", "--target=arm-arm-none-eabi", "-mthumb", "-Oz",
"-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions",
"-DMULADDC_CANNOT_USE_R7", "-fdata-sections",
Expand All @@ -24,25 +24,6 @@
"cxx": ["-fno-rtti", "-std=gnu++98"],
"ld": ["--legacyalign", "--no_strict_wchar_size", "--no_strict_enum_size"]
},
"ARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3", "-DNDEBUG"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--show_full_path"]
},
"uARM": {
"common": ["-c", "--gnu", "-Ospace", "--split_sections",
"--apcs=interwork", "--brief_diagnostics", "--restrict",
"--multibyte_chars", "-O3", "-D__MICROLIB",
"--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", "-DNDEBUG"],
"asm": [],
"c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"],
"cxx": ["--cpp", "--no_rtti", "--no_vla"],
"ld": ["--library_type=microlib"]
},
"IAR": {
"common": [
"--no_wrap_diagnostics", "-e",
Expand Down
8 changes: 5 additions & 3 deletions tools/targets/REALTEK_RTL8195AM.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def find_symbol(toolchain, mapfile, symbol):
HEX = '0x0{,8}(?P<addr>[0-9A-Fa-f]{8})'
if toolchain == "GCC_ARM":
SYM = re.compile(r'^\s+' + HEX + r'\s+' + symbol + '\r?$')
elif toolchain in ["ARM_STD", "ARM", "ARM_MICRO"]:
elif toolchain in ("ARM_STD", "ARM", "ARM_MICRO", "ARMC6"):
SYM = re.compile(r'^\s+' + HEX + r'\s+0x[0-9A-Fa-f]{8}\s+Code.*\s+i\.' + symbol + r'\s+.*$')
elif toolchain == "IAR":
SYM = re.compile(r'^' + symbol + r'\s+' + HEX + '\s+.*$')
Expand Down Expand Up @@ -155,7 +155,9 @@ def parse_load_segment_armcc(image_elf):
(offset, addr, size) = (0, 0, 0)
segment_list = []
in_segment = False
cmd = os.path.join(TOOLCHAIN_PATHS['ARM'], 'bin', 'fromelf')
cmd = os.path.join(TOOLCHAIN_PATHS['ARMC6'], 'fromelf')
if not os.path.exists(cmd):
cmd = os.path.join(TOOLCHAIN_PATHS['ARM'], 'bin', 'fromelf')
cmd = '"' + cmd + '"' + ' --text -v --only=none ' + image_elf
for line in subprocess.check_output(cmd, shell=True, universal_newlines=True).split("\n"):
if line == "":
Expand Down Expand Up @@ -227,7 +229,7 @@ def parse_load_segment_iar(image_elf):
def parse_load_segment(toolchain, image_elf):
if toolchain == "GCC_ARM":
return parse_load_segment_gcc(image_elf)
elif toolchain in ["ARM_STD", "ARM", "ARM_MICRO"]:
elif toolchain in ("ARM_STD", "ARM", "ARM_MICRO", "ARMC6"):
return parse_load_segment_armcc(image_elf)
elif toolchain == "IAR":
return parse_load_segment_iar(image_elf)
Expand Down
15 changes: 0 additions & 15 deletions tools/test/toolchains/api_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
Resources, TOOLCHAIN_PATHS, mbedToolchain
from tools.targets import TARGET_MAP

def test_instantiation():
"""Test that all exported toolchain may be instantiated"""
for name, tc_class in TOOLCHAIN_CLASSES.items():
cls = tc_class(TARGET_MAP["K64F"])
assert name == cls.name or\
name == LEGACY_TOOLCHAIN_NAMES[cls.name]

ALPHABET = [char for char in printable if char not in [u'.', u'/']]

@given(fixed_dictionaries({
Expand Down Expand Up @@ -115,10 +108,6 @@ def test_toolchain_profile_asm(profile, source_file):
"Toolchain %s did not propagate arg %s" % (toolchain.name,
parameter)

for name, Class in TOOLCHAIN_CLASSES.items():
CLS = Class(TARGET_MAP["K64F"])
assert name == CLS.name or name == LEGACY_TOOLCHAIN_NAMES[CLS.name]

@given(fixed_dictionaries({
'common': lists(text()),
'c': lists(text()),
Expand Down Expand Up @@ -152,10 +141,6 @@ def test_toolchain_profile_ld(profile, source_file):
"Toolchain %s did not propagate arg %s" % (toolchain.name,
parameter)

for name, Class in TOOLCHAIN_CLASSES.items():
CLS = Class(TARGET_MAP["K64F"])
assert name == CLS.name or name == LEGACY_TOOLCHAIN_NAMES[CLS.name]


@given(lists(text(alphabet=ALPHABET, min_size=1), min_size=1))
def test_detect_duplicates(filenames):
Expand Down
5 changes: 1 addition & 4 deletions tools/toolchains/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,6 @@ def report(self):

TOOLCHAIN_PATHS = {
'ARM': ARM_PATH,
'uARM': ARM_PATH,
'ARMC6': ARMC6_PATH,
'GCC_ARM': GCC_ARM_PATH,
'IAR': IAR_PATH
Expand All @@ -1583,9 +1582,7 @@ def report(self):
from tools.toolchains.iar import IAR

TOOLCHAIN_CLASSES = {
'ARM': ARM_STD,
'uARM': ARM_MICRO,
'ARMC6': ARMC6,
'ARM': ARMC6,
'GCC_ARM': GCC_ARM,
'IAR': IAR
}
Expand Down
8 changes: 3 additions & 5 deletions tools/toolchains/arm.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ class ARMC6(ARM_STD):
"CortexM33-NS"]
@staticmethod
def check_executable():
return mbedToolchain.generic_check_executable("ARMC6", "armclang", 1)
return(mbedToolchain.generic_check_executable("ARMC6", "armclang", 1) or
mbedToolchain.generic_check_executable("ARM", "armclang", 1))

def __init__(self, target, *args, **kwargs):
mbedToolchain.__init__(self, target, *args, **kwargs)
Expand All @@ -309,16 +310,12 @@ def __init__(self, target, *args, **kwargs):

if target.core.lower().endswith("fd"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-2])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-2])
elif target.core.lower().endswith("f"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-1])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-1])
elif target.core.lower().endswith("ns"):
self.flags['common'].append("-mcpu=%s" % target.core.lower()[:-3])
self.flags['ld'].append("--cpu=%s" % target.core.lower()[:-3])
else:
self.flags['common'].append("-mcpu=%s" % target.core.lower())
self.flags['ld'].append("--cpu=%s" % target.core.lower())

if target.core == "Cortex-M4F":
self.flags['common'].append("-mfpu=fpv4-sp-d16")
Expand Down Expand Up @@ -346,6 +343,7 @@ def __init__(self, target, *args, **kwargs):
"Cortex-M33-NS": "Cortex-M33" }.get(target.core, target.core)

self.flags['asm'].append("--cpu=%s" % asm_cpu)
self.flags['ld'].append("--cpu=%s" % asm_cpu)

self.cc = ([join(TOOLCHAIN_PATHS["ARMC6"], "armclang")] +
self.flags['common'] + self.flags['c'])
Expand Down