GCC's build system has some configure tests which use -S and then look at the unassembled output. When the test is done a second time, ccache will not have any .S file to write to the filesystem and GCC's configure will fail because it can't find the file it expected. As far as I understand, this could be solved by adding { -S, TOO_HARD } to compopt.c's compopts[].
Hi, ccache has had support for the -S flag since literally day one, so it's supposed to work. I can't reproduce the problem. First I cleared the cache: % ccache -Cz Cleared cache Statistics cleared First compilation via ccache: % rm -f test.*; touch test.c; ccache /usr/bin/gcc -c -S test.c First compilation via ccache produced a test.s file: % ls -l test.* -rw-rw-r-- 1 joel joel 0 Jan 16 16:50 test.c -rw-rw-r-- 1 joel joel 103 Jan 16 16:50 test.s Ccache reports a cache miss: % ccache -s cache directory /home/joel/.ccache primary config /home/joel/.ccache/ccache.conf secondary config (readonly) /usr/local/etc/ccache.conf cache hit (direct) 0 cache hit (preprocessed) 0 cache miss 1 files in cache 2 cache size 8.2 kB max cache size 5.0 GB Second compilation via ccache: % rm test.s; ccache /usr/bin/gcc -c -S test.c The result is as expected: % ls -l test.* -rw-rw-r-- 1 joel joel 0 Jan 16 16:51 test.c -rw-rw-r-- 1 joel joel 103 Jan 16 16:51 test.s Ccache reports a cache hit: % ccache -s cache directory /home/joel/.ccache primary config /home/joel/.ccache/ccache.conf secondary config (readonly) /usr/local/etc/ccache.conf cache hit (direct) 1 cache hit (preprocessed) 0 cache miss 1 files in cache 2 cache size 8.2 kB max cache size 5.0 GB I have also tried running without "-c" (in which case ccache just runs the compiler directly) and with "-o". Both cases work fine. Could you tell me more about what command line GCC's build system uses? Try running with CCACHE_LOGFILE to get some clues.
Closing this now since I can't reproduce the problem. Please create a new issue at https://github.com/ccache/ccache/issues if wanted.