Hi, i now understand your problem...
Sadly i don't see a easy solution. There are multiple problems we have to solve.
As stahta01 mentioned your old codeblocks version is not a normal codeblocks, but a fork. We have no information about how this fork works so we can not apply this in "normal" codeblocks.
I also do not understand how this fork distinguishes between when he should use the "--via" text file and when the internal object file lists.
"Our" codeblocks version always puts the object files to the "ar" command so the command line gets to long, also when you use the via command. If you remove the object file list from the command obviously normal compiling will not work.
Lets try to find a solution:
1) The command line to the linker is to long, so lets try to shorten it:
Solution:
In the project file you provided there are ca 800 files. The mean filename length is 8 characters so it should be possible to limit the object file length to a length so that the command line does not exceed the windows limit. You can shorten the object output folder path to something like
.o\$(PROJECT_NAME)\
in Project->Properties->Build targets->Objects output dir
this should reduce the file length. With this you do not need the --via command line
Problems:
This solution is not quite problem resistant. Add some files and your build process is broken again...
2) Use always the --via command:
As stahta01 showed in your post use this command in the advanced compiler options
cmd /c if exist $static_output del $static_output
$lib_linker -r -s $static_output $link_options
but now you have to generate a text file with object files for all your projects.
2.1) A intermediate way would be to use a different compiler for the targets with many object files and the normal options for "short" projects
2.2) You can generate the object file list with codeblocks scripting so this all can be made quite transparent
3) Use makefiles for all this and use a custom makefile project
PS. How do you generate this text file with the object files? From hand?