Skip to content

Commit e1e4456

Browse files
committed
Fixes for exporters failing with wrong compiler settings
1 parent 9967483 commit e1e4456

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

tools/export/cdt/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,14 @@ class EclipseGcc(Eclipse, GccArm):
114114
class EclipseArmc5(Eclipse, Armc5):
115115
LOAD_EXE = False
116116
NAME = "Eclipse-Armc5"
117+
118+
@classmethod
119+
def is_target_supported(cls, target_name):
120+
target = TARGET_MAP[target_name]
121+
if int(target.build_tools_metadata["version"]) > 0:
122+
return "ARMC5" in target.supported_toolchains;
123+
else:
124+
return True
117125

118126
class EclipseIAR(Eclipse, IAR):
119127
LOAD_EXE = True

tools/export/makefile/__init__.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,45 @@ class Armc5(Arm):
273273
NAME = 'Make-ARMc5'
274274
TOOLCHAIN = "ARM"
275275
PREPROCESS_ASM = True
276+
277+
@classmethod
278+
def is_target_supported(cls, target_name):
279+
target = TARGET_MAP[target_name]
280+
281+
if int(target.build_tools_metadata["version"]) > 0:
282+
#Although toolchain name is set to ARM above we should check for ARMC5 for 5.12/onwards
283+
if "ARMC5" not in target.supported_toolchains:
284+
return False
285+
286+
return apply_supported_whitelist(
287+
cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target)
276288

277289
class Armc6(Arm):
278290
"""ARM Compiler 6 (armclang) specific generic makefile target"""
279291
NAME = 'Make-ARMc6'
280292
TOOLCHAIN = "ARMC6"
281-
293+
294+
@classmethod
295+
def is_target_supported(cls, target_name):
296+
target = TARGET_MAP[target_name]
297+
298+
if int(target.build_tools_metadata["version"]) > 0:
299+
if not (len(set(target.supported_toolchains).intersection(
300+
set(["ARM", "ARMC6"]))) > 0):
301+
return False
302+
303+
if not apply_supported_whitelist(
304+
cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target):
305+
#ARMC6 is not in the list, but also check for ARM as ARM represents ARMC6 for 5.12/onwards
306+
#and still keep cls.TOOLCHAIN as ARMC6 as thats the toolchain we want to use
307+
return apply_supported_whitelist(
308+
"ARM", cls.POST_BINARY_WHITELIST, target)
309+
else:
310+
return True
311+
else:
312+
return apply_supported_whitelist(
313+
cls.TOOLCHAIN, cls.POST_BINARY_WHITELIST, target)
314+
282315

283316
class IAR(Makefile):
284317
"""IAR specific makefile target"""

tools/export/uvision/__init__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ class UvisionArmc5(Uvision):
316316
def is_target_supported(cls, target_name):
317317
target = TARGET_MAP[target_name]
318318
if int(target.build_tools_metadata["version"]) > 0:
319-
if not (set(target.supported_toolchains).intersection(
320-
set(["ARMC5", "uARM"]))):
319+
#Just check for ARMC5 as ARMC5 must be there irrespective of whether uARM is there or not if the target is staying with ARMC5
320+
if "ARMC5" not in target.supported_toolchains:
321321
return False
322322
else:
323323
if not (set(target.supported_toolchains).intersection(
@@ -345,12 +345,11 @@ class UvisionArmc6(Uvision):
345345
def is_target_supported(cls, target_name):
346346
target = TARGET_MAP[target_name]
347347
if int(target.build_tools_metadata["version"]) > 0:
348-
if not (set(target.supported_toolchains).intersection(
349-
set(["ARM", "ARMC6", "uARM"]))):
348+
if not len(set(target.supported_toolchains).intersection(
349+
set(["ARM", "ARMC6"]))) > 0:
350350
return False
351351
else:
352-
if not (set(target.supported_toolchains).intersection(
353-
set(["ARMC6"]))):
352+
if "ARMC6" not in target.supported_toolchains:
354353
return False
355354

356355
if not DeviceCMSIS.check_supported(target_name):

0 commit comments

Comments
 (0)