I have to target Tricore for some of my work. As far as I know, only Greenhills has an Ada compiler that supports it. But I’ve been curious why GCC couldn’t target it as well.
The build works and completes fine without Ada as a selected language. So I’m not sure what else is configured in this script that might be incompatible.
Does this error seem familiar to anyone? Is it something obvious to avoid when building an Ada toolchain? Or is it just that fundamentally the Ada support isn’t compatible with this architecture?
I’m unaware of any tricore toolchain vendor that supports Ada other than Greenhills. But, to be honest, I also have no idea what’s involved in making one language work and not the others.
I guess it isn’t just a simple matter then. Oh well.
You would need to go into the gcc internals docs to extend GCC to support it (I hope you like lisp as c macros?) then extend GNAT (start at the gcc-interface dir) to extend that.
That’s the repo I’m using. They have a meta repo with a build script. I just added Ada to the enabled languages in that and crossed my fingers basically.
Stage 1 “apparently” builds, but I don’t have gnatmake, and gcc -c hello.ada tells me that an Ada compiler isn’t available. In ‘bin’ I have a tricore-elf-gnatbind but no other gnat tools that I can tell.
This is the script I use for building a cross-to-arm-eabi compiler; the part that took me a long time to get right (thanks, Arnaud!) was line 38,
make -w -C gcc cross-gnattools ada.all.cross
The normal recommendation is that you use a native compiler at the same release as the one you’re trying to build, but if you’ve got gnatbind things must be looking good!
So when looking over the Makefile.rtl file, I didn’t exactly see a good template to start from. @Lucretia your example with vxworks lines is perfectly clear, but the section in the file for *-elf only has a single line.
I’ll have to learn a bit more about which lines I need to adapt I think. The *-elf section was my first thought for a bare-metal target.
I’ve had a look, but it’s all changed since I last looked, about 10-20 years ago. There used to be files with mlib in the name, tgt means target specific and there were files with that name too, iirc, so I don’t know it they’re generated, most likely. But IIRC, there was a rule that used to have something like tgt-mlib in it and you had to set that up for your target.
Probably best to do a find in the build fir for ‘mlib’ and ‘tgt’ and then ls -l them to see where they’re linked to if they exist and try to find the makefile location that way, you might also have to look in the generated makefiles to find them.