Skip to content

Commit

Permalink
Merge pull request #13681 from EngJay/13678-fix-ti-cgt-support
Browse files Browse the repository at this point in the history
Fix TI C2000 support
  • Loading branch information
jpakkane authored Oct 30, 2024
2 parents 1840bb0 + 02960bc commit 1feb771
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
11 changes: 11 additions & 0 deletions mesonbuild/backend/ninjabackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -3555,6 +3555,17 @@ def generate_link(self, target: build.BuildTarget, outname, obj_list, linker: T.
for t in target.link_depends])
elem = NinjaBuildElement(self.all_outputs, outname, linker_rule, obj_list, implicit_outs=implicit_outs)
elem.add_dep(dep_targets + custom_target_libraries)

# Compiler args must be included in TI C28x linker commands.
if linker.get_id() in {'c2000', 'c6000', 'ti'}:
compile_args = []
for for_machine in MachineChoice:
clist = self.environment.coredata.compilers[for_machine]
for langname, compiler in clist.items():
if langname in {'c', 'cpp'} and compiler.get_id() in {'c2000', 'c6000', 'ti'}:
compile_args += self.generate_basic_compiler_args(target, compiler)
elem.add_item('ARGS', compile_args)

elem.add_item('LINK_ARGS', commands)
self.create_target_linker_introspection(target, linker, commands)
return elem
Expand Down
4 changes: 2 additions & 2 deletions mesonbuild/compilers/mixins/clike.py
Original file line number Diff line number Diff line change
Expand Up @@ -1034,8 +1034,8 @@ def get_library_naming(self, env: 'Environment', libtype: LibType, strict: bool
elif env.machines[self.for_machine].is_cygwin():
shlibext = ['dll', 'dll.a']
prefixes = ['cyg'] + prefixes
elif self.id.lower() == 'c6000' or self.id.lower() == 'ti':
# TI C6000 compiler can use both extensions for static or dynamic libs.
elif self.id.lower() in {'c6000', 'c2000', 'ti'}:
# TI C28x compilers can use both extensions for static or dynamic libs.
stlibext = ['a', 'lib']
shlibext = ['dll', 'so']
else:
Expand Down
3 changes: 3 additions & 0 deletions mesonbuild/linkers/linkers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ class StaticLinker:
def __init__(self, exelist: T.List[str]):
self.exelist = exelist

def get_id(self) -> str:
return self.id

def compiler_args(self, args: T.Optional[T.Iterable[str]] = None) -> CompilerArgs:
return CompilerArgs(self, args)

Expand Down

0 comments on commit 1feb771

Please sign in to comment.