“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)
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;
}