1 //===--- Linux.h - Linux ToolChain Implementations --------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H 10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H 11 12 #include "Gnu.h" 13 #include "clang/Driver/ToolChain.h" 14 15 namespace clang { 16 namespace driver { 17 namespace toolchains { 18 19 class LLVM_LIBRARY_VISIBILITY Linux : public Generic_ELF { 20 public: 21 Linux(const Driver &D, const llvm::Triple &Triple, 22 const llvm::opt::ArgList &Args); 23 24 bool HasNativeLLVMSupport() const override; 25 26 void 27 AddClangSystemIncludeArgs(const llvm::opt::ArgList &DriverArgs, 28 llvm::opt::ArgStringList &CC1Args) const override; 29 void addLibStdCxxIncludePaths( 30 const llvm::opt::ArgList &DriverArgs, 31 llvm::opt::ArgStringList &CC1Args) const override; 32 void AddCudaIncludeArgs(const llvm::opt::ArgList &DriverArgs, 33 llvm::opt::ArgStringList &CC1Args) const override; 34 void AddHIPIncludeArgs(const llvm::opt::ArgList &DriverArgs, 35 llvm::opt::ArgStringList &CC1Args) const override; 36 void AddIAMCUIncludeArgs(const llvm::opt::ArgList &DriverArgs, 37 llvm::opt::ArgStringList &CC1Args) const override; 38 CXXStdlibType GetDefaultCXXStdlibType() const override; 39 bool isPIEDefault() const override; 40 bool isNoExecStackDefault() const override; 41 bool IsMathErrnoDefault() const override; 42 SanitizerMask getSupportedSanitizers() const override; 43 void addProfileRTLibs(const llvm::opt::ArgList &Args, 44 llvm::opt::ArgStringList &CmdArgs) const override; 45 std::string computeSysRoot() const override; 46 47 std::string getDynamicLinker(const llvm::opt::ArgList &Args) const override; 48 49 void addExtraOpts(llvm::opt::ArgStringList &CmdArgs) const override; 50 51 std::vector<std::string> ExtraOpts; 52 53 llvm::DenormalMode getDefaultDenormalModeForType( 54 const llvm::opt::ArgList &DriverArgs, const JobAction &JA, 55 const llvm::fltSemantics *FPType = nullptr) const override; 56 57 protected: 58 Tool *buildAssembler() const override; 59 Tool *buildLinker() const override; 60 Tool *buildStaticLibTool() const override; 61 62 std::string getMultiarchTriple(const Driver &D, 63 const llvm::Triple &TargetTriple, 64 StringRef SysRoot) const override; 65 }; 66 67 } // end namespace toolchains 68 } // end namespace driver 69 } // end namespace clang 70 71 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_LINUX_H 72