From: rblx-kbuck <104043214+rblx-kbuck@users.noreply.github.com> Date: Fri, 28 Oct 2022 18:41:28 +0000 (-0700) Subject: fix: Process the argument following a -Xarch argument (#1199) X-Git-Tag: v4.7.2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=326256f2eba4f9b0d2219484d24eca51f4763c65;p=thirdparty%2Fccache.git fix: Process the argument following a -Xarch argument (#1199) Since there are already checks enforcing that all -Xarch arguments match each other and -arch, we can assume that the compiler would also interpret the following argument, so ccache should interpret it too. Fixes #1198. --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index b095b7a71..e26ca590d 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -385,8 +385,6 @@ process_option_arg(const Context& ctx, return Statistic::unsupported_compiler_option; } state.common_args.push_back(args[i]); - state.common_args.push_back(args[i + 1]); - ++i; return Statistic::none; } diff --git a/test/suites/multi_arch.bash b/test/suites/multi_arch.bash index e37b12fe6..058bae2a7 100644 --- a/test/suites/multi_arch.bash +++ b/test/suites/multi_arch.bash @@ -47,6 +47,10 @@ SUITE_multi_arch() { expect_stat direct_cache_hit 3 expect_stat cache_miss 4 + # The parameter following -Xarch should be processed. + $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -analyze -I. -c test1.c + expect_stat unsupported_compiler_option 1 + # ------------------------------------------------------------------------- TEST "cache hit, preprocessor mode"