Skip to content
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

Added support for Texas Instruments C6000 compiler. #12246

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Machapet
Copy link

@Machapet Machapet commented Sep 12, 2023

Created new compiler and linker classes:

  • C6000CCompiler
  • C6000CPPCompiler
  • C6000Linker
  • C6000DynamicLinker

It was necessary the compiler can detect both extension for static libs (*.a, .lib) and for dynamic libs (.dll, *.so) => added function is_baremetal()

Added new cpu family 'c6000' into known_cpu_families for which the C6000 compiler is used (https://www.ti.com/tool/C6000-CGT)

cross/ti-c6000.txt Outdated Show resolved Hide resolved
mesonbuild/utils/universal.py Outdated Show resolved Hide resolved
docs/markdown/Reference-tables.md Outdated Show resolved Hide resolved
mesonbuild/compilers/detect.py Outdated Show resolved Hide resolved
@tristan957
Copy link
Contributor

Please squash the commits too!

@tristan957 tristan957 added this to the 1.3.0 milestone Sep 12, 2023
mesonbuild/compilers/detect.py Outdated Show resolved Hide resolved
mesonbuild/compilers/mixins/clike.py Outdated Show resolved Hide resolved
cross/ti-c6000.txt Show resolved Hide resolved
@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch 2 times, most recently from 2aa9b93 to 678d16e Compare September 14, 2023 07:41
@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch 3 times, most recently from e744727 to 33dc8bf Compare September 14, 2023 12:50
@tristan957
Copy link
Contributor

This looks pretty clean. I marked it on the 1.3.0 milestone, so hopefully someone with merge powers can come through and click the button!

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from 33dc8bf to dbe6361 Compare September 15, 2023 04:48
@tristan957
Copy link
Contributor

Would you mind adding a release snippet?

mesonbuild/envconfig.py Outdated Show resolved Hide resolved
@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from dbe6361 to 5b0f6e0 Compare September 29, 2023 06:57
@Machapet
Copy link
Author

Machapet commented Sep 29, 2023

Would you mind adding a release snippet?

Well... but how to do it? Just write here into this conversation? Or should I do it some special way? I'm sorry, I'm new to these processes on github :-).

@tristan957
Copy link
Contributor

@Machapet look in docs/markdown/snippets and add a new file there.

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from 5b0f6e0 to 3c90c55 Compare October 2, 2023 10:31
cross/ti-c6000.txt Outdated Show resolved Hide resolved
@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from 3c90c55 to d484ea4 Compare October 2, 2023 13:23
@mon
Copy link
Contributor

mon commented Oct 10, 2023

I see you've copied the comment I left on the C2000 compiler:
# Required for backwards compat with projects created before ti-cgt support existed

Ideally, all TI compilers should now be pretty much supported, though I see you probably have to add the compiler .exe name at least. Does it work if you use the TI armclang PR I made in #11421 (which in an ideal world would also make it into 1.3) ?

@mon
Copy link
Contributor

mon commented Oct 10, 2023

You may also need to combine it with my other pending PR, #11942 - which removes the linker name requirement entirely (compiler name is still needed for detection though, which could be fixed)

@Machapet
Copy link
Author

I see you've copied the comment I left on the C2000 compiler: # Required for backwards compat with projects created before ti-cgt support existed

Ideally, all TI compilers should now be pretty much supported, though I see you probably have to add the compiler .exe name at least. Does it work if you use the TI armclang PR I made in #11421 (which in an ideal world would also make it into 1.3) ?

I'm not sure if I understand what I'm expected to do. Currently we are not using TI armclang as it was not suitable for us, but neither me nor my collegues don't remember what was the reason, it is more than 1 1/2 year. We are also using TI-CGT v20.0.6.LTS (armcl, armar...) for some AM1X based devices (TI ARM) and there were no problems to use Meson with this compiler. Have I answered your question?

@mon
Copy link
Contributor

mon commented Oct 11, 2023

I'm not sure if I understand what I'm expected to do

Sorry for the confusion. If the c6000 compiler must be different from the "generic" TI-CGT implementation (i.e. your modifications to stlibext and shlibext are required for it to work), then you should remove the comment # Required for backwards compat, since this is incorrect.

