riscv64-multilib-empty

===================================================================

Gbp-Pq: Name riscv64-multilib-empty.patch
This commit is contained in:
Ubuntu Developers 2022-07-16 17:45:45 +08:00 committed by Lu zhiping
parent b48d691290
commit 67ec5936da
1 changed files with 14 additions and 7 deletions

View File

@ -1570,13 +1570,16 @@ static void findRISCVBareMetalMultilibs(const Driver &D,
Result.Multilibs = RISCVMultilibs;
}
static void findRISCVMultilibs(const Driver &D,
static bool findRISCVMultilibs(const Driver &D,
const llvm::Triple &TargetTriple, StringRef Path,
const ArgList &Args, DetectedMultilibs &Result) {
if (TargetTriple.getOS() == llvm::Triple::UnknownOS)
return findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result);
if (TargetTriple.getOS() == llvm::Triple::UnknownOS) {
findRISCVBareMetalMultilibs(D, TargetTriple, Path, Args, Result);
return true;
}
FilterNonExistent NonExistent(Path, "/crtbegin.o", D.getVFS());
Multilib Default;
Multilib Ilp32 = makeMultilib("lib32/ilp32").flag("+m32").flag("+mabi=ilp32");
Multilib Ilp32f =
makeMultilib("lib32/ilp32f").flag("+m32").flag("+mabi=ilp32f");
@ -1587,7 +1590,7 @@ static void findRISCVMultilibs(const Driver &D,
Multilib Lp64d = makeMultilib("lib64/lp64d").flag("+m64").flag("+mabi=lp64d");
MultilibSet RISCVMultilibs =
MultilibSet()
.Either({Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d})
.Either({Default, Ilp32, Ilp32f, Ilp32d, Lp64, Lp64f, Lp64d})
.FilterOut(NonExistent);
Multilib::flags_list Flags;
@ -1603,8 +1606,11 @@ static void findRISCVMultilibs(const Driver &D,
addMultilibFlag(ABIName == "lp64f", "mabi=lp64f", Flags);
addMultilibFlag(ABIName == "lp64d", "mabi=lp64d", Flags);
if (RISCVMultilibs.select(Flags, Result.SelectedMultilib))
Result.Multilibs = RISCVMultilibs;
if (!RISCVMultilibs.select(Flags, Result.SelectedMultilib))
return false;
Result.Multilibs = RISCVMultilibs;
return true;
}
static bool findBiarchMultilibs(const Driver &D,
@ -2382,7 +2388,8 @@ bool Generic_GCC::GCCInstallationDetector::ScanGCCForMultilibs(
if (!findMIPSMultilibs(D, TargetTriple, Path, Args, Detected))
return false;
} else if (TargetTriple.isRISCV()) {
findRISCVMultilibs(D, TargetTriple, Path, Args, Detected);
if (!findRISCVMultilibs(D, TargetTriple, Path, Args, Detected))
return false;
} else if (isMSP430(TargetArch)) {
findMSP430Multilibs(D, TargetTriple, Path, Args, Detected);
} else if (TargetArch == llvm::Triple::avr) {