Went to rebuild an image and updated the project from the old DS5 to a newer Arm Dev Studio (2022.2, this is the customer version so it's a hard requirement that can't be changed). We went from using the internal 16.1 armcc to the standalone 5.06u3 armcc since those are the certified versions required by the customer. The image files generated have different checksums despite using the same compiler. Investigating, the listing files show the same opcodes being generated which was confirmed by a diff of the object files, though there are some differences in the header and footer of the object files. In the master listing file (outfile.lst), files are being compiled/resolved in a different order. Under Arm Dev Studio, main.c is compiled first as it contains the first function encountered after the 'Start:' section, followed by the rest of the Resources. Under DS5, initialize.c and associated the config files went first (first physical files in the project) with main.c actually being the last thing compiled under DS5. It looks like that order difference is carried into the AXF file. Given the updates between the two, we also did change from calling the altera.elmap to using the intel_fpga.elmap.
So the question becomes, is there a way to force the old DS5 order of compilation/link in Arm Dev Studio?
My name is Stephen and I work at Arm.I believe that I've found the solution. I suspect the original DS-5 project was subtly modified and setup as follows:1. Select project > Properties > C/C++ Build > Settings > Arm Linker2. In Expert settings: Command line pattern, change${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}to${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}(i.e. remove " ${INPUTS}")3. Then select Arm Linker > Miscellaneous.Under Other flags, add--via=makefile.armlink.exe.inputsThis seems to produce the desired behavior.If you need more help then I suggest you log-in to the Support > Arm Support Services from the links at the top of this page, and create a Case for the Support team to investigate further.Hope this helpsStephen
That's definitely the right direction: It's now outputting the .inputs file however, it's overwriting it on project build so I'm losing changes. I can bypass the problem by overwriting the .inputs after launching the project build locally, but that's not a useable solution on the certified build environment (everything is done through scripts so I can't just swap a file out). Any idea of how to keep the file if it already exists or read an unmanaged file into the link step?
Hi again,Sorry, I'm not sure what you mean by "It's now outputting the .inputs file". I'd assumed "makefile.armlink.exe.inputs" was a static file that you had made by hand, containing the objects in the order you need them. In my test, I created a "makefile.armlink.exe.inputs" file with a text editor, put it in the root of the project, then added "--via=../makefile.armlink.exe.inputs" to the linker's miscellaneous flags. I don't see this file being updated or overwritten.You can get an initial list of all the objects as a starting point by temporarily restoring " ${INPUTS}" to the Command line pattern, then rebuilding, and looking at the final linker build step in the Console view.If you need more help then I suggest you log-in to the Support > Arm Support Services from the links at the top of this page, and create a Case for the Support team to investigate further.Stephen
I mean it literally will generate the .inputs file if one doesn't exist and overwrite it if does. I didn't use the relative include though: I'm using "--via=makefile.armlink.exe.inputs" so the file is living in the Release configuration's folder, so maybe that's why it's getting (re)generated? The workaround to keep changes was to simply make the file read-only. Simple but does the job.
Okay, so I just tried it with a relative file "--via=../makefile.armlink.exe.inputs" and it does NOT create or modify the file in that case. So the right answer is to wipe out the ${INPUTS} and make sure the argument for "--via" is outside the build configuration's directory. Thanks for the help!
The minor tweak from Stephen's prior answer:
1. Select project > Properties > C/C++ Build > Settings > Arm Linker
2. In Expert settings: Command line pattern, change${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}to${COMMAND} ${FLAGS} ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT}(i.e. remove " ${INPUTS}")3. Then select Arm Linker > Miscellaneous.Under Other flags, add--via=../makefile.armlink.exe.inputs