1 //===--- FreeBSD.h - FreeBSD ToolChain Implementations ----------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FREEBSD_H
11 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FREEBSD_H
14 #include "clang/Driver/Driver.h"
15 #include "clang/Driver/ToolChain.h"
21 /// freebsd -- Directly call GNU Binutils assembler and linker
23 class LLVM_LIBRARY_VISIBILITY Assembler : public GnuTool {
25 Assembler(const ToolChain &TC)
26 : GnuTool("freebsd::Assembler", "assembler", TC) {}
28 bool hasIntegratedCPP() const override { return false; }
30 void ConstructJob(Compilation &C, const JobAction &JA,
31 const InputInfo &Output, const InputInfoList &Inputs,
32 const llvm::opt::ArgList &TCArgs,
33 const char *LinkingOutput) const override;
36 class LLVM_LIBRARY_VISIBILITY Linker : public GnuTool {
38 Linker(const ToolChain &TC) : GnuTool("freebsd::Linker", "linker", TC) {}
40 bool hasIntegratedCPP() const override { return false; }
41 bool isLinkJob() const override { return true; }
43 void ConstructJob(Compilation &C, const JobAction &JA,
44 const InputInfo &Output, const InputInfoList &Inputs,
45 const llvm::opt::ArgList &TCArgs,
46 const char *LinkingOutput) const override;
48 } // end namespace freebsd
49 } // end namespace tools
51 namespace toolchains {
53 class LLVM_LIBRARY_VISIBILITY FreeBSD : public Generic_ELF {
55 FreeBSD(const Driver &D, const llvm::Triple &Triple,
56 const llvm::opt::ArgList &Args);
57 bool HasNativeLLVMSupport() const override;
59 bool IsMathErrnoDefault() const override { return false; }
60 bool IsObjCNonFragileABIDefault() const override { return true; }
62 CXXStdlibType GetDefaultCXXStdlibType() const override;
63 void addLibStdCxxIncludePaths(
64 const llvm::opt::ArgList &DriverArgs,
65 llvm::opt::ArgStringList &CC1Args) const override;
66 void AddCXXStdlibLibArgs(const llvm::opt::ArgList &Args,
67 llvm::opt::ArgStringList &CmdArgs) const override;
69 bool UseSjLjExceptions(const llvm::opt::ArgList &Args) const override;
70 bool isPIEDefault() const override;
71 SanitizerMask getSupportedSanitizers() const override;
72 unsigned GetDefaultDwarfVersion() const override { return 2; }
73 // Until dtrace (via CTF) and LLDB can deal with distributed debug info,
74 // FreeBSD defaults to standalone/full debug info.
75 bool GetDefaultStandaloneDebug() const override { return true; }
78 Tool *buildAssembler() const override;
79 Tool *buildLinker() const override;
82 } // end namespace toolchains
83 } // end namespace driver
84 } // end namespace clang
86 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_FREEBSD_H