From: Joel Rosdahl Date: Sat, 11 Apr 2026 07:09:35 +0000 (+0200) Subject: fix: Detect hppa2.0-unknown-linux-gnu-gcc as GCC X-Git-Tag: v4.13.3~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a8513fcce55cd4ef1db422de1e9ca547e8028c1b;p=thirdparty%2Fccache.git fix: Detect hppa2.0-unknown-linux-gnu-gcc as GCC Fixes #1721. (cherry picked from commit 13fad3c26e30e1ea7f83f735ba14c2d2a16ed0eb) --- diff --git a/src/ccache/ccache.cpp b/src/ccache/ccache.cpp index 6338ae05..1c03f9e5 100644 --- a/src/ccache/ccache.cpp +++ b/src/ccache/ccache.cpp @@ -317,8 +317,14 @@ probe_generic_compiler(const fs::path& path) static CompilerType do_guess_compiler(const fs::path& path) { - const auto name = util::to_lowercase( - util::pstr(util::with_extension(path.filename(), "")).str()); + const auto filename = util::to_lowercase(util::pstr(path.filename()).str()); + std::string_view name = filename; +#ifdef _WIN32 + if (name.ends_with(".exe")) { + name.remove_suffix(4); + } +#endif + if (name.find("clang-cl") != std::string_view::npos) { return CompilerType::clang_cl; } else if (name.find("clang") != std::string_view::npos) {