armcc 5.0.4.82 on Win7
When armcc links, I get the following error message (formatted by CMake/ninja)
Error: C4365E: Subtool invocation error: Command line too long
This error message is not described for armccor armlink
The command line is as follows (there are more options normally, but I get the error only with the following):
d:\ARM_Compiler_5\5.0.4.82\bin64\armcc.exe --cpu=Cortex-A9 --via=out.rsp -o out.elf
If the file in --via is more than about 32767 bytes, the linking fails.
The command is run from cmd.exe, but armcc should parse the --via file by itself to my knowledge.
A very temporary workaround is to move the objectfiles before linking, so the path can be shortened. Will fail again when number of files increases.
/Gerhard
Wow that's quite some size of command line. The mind boggles over what size the eventual program will be.
Anyway I believe that that amcc has come across the WIndows operating system limit on the length of UNICODE_STRING which is 32767. The only way I can think of that it can get round that is by putting the parameters into another via file of their own if they are more than that size when calling down to the executables below. So yep raise that with ARM support..
Did you try calling armlink with a -via directly from the make instead of using armcc? I';d have thought that should work okay
The current workaround is to shorten the path length, CMake/ninja uses the full source path when creating the object file path as a subdirectory of the build. So it works a short time still.
The file referred to by --via is generated by ninja, it is hard to intercept the generation and split to several files. It might be possible to patch the rules.ninja file to achieve this though, armcc is started by cmd.exe (some calls to Cygwin head and tail, creating more files to use with --via).
I get the same problem when starting link directly from cmd. The "out.rsp" file is in Windows format.
Will contact ARM support - once I find who has the support details here...
It is a pity the call to armlink with -via fails as well. That must also call something else to do the actual work.
It is possible to create a number of partially linked files which are then all linked together. I see you are saying it is hard to split the make up like that but it might be worth another try.
I had a quick look on the web about the problem and you can see some nasty tricks people have coded to use on Windows besides havng a via file, nothing to help you though I'm afraid.
How do I pass a lot of data to a process when it starts up? - The Old New Thing - Site Home - MSDN Blogs
Response from ARM support:
* Use "armcc --via=<file1>" for command-line arguments that are to be used by the compiler itself.
* Use "armcc -L--via=<file2>" for command-line arguments that are to be passed from the compiler to the linker.
I expected the via file to be transferred transparently if nothing to compile or not at all. Confusing with this limitation...
So armlink --via doesn't get around the problem but armcc -L--via does? That is rather unexpected. I think I can guess what is happening - there must be an interface program which is basically the same for amcc and armlink and it calls various programs below it, and the --via parameters are read by the top level whereas -L--via file is read by the target linker program. This means it it possible to send this option to the linker via armcc but not armlink. Very strange indeed and probably not what was intended.