/// triple.
Generic_GCC::GCCInstallationDetector::GCCInstallationDetector(
const Driver &D, const llvm::Triple &TargetTriple, const ArgList &Args)
- : IsValid(false), D(D) {
+ : IsValid(false) {
llvm::Triple BiarchVariantTriple =
TargetTriple.isArch32Bit() ? TargetTriple.get64BitArchVariant()
: TargetTriple.get32BitArchVariant();
// /mips32
// /usr
// /lib <= crt*.o files compiled with '-mips32'
- //
- // Unfortunately different toolchains use different and partially
- // overlapped naming schemes. So we have to make a trick for detection
- // of using toolchain. We lookup a path which unique for each toolchains.
-
- bool IsMentorToolChain = hasCrtBeginObj(Path + "/mips16/soft-float");
- bool IsFSFToolChain = hasCrtBeginObj(Path + "/mips32/mips16/sof");
- if (IsMentorToolChain && IsFSFToolChain)
- D.Diag(diag::err_drv_unknown_toolchain);
+ // Check FSF Toolchain path
+ Suffix.clear();
+ if (TargetArch == llvm::Triple::mips ||
+ TargetArch == llvm::Triple::mipsel) {
+ if (isMicroMips(Args))
+ Suffix += "/micromips";
+ else if (isMips32r2(Args))
+ Suffix += "";
+ else
+ Suffix += "/mips32";
- if (IsMentorToolChain) {
if (isMips16(Args))
Suffix += "/mips16";
- else if (isMicroMips(Args))
- Suffix += "/micromips";
+ } else {
+ if (isMips64r2(Args))
+ Suffix += hasMipsN32ABIArg(Args) ? "/mips64r2" : "/mips64r2/64";
+ else
+ Suffix += hasMipsN32ABIArg(Args) ? "/mips64" : "/mips64/64";
+ }
- if (isSoftFloatABI(Args))
- Suffix += "/soft-float";
-
- if (TargetArch == llvm::Triple::mipsel ||
- TargetArch == llvm::Triple::mips64el)
- Suffix += "/el";
- } else if (IsFSFToolChain) {
- if (TargetArch == llvm::Triple::mips ||
- TargetArch == llvm::Triple::mipsel) {
- if (isMicroMips(Args))
- Suffix += "/micromips";
- else if (isMips32r2(Args))
- Suffix += "";
- else
- Suffix += "/mips32";
+ if (TargetArch == llvm::Triple::mipsel ||
+ TargetArch == llvm::Triple::mips64el)
+ Suffix += "/el";
- if (isMips16(Args))
- Suffix += "/mips16";
- } else {
- if (isMips64r2(Args))
- Suffix += hasMipsN32ABIArg(Args) ? "/mips64r2" : "/mips64r2/64";
- else
- Suffix += hasMipsN32ABIArg(Args) ? "/mips64" : "/mips64/64";
- }
+ if (isSoftFloatABI(Args))
+ Suffix += "/sof";
+ else {
+ if (isMipsFP64(Args))
+ Suffix += "/fp64";
- if (TargetArch == llvm::Triple::mipsel ||
- TargetArch == llvm::Triple::mips64el)
- Suffix += "/el";
+ if (isMipsNan2008(Args))
+ Suffix += "/nan2008";
+ }
- if (isSoftFloatABI(Args))
- Suffix += "/sof";
- else {
- if (isMipsFP64(Args))
- Suffix += "/fp64";
+ if (hasCrtBeginObj(Path + Suffix))
+ return;
- if (isMipsNan2008(Args))
- Suffix += "/nan2008";
- }
- }
+ // Check Code Sourcery Toolchain path
+ Suffix.clear();
+ if (isMips16(Args))
+ Suffix += "/mips16";
+ else if (isMicroMips(Args))
+ Suffix += "/micromips";
+
+ if (isSoftFloatABI(Args))
+ Suffix += "/soft-float";
+
+ if (TargetArch == llvm::Triple::mipsel ||
+ TargetArch == llvm::Triple::mips64el)
+ Suffix += "/el";
+
+ if (hasCrtBeginObj(Path + Suffix))
+ return;
- if (!hasCrtBeginObj(Path + Suffix))
- Suffix.clear();
+ Suffix.clear();
}
void Generic_GCC::GCCInstallationDetector::ScanLibDirForGCCTriple(