blob: 55639b66002724e60449f8099951ac6f38363ca9 [file] [log] [blame]
Than McIntoshf05d7662018-04-24 09:12:18 -04001//===-- LinuxToolChain.h --------------------------------------------------===//
2//
Than McIntoshc84d4022018-06-20 08:50:57 -04003// Copyright 2018 The Go Authors. All rights reserved.
4// Use of this source code is governed by a BSD-style
5// license that can be found in the LICENSE file.
Than McIntoshf05d7662018-04-24 09:12:18 -04006//
7//===----------------------------------------------------------------------===//
8//
9// Defines the LinuxToolChain class (helper for driver functionality).
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef GOLLVM_DRIVER_LINUXTOOLCHAIN_H
14#define GOLLVM_DRIVER_LINUXTOOLCHAIN_H
15
16#include "ToolChain.h"
17#include "GccUtils.h"
Than McIntoshd6d9f1a2020-03-19 07:58:22 -040018#include "Distro.h"
Than McIntoshf05d7662018-04-24 09:12:18 -040019
20namespace toolchains {
21
22// Toolchain for linux.
23
24class Linux : public gollvm::driver::ToolChain {
25 public:
26 Linux(gollvm::driver::Driver &driver,
27 const llvm::Triple &targetTriple);
28 ~Linux();
29
30 gollvm::driver::Tool *buildCompiler() override;
31 gollvm::driver::Tool *buildAssembler() override;
32 gollvm::driver::Tool *buildLinker() override;
Than McIntosh9a323cf2018-04-25 09:05:47 -040033 std::string getDynamicLinker(const llvm::opt::ArgList &args) override;
Than McIntoshf05d7662018-04-24 09:12:18 -040034
35 private:
36 gnutools::gccdetect::InspectRealFS inspectFS_;
37 gnutools::gccdetect::GCCInstallationDetector gccDetector_;
Than McIntoshd6d9f1a2020-03-19 07:58:22 -040038 distro::DistroVariety distro_;
Than McIntoshf05d7662018-04-24 09:12:18 -040039};
40
41} // end namespace toolchains
42
43#endif // GOLLVM_DRIVER_LINUXTOOLCHAIN_H