As joerg said, you can create a "specs" file and change the default crt you want to use. And the specs file is different in any gcc version
In case there are GCC distributions with missing "specs" file (why?) you can use
gcc -dumpspecs > specs
, store it (the internal defaults of the GCC executable you are using) to the appropriate path (sorry, I don't remember where it is, or should be, and it might be a different path in different versions of GCC) and use that as a start: You can change anything there you want, add additional C libraries, change the default C library, etc.
Edited by joerg on 2026/6/18 20:37:24 Edited by joerg on 2026/6/18 20:37:43
I did a fast check on the generated gcc packages as they come from adtools and there is no specs file included. I am goin to recompile one of them and see if that was skipped when the archive was created.
To be honest, I was not aware that a file called specs existed and could be used like what you guys describe. I will let you know if I find anything.
I did a fast check on the generated gcc packages as they come from adtools and there is no specs file included.
GCC does not come with an external specs file; it uses built-in specs (those which are printed by the '-dumpspecs' option). However, if it finds an external specs file when it's run, it will use that instead of/in addition to the built-in specs. This lets you create your own specs that add to or override the built-in ones. Typically you would do this by using '-dumpspecs' to get a copy of the built-in specs as joerg describes, and then modifying them as needed. The specs commands are described in the GCC docs.
I have a non-standard SDK/GCC layout (I'm just weird that way), and have long used my own custom specs file to tell GCC about my layout. One issue I ran across -- which might not be a problem with a standard SDK layout -- is that GCC seems to look in different places for the specs file, depending on how it was run. If run from the shell it looks in one place, while if run from Make it looks in a different place. As a result, I have to have a copy of my specs file in both places.
Quote:
...store [the specs file] to the appropriate path (sorry, I don't remember where it is, or should be, and it might be a different path in different versions of GCC)...
You can use Snoopy to discover where GCC looks for a specs file.
I have a new native port of the make v4.4.1 ready, and I would love feedback. If you would like to test it with your projects and give me your feedback, that would be great. You may find it at https://git.walkero.gr/walkero/make/releases/tag/4.4.1-beta3
Make sure to backup the older make and gmake executables from the SDK:C/ folder.
This will be included in future SDK Addon releases, that's why I share it in the topic.