Merge commit 62654cab7 from llvm git (by me):
Restore functionality of --sysroot on FreeBSD after b18cb9c47 After b18cb9c47, clang would sometimes prefer the host C++ includes (e.g. in /usr/include/c++/v1) before those specified via --sysroot. While this behavior may be desirable on Linux, it is not so on FreeBSD, where we make extensive use of --sysroot during the build of the base system. In that case, clang must *not* search outside the sysroot, except for its own internal headers. Add an override addLibCxxIncludePaths() to restore the old behavior, which is to simply append /usr/include/c++/v1 to the specified sysroot. While here, apply clang-format to the FreeBSD specific toolchain files. Fixes PR44923.
This commit is contained in:
parent
ceba62b93d
commit
46bc58a0ff
@ -99,7 +99,8 @@ void freebsd::Assembler::ConstructJob(Compilation &C, const JobAction &JA,
|
||||
case llvm::Triple::sparcel:
|
||||
case llvm::Triple::sparcv9: {
|
||||
std::string CPU = getCPUName(Args, getToolChain().getTriple());
|
||||
CmdArgs.push_back(sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
|
||||
CmdArgs.push_back(
|
||||
sparc::getSparcAsmModeForCPU(CPU, getToolChain().getTriple()));
|
||||
AddAssemblerKPIC(getToolChain(), Args, CmdArgs);
|
||||
break;
|
||||
}
|
||||
@ -388,6 +389,12 @@ unsigned FreeBSD::GetDefaultDwarfVersion() const {
|
||||
return 4;
|
||||
}
|
||||
|
||||
void FreeBSD::addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const {
|
||||
addSystemInclude(DriverArgs, CC1Args,
|
||||
getDriver().SysRoot + "/usr/include/c++/v1");
|
||||
}
|
||||
|
||||
void FreeBSD::addLibStdCxxIncludePaths(
|
||||
const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const {
|
||||
|
@ -59,16 +59,18 @@ class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
|
||||
bool IsObjCNonFragileABIDefault() const override { return true; }
|
||||
|
||||
CXXStdlibType GetDefaultCXXStdlibType() const override;
|
||||
void addLibStdCxxIncludePaths(
|
||||
const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const override;
|
||||
void addLibCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const override;
|
||||
void
|
||||
addLibStdCxxIncludePaths(const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const override;
|
||||
void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
|
||||
llvm::opt::ArgStringList &CmdArgs) const override;
|
||||
void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs,
|
||||
llvm::opt::ArgStringList &CC1Args) const override;
|
||||
|
||||
llvm::ExceptionHandling GetExceptionModel(
|
||||
const llvm::opt::ArgList &Args) const override;
|
||||
llvm::ExceptionHandling
|
||||
GetExceptionModel(const llvm::opt::ArgList &Args) const override;
|
||||
bool IsUnwindTablesDefault(const llvm::opt::ArgList &Args) const override;
|
||||
bool isPIEDefault() const override;
|
||||
SanitizerMask getSupportedSanitizers() const override;
|
||||
|
Loading…
Reference in New Issue
Block a user