From: Joel Rosdahl Date: Wed, 20 May 2020 19:26:35 +0000 (+0200) Subject: Handle all Intel “-xCODE” compiler options correctly X-Git-Tag: v3.7.11~4 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=4abe0cd4477ef633ac7ab0c0fa83b0b0fb379b29;p=thirdparty%2Fccache.git Handle all Intel “-xCODE” compiler options correctly “CODE” in the Intel compiler’s “-xCODE” option for specifying processor features seems to always start with an uppercase letter, and since GCC’s language specifications always are lowercase we can just treat uppercase codes as an ordinary compiler argument. (cherry picked from commit a1964c685ba111ed79f6ae10e85e1e5355068ec5) --- diff --git a/src/ccache.c b/src/ccache.c index c23d2f31a..73509847e 100644 --- a/src/ccache.c +++ b/src/ccache.c @@ -2892,9 +2892,13 @@ cc_process_args(struct args *args, continue; } - if (str_eq(argv[i], "-xHost")) { - // -xHost is an ordinary Intel compiler option, not a language - // specification. + if (strlen(argv[i]) >= 3 + && str_startswith(argv[i], "-x") + && !islower(argv[i][2])) { + // -xCODE (where CODE can be e.g. Host or CORE-AVX2, always starting with + // an uppercase letter) is an ordinary Intel compiler option, not a + // language specification. (GCC's "-x" language argument is always + // lowercase.) args_add(common_args, argv[i]); continue; }