If the c6000 compiler can be treated the same as other ti-cgt compilers, then I think it would be good to remove the C6000 classes (CCompiler/CPPCompiler/Linker/DynamicLinker) and simply use the TICompiler classes.

The misidentification of TI armclang that you moved the code to line 442 for should be solved by my armclang support PR, though it shouldn't really change your use of ti-cgt.

@Machapet
Copy link
Author

I'm not sure if I understand what I'm expected to do

Sorry for the confusion. If the c6000 compiler must be different from the "generic" TI-CGT implementation (i.e. your modifications to stlibext and shlibext are required for it to work), then you should remove the comment # Required for backwards compat, since this is incorrect.

If the c6000 compiler can be treated the same as other ti-cgt compilers, then I think it would be good to remove the C6000 classes (CCompiler/CPPCompiler/Linker/DynamicLinker) and simply use the TICompiler classes.

The misidentification of TI armclang that you moved the code to line 442 for should be solved by my armclang support PR, though it shouldn't really change your use of ti-cgt.

I'm afraid I cannot remove my "C6000" classes. I tried to apply your changes into my code without my classes and did not work:
Unable to detect linker for compiler cl6x -Wl,--version. So I remove the comment # Required for backwards compat

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from d484ea4 to fb830ec Compare October 16, 2023 04:47
@xclaesse xclaesse modified the milestones: 1.3.0, 1.4.0 Oct 17, 2023
@Machapet
Copy link
Author

I pushed minor changes (only remove some #comments) and some checks did not pass (https://github.com/mesonbuild/meson/actions/runs/6529125143/job/17726319329?pr=12246, https://github.com/mesonbuild/meson/actions/runs/6529125144/job/17726319000?pr=12246). Where is the problem?

@tristan957
Copy link
Contributor

@Machapet the CI is flaky. Your changes probably didn't do anything to cause the failures.

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch 2 times, most recently from 1099cea to 23b8d3c Compare December 11, 2023 09:13
@tristan957
Copy link
Contributor

Pylint job is failing. Also squash your commits.

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from 23b8d3c to b1dd1b0 Compare December 18, 2023 07:16
@Machapet
Copy link
Author

Pylint job is failing. Also squash your commits.

Af for the squash... The commit b1dd1b0 is a result of automatic merge with master (there were some merge conflicts I have already resolved). So should I really squash the 9869131 and b1dd1b0. The last commit contains all the changed from master...

@eli-schwartz
Copy link
Member

Are you going to remove the merge commit?

@dcbaker
Copy link
Member

dcbaker commented Feb 23, 2024

Can you rebase this? I think this has been reviewed and can be merged

@Machapet
Copy link
Author

Can you rebase this? I think this has been reviewed and can be merged

I'm sorry but what I'm expected to do now? I'm still not familiar with the github workflow. I tried to follow the instructions from here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request but I can't see any options at my pull request.

@an-dr
Copy link

an-dr commented Feb 27, 2024

Can you rebase this? I think this has been reviewed and can be merged

I'm sorry but what I'm expected to do now? I'm still not familiar with the github workflow. I tried to follow the instructions from here: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/incorporating-changes-from-a-pull-request/merging-a-pull-request but I can't see any options at my pull request.

Hey! It's super simple:

  1. Sync your fork's main
    https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

  2. Rebase to the updated main.

@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch 3 times, most recently from 0507abf to f7233fd Compare February 27, 2024 20:49
@Machapet Machapet force-pushed the pm-TI-C6000-compiler-support branch from f7233fd to f90580f Compare February 27, 2024 21:46
@jpakkane jpakkane merged commit eb74bb8 into mesonbuild:master Mar 12, 2024
36 checks passed
mon added a commit to mon/meson that referenced this pull request Apr 3, 2024
When C6000 support was added in mesonbuild#12246, TI compilers were given the correct version argument.
This broke the previous check which relied on an error being thrown by the compiler.
soumyaDghosh pushed a commit to soumyaDghosh/meson that referenced this pull request Jun 4, 2024
When C6000 support was added in mesonbuild#12246, TI compilers were given the correct version argument.
This broke the previous check which relied on an error being thrown by the compiler.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants