diff options
| author | Jussi Pakkanen <jpakkane@gmail.com> | 2024-10-30 12:05:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 12:05:41 +0200 |
| commit | 1feb771f06ade5d0c721022c11fa76f5a7dd8fcb (patch) | |
| tree | e7014b4ca914c15a06275f55c2ca2c43a985a050 | |
| parent | 1840bb02ba741fb62a8d613a71431a8d7fa86a00 (diff) | |
| parent | 02960bc4493238886fbe0b3d09a2ba405d791246 (diff) | |
| download | meson-1feb771f06ade5d0c721022c11fa76f5a7dd8fcb.tar.gz | |
Merge pull request #13681 from EngJay/13678-fix-ti-cgt-support
Fix TI C2000 support
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 11 | ||||
| -rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 4 | ||||
| -rw-r--r-- | mesonbuild/linkers/linkers.py | 3 |
3 files changed, 16 insertions, 2 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index f29af251e..cb3552d7f 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -3555,6 +3555,17 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) 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 diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index f0515a9bd..d56547b47 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -1034,8 +1034,8 @@ class CLikeCompiler(Compiler): 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: diff --git a/mesonbuild/linkers/linkers.py b/mesonbuild/linkers/linkers.py index c4df0fa1d..d0ffc5618 100644 --- a/mesonbuild/linkers/linkers.py +++ b/mesonbuild/linkers/linkers.py @@ -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) |
