@@ -198,6 +198,8 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
198198
199199 if any (os .path .basename (x ) in {'lib' , 'lib.exe' , 'llvm-lib' , 'llvm-lib.exe' , 'xilib' , 'xilib.exe' } for x in linker ):
200200 arg = '/?'
201+ elif linker_name in {'ar2000' , 'ar2000.exe' , 'ar430' , 'ar430.exe' , 'armar' , 'armar.exe' , 'ar6x' , 'ar6x.exe' }:
202+ arg = '?'
201203 else :
202204 arg = '--version'
203205 try :
@@ -231,6 +233,9 @@ def detect_static_linker(env: 'Environment', compiler: Compiler) -> StaticLinker
231233 return linkers .C2000Linker (linker )
232234 else :
233235 return linkers .TILinker (linker )
236+ if 'Texas Instruments Incorporated' in out :
237+ if 'ar6000' in linker_name :
238+ return linkers .C6000Linker (linker )
234239 if out .startswith ('The CompCert' ):
235240 return linkers .CompCertLinker (linker )
236241 if out .strip ().startswith ('Metrowerks' ) or out .strip ().startswith ('Freescale' ):
@@ -308,7 +313,7 @@ def sanitize(p: str) -> str:
308313 arg = '--version'
309314 elif 'ccomp' in compiler_name :
310315 arg = '-version'
311- elif compiler_name in {'cl2000' , 'cl2000.exe' , 'cl430' , 'cl430.exe' , 'armcl' , 'armcl.exe' }:
316+ elif compiler_name in {'cl2000' , 'cl2000.exe' , 'cl430' , 'cl430.exe' , 'armcl' , 'armcl.exe' , 'cl6x' , 'cl6x.exe' }:
312317 # TI compiler
313318 arg = '-version'
314319 elif compiler_name in {'icl' , 'icl.exe' }:
@@ -428,6 +433,24 @@ def sanitize(p: str) -> str:
428433 return cls (
429434 compiler , version , for_machine , is_cross , info , target ,
430435 exe_wrap , linker = linker )
436+
437+ # must be detected here before clang because TI compilers contain 'clang' in their output and so that they can be detected as 'clang'
438+ ti_compilers = {
439+ 'TMS320C2000 C/C++' : (c .C2000CCompiler , cpp .C2000CPPCompiler , linkers .C2000DynamicLinker ),
440+ 'TMS320C6x C/C++' : (c .C6000CCompiler , cpp .C6000CPPCompiler , linkers .C6000DynamicLinker ),
441+ 'TI ARM C/C++ Compiler' : (c .TICCompiler , cpp .TICPPCompiler , linkers .TIDynamicLinker ),
442+ 'MSP430 C/C++' : (c .TICCompiler , cpp .TICPPCompiler , linkers .TIDynamicLinker )
443+ }
444+ for indentifier , compiler_classes in ti_compilers .items ():
445+ if indentifier in out :
446+ cls = compiler_classes [0 ] if lang == 'c' else compiler_classes [1 ]
447+ lnk = compiler_classes [2 ]
448+ env .coredata .add_lang_args (cls .language , cls , for_machine , env )
449+ linker = lnk (compiler , for_machine , version = version )
450+ return cls (
451+ ccache , compiler , version , for_machine , is_cross , info ,
452+ exe_wrap , full_version = full_version , linker = linker )
453+
431454 if 'clang' in out or 'Clang' in out :
432455 linker = None
433456
@@ -525,19 +548,6 @@ def sanitize(p: str) -> str:
525548 return cls (
526549 ccache , compiler , version , for_machine , is_cross , info ,
527550 exe_wrap , full_version = full_version , linker = l )
528- if 'TMS320C2000 C/C++' in out or 'MSP430 C/C++' in out or 'TI ARM C/C++ Compiler' in out :
529- if 'TMS320C2000 C/C++' in out :
530- cls = c .C2000CCompiler if lang == 'c' else cpp .C2000CPPCompiler
531- lnk = linkers .C2000DynamicLinker
532- else :
533- cls = c .TICCompiler if lang == 'c' else cpp .TICPPCompiler
534- lnk = linkers .TIDynamicLinker
535-
536- env .coredata .add_lang_args (cls .language , cls , for_machine , env )
537- linker = lnk (compiler , for_machine , version = version )
538- return cls (
539- ccache , compiler , version , for_machine , is_cross , info ,
540- exe_wrap , full_version = full_version , linker = linker )
541551 if 'ARM' in out and not ('Metrowerks' in out or 'Freescale' in out ):
542552 cls = c .ArmCCompiler if lang == 'c' else cpp .ArmCPPCompiler
543553 env .coredata .add_lang_args (cls .language , cls , for_machine , env )
0 commit comments