1 //===--- Haiku.h - Haiku 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_HAIKU_H
10 #define LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_HAIKU_H
11 
12 #include "Gnu.h"
13 #include "clang/Driver/Driver.h"
14 #include "clang/Driver/ToolChain.h"
15 
16 namespace clang {
17 namespace driver {
18 namespace tools {
19 
20 /// Directly call GNU Binutils assembler and linker
21 namespace haiku {
22 class LLVM_LIBRARY_VISIBILITY Linker final : public Tool {
23 public:
Linker(const ToolChain & TC)24   Linker(const ToolChain &TC) : Tool("haiku::Linker", "linker", TC) {}
25 
hasIntegratedCPP()26   bool hasIntegratedCPP() const override { return false; }
isLinkJob()27   bool isLinkJob() const override { return true; }
28 
29   void ConstructJob(Compilation &C, const JobAction &JA,
30                     const InputInfo &Output, const InputInfoList &Inputs,
31                     const llvm::opt::ArgList &TCArgs,
32                     const char *LinkingOutput) const override;
33 };
34 } // end namespace haiku
35 } // end namespace tools
36 
37 namespace toolchains {
38 
39 class LLVM_LIBRARY_VISIBILITY Haiku : public Generic_ELF {
40 public:
41   Haiku(const Driver &D, const llvm::Triple &Triple,
42           const llvm::opt::ArgList &Args);
43 
44   bool HasNativeLLVMSupport() const override;
45 
IsMathErrnoDefault()46   bool IsMathErrnoDefault() const override { return false; }
IsObjCNonFragileABIDefault()47   bool IsObjCNonFragileABIDefault() const override { return true; }
isPICDefault()48   bool isPICDefault() const override { return true; }
49 
getDefaultLinker()50   const char *getDefaultLinker() const override { return "ld.lld"; }
51 
52   void AddClangSystemIncludeArgs(
53       const llvm::opt::ArgList &DriverArgs,
54       llvm::opt::ArgStringList &CC1Args) const override;
55   void addLibCxxIncludePaths(
56       const llvm::opt::ArgList &DriverArgs,
57       llvm::opt::ArgStringList &CC1Args) const override;
58 
GetDefaultDwarfVersion()59   unsigned GetDefaultDwarfVersion() const override { return 4; }
60 
GetDefaultStandaloneDebug()61   bool GetDefaultStandaloneDebug() const override { return true; }
62 
63 protected:
64   Tool *buildLinker() const override;
65 };
66 
67 } // end namespace toolchains
68 } // end namespace driver
69 } // end namespace clang
70 
71 #endif // LLVM_CLANG_LIB_DRIVER_TOOLCHAINS_HAIKU_H
72