From: Joel Rosdahl Date: Mon, 6 Jun 2022 20:23:00 +0000 (+0200) Subject: fix: Fall back to compiler when producing assembler listing file X-Git-Tag: v4.6.2~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c532b79d60c8f22e4a66d8f93b927f79e88b94dd;p=thirdparty%2Fccache.git fix: Fall back to compiler when producing assembler listing file Ccache currently doesn't store the listing produced by -Wa,...=file, so fall back to running the real compiler. See #1083. (cherry picked from commit b36a81893c6f2cd20087815df2ddeb56dd547813) --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index 2e0e4b37d..5bc277060 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -404,6 +404,13 @@ process_arg(const Context& ctx, ++i; } + if (util::starts_with(args[i], "-Wa,") + && args[i].find('=') != std::string::npos) { + LOG("Assembler listing file (-Wa,...=file) is currently not supported: {}", + args[i]); + return Statistic::unsupported_compiler_option; + } + // Handle options that should not be passed to the preprocessor. if (compopt_affects_compiler_output(args[i])) { state.compiler_only_args.push_back(args[i]); diff --git a/test/suites/base.bash b/test/suites/base.bash index b2d914951..89cddf3e8 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -1323,6 +1323,30 @@ EOF expect_stat cache_miss 0 expect_stat called_for_preprocessing 1 + # ------------------------------------------------------------------------- + if $COMPILER -c -Wa,-a test1.c >&/dev/null; then + TEST "-Wa,-a" + + $CCACHE_COMPILE -c -Wa,-a test1.c >first.lst + expect_stat preprocessed_cache_hit 0 + expect_stat cache_miss 1 + + $CCACHE_COMPILE -c -Wa,-a test1.c >second.lst + expect_stat preprocessed_cache_hit 1 + expect_stat cache_miss 1 + expect_equal_content first.lst second.lst + fi + + # ------------------------------------------------------------------------- + if $COMPILER -c -Wa,-a=test1.lst test1.c >&/dev/null; then + TEST "-Wa,-a=file" + + $CCACHE_COMPILE -c -Wa,-a=test1.lst test1.c + expect_stat preprocessed_cache_hit 0 + expect_stat cache_miss 0 + expect_stat unsupported_compiler_option 1 + fi + # ------------------------------------------------------------------------- TEST "-Wp,-P"