Index: clang/lib/Driver/ToolChains/AVR.cpp =================================================================== --- clang/lib/Driver/ToolChains/AVR.cpp +++ clang/lib/Driver/ToolChains/AVR.cpp @@ -297,12 +297,6 @@ return Optional(); } -const StringRef PossibleAVRLibcLocations[] = { - "/avr", - "/usr/avr", - "/usr/lib/avr", -}; - } // end anonymous namespace /// AVR Toolchain @@ -453,12 +447,9 @@ } llvm::Optional AVRToolChain::findAVRLibcInstallation() const { - for (StringRef PossiblePath : PossibleAVRLibcLocations) { - std::string Path = getDriver().SysRoot + PossiblePath.str(); - // Return the first avr-libc installation that exists. - if (llvm::sys::fs::is_directory(Path)) - return Optional(Path); - } - + std::string GCCRoot(GCCInstallation.getInstallPath()); + std::string Path(GCCRoot + "/../../../avr"); + if (llvm::sys::fs::is_directory(Path)) + return Optional(Path); return llvm::None; }