From: Steve Mokris Date: Wed, 29 Dec 2021 13:56:45 +0000 (-0500) Subject: fix: Remove duplicate -Xarch second argument (#981) X-Git-Tag: v4.6~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21b2be2104a140260fe274f1eed00d91b5425de7;p=thirdparty%2Fccache.git fix: Remove duplicate -Xarch second argument (#981) --- diff --git a/src/argprocessing.cpp b/src/argprocessing.cpp index 0e2898e51..3ab7c5edd 100644 --- a/src/argprocessing.cpp +++ b/src/argprocessing.cpp @@ -340,7 +340,7 @@ process_arg(const Context& ctx, return Statistic::unsupported_compiler_option; } state.common_args.push_back(args[i]); - state.common_args.push_back(args[i + 1]); + state.common_args.push_back(args[++i]); return nullopt; } diff --git a/test/suites/multi_arch.bash b/test/suites/multi_arch.bash index 2f5c77bb2..9a705cd3e 100644 --- a/test/suites/multi_arch.bash +++ b/test/suites/multi_arch.bash @@ -37,9 +37,11 @@ SUITE_multi_arch() { expect_stat cache_miss 3 # A single -Xarch_* matching -arch is supported. - $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c + CCACHE_DEBUG=1 $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c expect_stat direct_cache_hit 2 expect_stat cache_miss 4 + expect_contains test1.o.ccache-log "clang -Xarch_x86_64 -I. -arch x86_64 -E test1.c" + expect_not_contains test1.o.ccache-log "clang -Xarch_x86_64 -I. -I. -arch x86_64 -E test1.c" $CCACHE_COMPILE -arch x86_64 -Xarch_x86_64 -I. -c test1.c expect_stat direct_cache_hit 3