Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions clang/lib/Driver/ToolChains/Gnu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3439,3 +3439,18 @@ void Generic_ELF::addClangTargetOptions(const ArgList &DriverArgs,
options::OPT_fno_use_init_array, true))
CC1Args.push_back("-fno-use-init-array");
}

void Generic_ELF::addFortranRuntimeLibs(
const ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const {
// Link static flang_rt.runtime.a or shared flang_rt.runtime.so
const char *Path;
if (getVFS().exists(Twine(Path = getCompilerRTArgString(
Args, "runtime", ToolChain::FT_Static, true))))
CmdArgs.push_back(Path);
else if (getVFS().exists(
Twine(Path = getCompilerRTArgString(
Args, "runtime", ToolChain::FT_Shared, true))))
CmdArgs.push_back(Path);
else
CmdArgs.push_back("-lflang_rt.runtime");
}
2 changes: 2 additions & 0 deletions clang/lib/Driver/ToolChains/Gnu.h
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,8 @@ class LLVM_LIBRARY_VISIBILITY Generic_ELF : public Generic_GCC {
void addClangTargetOptions(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args,
Action::OffloadKind DeviceOffloadKind) const override;
void addFortranRuntimeLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;

virtual std::string getDynamicLinker(const llvm::opt::ArgList &Args) const {
return {};
Expand Down
15 changes: 0 additions & 15 deletions clang/lib/Driver/ToolChains/PPCLinux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,18 +102,3 @@ bool PPCLinuxToolChain::SupportIEEEFloat128(
return GlibcSupportsFloat128((Twine(D.DyldPrefix) + Linker).str()) &&
!(D.CCCIsCXX() && HasUnsupportedCXXLib);
}

void PPCLinuxToolChain::addFortranRuntimeLibs(
const ArgList &Args, llvm::opt::ArgStringList &CmdArgs) const {
// Link static flang_rt.runtime.a or shared flang_rt.runtime.so
const char *Path;
if (getVFS().exists(Twine(Path = getCompilerRTArgString(
Args, "runtime", ToolChain::FT_Static, true))))
CmdArgs.push_back(Path);
else if (getVFS().exists(
Twine(Path = getCompilerRTArgString(
Args, "runtime", ToolChain::FT_Shared, true))))
CmdArgs.push_back(Path);
else
CmdArgs.push_back("-lflang_rt.runtime");
}
3 changes: 0 additions & 3 deletions clang/lib/Driver/ToolChains/PPCLinux.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ class LLVM_LIBRARY_VISIBILITY PPCLinuxToolChain : public Linux {
AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs,
llvm::opt::ArgStringList &CC1Args) const override;

void addFortranRuntimeLibs(const llvm::opt::ArgList &Args,
llvm::opt::ArgStringList &CmdArgs) const override;

private:
bool SupportIEEEFloat128(const Driver &D, const llvm::Triple &Triple,
const llvm::opt::ArgList &Args) const;
Expand Down