I am using the Synopsis ARC compiler for a multi-core (two cores) application, and I have a startup.s file written in assembly. To distinguish the behavior for the application on different cores, I pass -DCORE_C0 and -DCORE_C1 to start.s. The CMake build system generates two object files: /build/bin/DEBUG/AppCore0/CMakeFiles/startup.s.o and /build/bin/DEBUG/AppCore1/CMakeFiles/startup.s.o.
With CCACHE disabled:
For CORE-0:
C:\arc\bin\ccac.exe -DCORE_C0 -ID:\git\sdk\hal\device\hb_common -ID:\git\sdk\lib\common\src\cjson -arcv2em -Werror=return-type -O -o /build/bin/DEBUG/AppCore0/CMakeFiles/startup.s.o -c D:\git\sdk\hal\startup.s
For CORE-1:
C:\arc\bin\ccac.exe -DCORE_C1 -ID:\git\sdk\hal\device\hb_common -ID:\git\sdk\lib\common\src\cjson -arcv2em -Werror=return-type -O -o /build/bin/DEBUG/AppCore1/CMakeFiles/startup.s.o -c D:\git\sdk\hal\startup.s
The content of both object files is different, as expected, and the application works fine.
With CCACHE enabled:
For CORE-0:
C:/ccache/ccache.exe C:\arc\bin\ccac.exe -DCORE_C0 -ID:\git\sdk\hal\device\hb_common -ID:\git\sdk\lib\common\src\cjson -arcv2em -Werror=return-type -O -o /build/bin/DEBUG/AppCore0/CMakeFiles/startup.s.o -c D:\git\sdk\hal\startup.s
For CORE-1:
C:/ccache/ccache.exe C:\arc\bin\ccac.exe -DCORE_C1 -ID:\git\sdk\hal\device\hb_common -ID:\git\sdk\lib\common\src\cjson -arcv2em -Werror=return-type -O -o /build/bin/DEBUG/AppCore1/CMakeFiles/startup.s.o -c D:\git\sdk\hal\startup.s
The content of both object files is the same, and the application is not working.
Please help to fix this issue, is it possible to tell CCACHE not to cache *.s file, or any other solution.
I tried to check if CCACHE is configured to handle assembly files properly. I have added the following line to CMakeLists.txt file to exclude .s files from being cached:
set_property(SOURCE startup.s PROPERTY LANGUAGE ASM)