]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Process the argument following a -Xarch argument (#1199)
authorrblx-kbuck <104043214+rblx-kbuck@users.noreply.github.com>
Fri, 28 Oct 2022 18:41:28 +0000 (11:41 -0700)
committerGitHub <noreply@github.com>
Fri, 28 Oct 2022 18:41:28 +0000 (20:41 +0200)
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.

src/argprocessing.cpp
test/suites/multi_arch.bash

index b095b7a71d118084f224893b468c2d3941578acf..e26ca590df760b0bd421fda79c075938bb8d8407 100644 (file)
@@ -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;
   }
 
index e37b12fe6b8b797254f643e2a110739bf97a7081..058bae2a70dae3851f86a015645040d454d70525 100644 (file)
@@ -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"