xref: /aosp_15_r20/external/llvm/docs/LLVMBuild.rst (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker===============
2*9880d681SAndroid Build Coastguard WorkerLLVMBuild Guide
3*9880d681SAndroid Build Coastguard Worker===============
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Worker.. contents::
6*9880d681SAndroid Build Coastguard Worker   :local:
7*9880d681SAndroid Build Coastguard Worker
8*9880d681SAndroid Build Coastguard WorkerIntroduction
9*9880d681SAndroid Build Coastguard Worker============
10*9880d681SAndroid Build Coastguard Worker
11*9880d681SAndroid Build Coastguard WorkerThis document describes the ``LLVMBuild`` organization and files which
12*9880d681SAndroid Build Coastguard Workerwe use to describe parts of the LLVM ecosystem. For description of
13*9880d681SAndroid Build Coastguard Workerspecific LLVMBuild related tools, please see the command guide.
14*9880d681SAndroid Build Coastguard Worker
15*9880d681SAndroid Build Coastguard WorkerLLVM is designed to be a modular set of libraries which can be flexibly
16*9880d681SAndroid Build Coastguard Workermixed together in order to build a variety of tools, like compilers,
17*9880d681SAndroid Build Coastguard WorkerJITs, custom code generators, optimization passes, interpreters, and so
18*9880d681SAndroid Build Coastguard Workeron. Related projects in the LLVM system like Clang and LLDB also tend to
19*9880d681SAndroid Build Coastguard Workerfollow this philosophy.
20*9880d681SAndroid Build Coastguard Worker
21*9880d681SAndroid Build Coastguard WorkerIn order to support this usage style, LLVM has a fairly strict structure
22*9880d681SAndroid Build Coastguard Workeras to how the source code and various components are organized. The
23*9880d681SAndroid Build Coastguard Worker``LLVMBuild.txt`` files are the explicit specification of that
24*9880d681SAndroid Build Coastguard Workerstructure, and are used by the build systems and other tools in order to
25*9880d681SAndroid Build Coastguard Workerdevelop the LLVM project.
26*9880d681SAndroid Build Coastguard Worker
27*9880d681SAndroid Build Coastguard WorkerProject Organization
28*9880d681SAndroid Build Coastguard Worker====================
29*9880d681SAndroid Build Coastguard Worker
30*9880d681SAndroid Build Coastguard WorkerThe source code for LLVM projects using the LLVMBuild system (LLVM,
31*9880d681SAndroid Build Coastguard WorkerClang, and LLDB) is organized into *components*, which define the
32*9880d681SAndroid Build Coastguard Workerseparate pieces of functionality that make up the project. These
33*9880d681SAndroid Build Coastguard Workerprojects may consist of many libraries, associated tools, build tools,
34*9880d681SAndroid Build Coastguard Workeror other utility tools (for example, testing tools).
35*9880d681SAndroid Build Coastguard Worker
36*9880d681SAndroid Build Coastguard WorkerFor the most part, the project contents are organized around defining
37*9880d681SAndroid Build Coastguard Workerone main component per each subdirectory. Each such directory contains
38*9880d681SAndroid Build Coastguard Workeran ``LLVMBuild.txt`` which contains the component definitions.
39*9880d681SAndroid Build Coastguard Worker
40*9880d681SAndroid Build Coastguard WorkerThe component descriptions for the project as a whole are automatically
41*9880d681SAndroid Build Coastguard Workergathered by the LLVMBuild tools. The tools automatically traverse the
42*9880d681SAndroid Build Coastguard Workersource directory structure to find all of the component description
43*9880d681SAndroid Build Coastguard Workerfiles. NOTE: For performance/sanity reasons, we only traverse into
44*9880d681SAndroid Build Coastguard Workersubdirectories when the parent itself contains an ``LLVMBuild.txt``
45*9880d681SAndroid Build Coastguard Workerdescription file.
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard WorkerBuild Integration
48*9880d681SAndroid Build Coastguard Worker=================
49*9880d681SAndroid Build Coastguard Worker
50*9880d681SAndroid Build Coastguard WorkerThe LLVMBuild files themselves are just a declarative way to describe
51*9880d681SAndroid Build Coastguard Workerthe project structure. The actual building of the LLVM project is
52*9880d681SAndroid Build Coastguard Workerhandled by another build system (See: :doc:`CMake <CMake>`).
53*9880d681SAndroid Build Coastguard Worker
54*9880d681SAndroid Build Coastguard WorkerThe build system implementation will load the relevant contents of the
55*9880d681SAndroid Build Coastguard WorkerLLVMBuild files and use that to drive the actual project build.
56*9880d681SAndroid Build Coastguard WorkerTypically, the build system will only need to load this information at
57*9880d681SAndroid Build Coastguard Worker"configure" time, and use it to generative native information. Build
58*9880d681SAndroid Build Coastguard Workersystems will also handle automatically reconfiguring their information
59*9880d681SAndroid Build Coastguard Workerwhen the contents of the ``LLVMBuild.txt`` files change.
60*9880d681SAndroid Build Coastguard Worker
61*9880d681SAndroid Build Coastguard WorkerDevelopers generally are not expected to need to be aware of the details
62*9880d681SAndroid Build Coastguard Workerof how the LLVMBuild system is integrated into their build. Ideally,
63*9880d681SAndroid Build Coastguard WorkerLLVM developers who are not working on the build system would only ever
64*9880d681SAndroid Build Coastguard Workerneed to modify the contents of the ``LLVMBuild.txt`` description files
65*9880d681SAndroid Build Coastguard Worker(although we have not reached this goal yet).
66*9880d681SAndroid Build Coastguard Worker
67*9880d681SAndroid Build Coastguard WorkerFor more information on the utility tool we provide to help interfacing
68*9880d681SAndroid Build Coastguard Workerwith the build system, please see the :doc:`llvm-build
69*9880d681SAndroid Build Coastguard Worker<CommandGuide/llvm-build>` documentation.
70*9880d681SAndroid Build Coastguard Worker
71*9880d681SAndroid Build Coastguard WorkerComponent Overview
72*9880d681SAndroid Build Coastguard Worker==================
73*9880d681SAndroid Build Coastguard Worker
74*9880d681SAndroid Build Coastguard WorkerAs mentioned earlier, LLVM projects are organized into logical
75*9880d681SAndroid Build Coastguard Worker*components*. Every component is typically grouped into its own
76*9880d681SAndroid Build Coastguard Workersubdirectory. Generally, a component is organized around a coherent
77*9880d681SAndroid Build Coastguard Workergroup of sources which have some kind of clear API separation from other
78*9880d681SAndroid Build Coastguard Workerparts of the code.
79*9880d681SAndroid Build Coastguard Worker
80*9880d681SAndroid Build Coastguard WorkerLLVM primarily uses the following types of components:
81*9880d681SAndroid Build Coastguard Worker
82*9880d681SAndroid Build Coastguard Worker- *Libraries* - Library components define a distinct API which can be
83*9880d681SAndroid Build Coastguard Worker  independently linked into LLVM client applications. Libraries typically
84*9880d681SAndroid Build Coastguard Worker  have private and public header files, and may specify a link of required
85*9880d681SAndroid Build Coastguard Worker  libraries that they build on top of.
86*9880d681SAndroid Build Coastguard Worker- *Build Tools* - Build tools are applications which are designed to be run
87*9880d681SAndroid Build Coastguard Worker  as part of the build process (typically to generate other source files).
88*9880d681SAndroid Build Coastguard Worker  Currently, LLVM uses one main build tool called :doc:`TableGen/index`
89*9880d681SAndroid Build Coastguard Worker  to generate a variety of source files.
90*9880d681SAndroid Build Coastguard Worker- *Tools* - Command line applications which are built using the LLVM
91*9880d681SAndroid Build Coastguard Worker  component libraries. Most LLVM tools are small and are primarily
92*9880d681SAndroid Build Coastguard Worker  frontends to the library interfaces.
93*9880d681SAndroid Build Coastguard Worker
94*9880d681SAndroid Build Coastguard WorkerComponents are described using ``LLVMBuild.txt`` files in the directories
95*9880d681SAndroid Build Coastguard Workerthat define the component. See the `LLVMBuild Format Reference`_ section
96*9880d681SAndroid Build Coastguard Workerfor information on the exact format of these files.
97*9880d681SAndroid Build Coastguard Worker
98*9880d681SAndroid Build Coastguard WorkerLLVMBuild Format Reference
99*9880d681SAndroid Build Coastguard Worker==========================
100*9880d681SAndroid Build Coastguard Worker
101*9880d681SAndroid Build Coastguard WorkerLLVMBuild files are written in a simple variant of the INI or configuration
102*9880d681SAndroid Build Coastguard Workerfile format (`Wikipedia entry`_). The format defines a list of sections
103*9880d681SAndroid Build Coastguard Workereach of which may contain some number of properties. A simple example of
104*9880d681SAndroid Build Coastguard Workerthe file format is below:
105*9880d681SAndroid Build Coastguard Worker
106*9880d681SAndroid Build Coastguard Worker.. _Wikipedia entry: http://en.wikipedia.org/wiki/INI_file
107*9880d681SAndroid Build Coastguard Worker
108*9880d681SAndroid Build Coastguard Worker.. code-block:: ini
109*9880d681SAndroid Build Coastguard Worker
110*9880d681SAndroid Build Coastguard Worker   ; Comments start with a semi-colon.
111*9880d681SAndroid Build Coastguard Worker
112*9880d681SAndroid Build Coastguard Worker   ; Sections are declared using square brackets.
113*9880d681SAndroid Build Coastguard Worker   [component_0]
114*9880d681SAndroid Build Coastguard Worker
115*9880d681SAndroid Build Coastguard Worker   ; Properties are declared using '=' and are contained in the previous section.
116*9880d681SAndroid Build Coastguard Worker   ;
117*9880d681SAndroid Build Coastguard Worker   ; We support simple string and boolean scalar values and list values, where
118*9880d681SAndroid Build Coastguard Worker   ; items are separated by spaces. There is no support for quoting, and so
119*9880d681SAndroid Build Coastguard Worker   ; property values may not contain spaces.
120*9880d681SAndroid Build Coastguard Worker   property_name = property_value
121*9880d681SAndroid Build Coastguard Worker   list_property_name = value_1 value_2 ... value_n
122*9880d681SAndroid Build Coastguard Worker   boolean_property_name = 1 (or 0)
123*9880d681SAndroid Build Coastguard Worker
124*9880d681SAndroid Build Coastguard WorkerLLVMBuild files are expected to define a strict set of sections and
125*9880d681SAndroid Build Coastguard Workerproperties. A typical component description file for a library
126*9880d681SAndroid Build Coastguard Workercomponent would look like the following example:
127*9880d681SAndroid Build Coastguard Worker
128*9880d681SAndroid Build Coastguard Worker.. code-block:: ini
129*9880d681SAndroid Build Coastguard Worker
130*9880d681SAndroid Build Coastguard Worker   [component_0]
131*9880d681SAndroid Build Coastguard Worker   type = Library
132*9880d681SAndroid Build Coastguard Worker   name = Linker
133*9880d681SAndroid Build Coastguard Worker   parent = Libraries
134*9880d681SAndroid Build Coastguard Worker   required_libraries = Archive BitReader Core Support TransformUtils
135*9880d681SAndroid Build Coastguard Worker
136*9880d681SAndroid Build Coastguard WorkerA full description of the exact sections and properties which are
137*9880d681SAndroid Build Coastguard Workerallowed follows.
138*9880d681SAndroid Build Coastguard Worker
139*9880d681SAndroid Build Coastguard WorkerEach file may define exactly one common component, named ``common``. The
140*9880d681SAndroid Build Coastguard Workercommon component may define the following properties:
141*9880d681SAndroid Build Coastguard Worker
142*9880d681SAndroid Build Coastguard Worker-  ``subdirectories`` **[optional]**
143*9880d681SAndroid Build Coastguard Worker
144*9880d681SAndroid Build Coastguard Worker   If given, a list of the names of the subdirectories from the current
145*9880d681SAndroid Build Coastguard Worker   subpath to search for additional LLVMBuild files.
146*9880d681SAndroid Build Coastguard Worker
147*9880d681SAndroid Build Coastguard WorkerEach file may define multiple components. Each component is described by a
148*9880d681SAndroid Build Coastguard Workersection who name starts with ``component``. The remainder of the section
149*9880d681SAndroid Build Coastguard Workername is ignored, but each section name must be unique. Typically components
150*9880d681SAndroid Build Coastguard Workerare just number in order for files with multiple components
151*9880d681SAndroid Build Coastguard Worker(``component_0``, ``component_1``, and so on).
152*9880d681SAndroid Build Coastguard Worker
153*9880d681SAndroid Build Coastguard Worker.. warning::
154*9880d681SAndroid Build Coastguard Worker
155*9880d681SAndroid Build Coastguard Worker   Section names not matching this format (or the ``common`` section) are
156*9880d681SAndroid Build Coastguard Worker   currently unused and are disallowed.
157*9880d681SAndroid Build Coastguard Worker
158*9880d681SAndroid Build Coastguard WorkerEvery component is defined by the properties in the section. The exact
159*9880d681SAndroid Build Coastguard Workerlist of properties that are allowed depends on the component type.
160*9880d681SAndroid Build Coastguard WorkerComponents **may not** define any properties other than those expected
161*9880d681SAndroid Build Coastguard Workerby the component type.
162*9880d681SAndroid Build Coastguard Worker
163*9880d681SAndroid Build Coastguard WorkerEvery component must define the following properties:
164*9880d681SAndroid Build Coastguard Worker
165*9880d681SAndroid Build Coastguard Worker-  ``type`` **[required]**
166*9880d681SAndroid Build Coastguard Worker
167*9880d681SAndroid Build Coastguard Worker   The type of the component. Supported component types are detailed
168*9880d681SAndroid Build Coastguard Worker   below. Most components will define additional properties which may be
169*9880d681SAndroid Build Coastguard Worker   required or optional.
170*9880d681SAndroid Build Coastguard Worker
171*9880d681SAndroid Build Coastguard Worker-  ``name`` **[required]**
172*9880d681SAndroid Build Coastguard Worker
173*9880d681SAndroid Build Coastguard Worker   The name of the component. Names are required to be unique across the
174*9880d681SAndroid Build Coastguard Worker   entire project.
175*9880d681SAndroid Build Coastguard Worker
176*9880d681SAndroid Build Coastguard Worker-  ``parent`` **[required]**
177*9880d681SAndroid Build Coastguard Worker
178*9880d681SAndroid Build Coastguard Worker   The name of the logical parent of the component. Components are
179*9880d681SAndroid Build Coastguard Worker   organized into a logical tree to make it easier to navigate and
180*9880d681SAndroid Build Coastguard Worker   organize groups of components. The parents have no semantics as far
181*9880d681SAndroid Build Coastguard Worker   as the project build is concerned, however. Typically, the parent
182*9880d681SAndroid Build Coastguard Worker   will be the main component of the parent directory.
183*9880d681SAndroid Build Coastguard Worker
184*9880d681SAndroid Build Coastguard Worker   Components may reference the root pseudo component using ``$ROOT`` to
185*9880d681SAndroid Build Coastguard Worker   indicate they should logically be grouped at the top-level.
186*9880d681SAndroid Build Coastguard Worker
187*9880d681SAndroid Build Coastguard WorkerComponents may define the following properties:
188*9880d681SAndroid Build Coastguard Worker
189*9880d681SAndroid Build Coastguard Worker-  ``dependencies`` **[optional]**
190*9880d681SAndroid Build Coastguard Worker
191*9880d681SAndroid Build Coastguard Worker   If specified, a list of names of components which *must* be built
192*9880d681SAndroid Build Coastguard Worker   prior to this one. This should only be exactly those components which
193*9880d681SAndroid Build Coastguard Worker   produce some tool or source code required for building the component.
194*9880d681SAndroid Build Coastguard Worker
195*9880d681SAndroid Build Coastguard Worker   .. note::
196*9880d681SAndroid Build Coastguard Worker
197*9880d681SAndroid Build Coastguard Worker      ``Group`` and ``LibraryGroup`` components have no semantics for the
198*9880d681SAndroid Build Coastguard Worker      actual build, and are not allowed to specify dependencies.
199*9880d681SAndroid Build Coastguard Worker
200*9880d681SAndroid Build Coastguard WorkerThe following section lists the available component types, as well as
201*9880d681SAndroid Build Coastguard Workerthe properties which are associated with that component.
202*9880d681SAndroid Build Coastguard Worker
203*9880d681SAndroid Build Coastguard Worker-  ``type = Group``
204*9880d681SAndroid Build Coastguard Worker
205*9880d681SAndroid Build Coastguard Worker   Group components exist purely to allow additional arbitrary structuring
206*9880d681SAndroid Build Coastguard Worker   of the logical components tree. For example, one might define a
207*9880d681SAndroid Build Coastguard Worker   ``Libraries`` group to hold all of the root library components.
208*9880d681SAndroid Build Coastguard Worker
209*9880d681SAndroid Build Coastguard Worker   ``Group`` components have no additionally properties.
210*9880d681SAndroid Build Coastguard Worker
211*9880d681SAndroid Build Coastguard Worker-  ``type = Library``
212*9880d681SAndroid Build Coastguard Worker
213*9880d681SAndroid Build Coastguard Worker   Library components define an individual library which should be built
214*9880d681SAndroid Build Coastguard Worker   from the source code in the component directory.
215*9880d681SAndroid Build Coastguard Worker
216*9880d681SAndroid Build Coastguard Worker   Components with this type use the following properties:
217*9880d681SAndroid Build Coastguard Worker
218*9880d681SAndroid Build Coastguard Worker   -  ``library_name`` **[optional]**
219*9880d681SAndroid Build Coastguard Worker
220*9880d681SAndroid Build Coastguard Worker      If given, the name to use for the actual library file on disk. If
221*9880d681SAndroid Build Coastguard Worker      not given, the name is derived from the component name itself.
222*9880d681SAndroid Build Coastguard Worker
223*9880d681SAndroid Build Coastguard Worker   -  ``required_libraries`` **[optional]**
224*9880d681SAndroid Build Coastguard Worker
225*9880d681SAndroid Build Coastguard Worker      If given, a list of the names of ``Library`` or ``LibraryGroup``
226*9880d681SAndroid Build Coastguard Worker      components which must also be linked in whenever this library is
227*9880d681SAndroid Build Coastguard Worker      used. That is, the link time dependencies for this component. When
228*9880d681SAndroid Build Coastguard Worker      tools are built, the build system will include the transitive closure
229*9880d681SAndroid Build Coastguard Worker      of all ``required_libraries`` for the components the tool needs.
230*9880d681SAndroid Build Coastguard Worker
231*9880d681SAndroid Build Coastguard Worker   -  ``add_to_library_groups`` **[optional]**
232*9880d681SAndroid Build Coastguard Worker
233*9880d681SAndroid Build Coastguard Worker      If given, a list of the names of ``LibraryGroup`` components which
234*9880d681SAndroid Build Coastguard Worker      this component is also part of. This allows nesting groups of
235*9880d681SAndroid Build Coastguard Worker      components.  For example, the ``X86`` target might define a library
236*9880d681SAndroid Build Coastguard Worker      group for all of the ``X86`` components. That library group might
237*9880d681SAndroid Build Coastguard Worker      then be included in the ``all-targets`` library group.
238*9880d681SAndroid Build Coastguard Worker
239*9880d681SAndroid Build Coastguard Worker   -  ``installed`` **[optional]** **[boolean]**
240*9880d681SAndroid Build Coastguard Worker
241*9880d681SAndroid Build Coastguard Worker      Whether this library is installed. Libraries that are not installed
242*9880d681SAndroid Build Coastguard Worker      are only reported by ``llvm-config`` when it is run as part of a
243*9880d681SAndroid Build Coastguard Worker      development directory.
244*9880d681SAndroid Build Coastguard Worker
245*9880d681SAndroid Build Coastguard Worker-  ``type = LibraryGroup``
246*9880d681SAndroid Build Coastguard Worker
247*9880d681SAndroid Build Coastguard Worker   ``LibraryGroup`` components are a mechanism to allow easy definition of
248*9880d681SAndroid Build Coastguard Worker   useful sets of related components. In particular, we use them to easily
249*9880d681SAndroid Build Coastguard Worker   specify things like "all targets", or "all assembly printers".
250*9880d681SAndroid Build Coastguard Worker
251*9880d681SAndroid Build Coastguard Worker   Components with this type use the following properties:
252*9880d681SAndroid Build Coastguard Worker
253*9880d681SAndroid Build Coastguard Worker   -  ``required_libraries`` **[optional]**
254*9880d681SAndroid Build Coastguard Worker
255*9880d681SAndroid Build Coastguard Worker      See the ``Library`` type for a description of this property.
256*9880d681SAndroid Build Coastguard Worker
257*9880d681SAndroid Build Coastguard Worker   -  ``add_to_library_groups`` **[optional]**
258*9880d681SAndroid Build Coastguard Worker
259*9880d681SAndroid Build Coastguard Worker      See the ``Library`` type for a description of this property.
260*9880d681SAndroid Build Coastguard Worker
261*9880d681SAndroid Build Coastguard Worker-  ``type = TargetGroup``
262*9880d681SAndroid Build Coastguard Worker
263*9880d681SAndroid Build Coastguard Worker   ``TargetGroup`` components are an extension of ``LibraryGroup``\s,
264*9880d681SAndroid Build Coastguard Worker   specifically for defining LLVM targets (which are handled specially in a
265*9880d681SAndroid Build Coastguard Worker   few places).
266*9880d681SAndroid Build Coastguard Worker
267*9880d681SAndroid Build Coastguard Worker   The name of the component should always be the name of the target.
268*9880d681SAndroid Build Coastguard Worker
269*9880d681SAndroid Build Coastguard Worker   Components with this type use the ``LibraryGroup`` properties in
270*9880d681SAndroid Build Coastguard Worker   addition to:
271*9880d681SAndroid Build Coastguard Worker
272*9880d681SAndroid Build Coastguard Worker   -  ``has_asmparser`` **[optional]** **[boolean]**
273*9880d681SAndroid Build Coastguard Worker
274*9880d681SAndroid Build Coastguard Worker      Whether this target defines an assembly parser.
275*9880d681SAndroid Build Coastguard Worker
276*9880d681SAndroid Build Coastguard Worker   -  ``has_asmprinter`` **[optional]** **[boolean]**
277*9880d681SAndroid Build Coastguard Worker
278*9880d681SAndroid Build Coastguard Worker      Whether this target defines an assembly printer.
279*9880d681SAndroid Build Coastguard Worker
280*9880d681SAndroid Build Coastguard Worker   -  ``has_disassembler`` **[optional]** **[boolean]**
281*9880d681SAndroid Build Coastguard Worker
282*9880d681SAndroid Build Coastguard Worker      Whether this target defines a disassembler.
283*9880d681SAndroid Build Coastguard Worker
284*9880d681SAndroid Build Coastguard Worker   -  ``has_jit`` **[optional]** **[boolean]**
285*9880d681SAndroid Build Coastguard Worker
286*9880d681SAndroid Build Coastguard Worker      Whether this target supports JIT compilation.
287*9880d681SAndroid Build Coastguard Worker
288*9880d681SAndroid Build Coastguard Worker-  ``type = Tool``
289*9880d681SAndroid Build Coastguard Worker
290*9880d681SAndroid Build Coastguard Worker   ``Tool`` components define standalone command line tools which should be
291*9880d681SAndroid Build Coastguard Worker   built from the source code in the component directory and linked.
292*9880d681SAndroid Build Coastguard Worker
293*9880d681SAndroid Build Coastguard Worker   Components with this type use the following properties:
294*9880d681SAndroid Build Coastguard Worker
295*9880d681SAndroid Build Coastguard Worker   -  ``required_libraries`` **[optional]**
296*9880d681SAndroid Build Coastguard Worker
297*9880d681SAndroid Build Coastguard Worker      If given, a list of the names of ``Library`` or ``LibraryGroup``
298*9880d681SAndroid Build Coastguard Worker      components which this tool is required to be linked with.
299*9880d681SAndroid Build Coastguard Worker
300*9880d681SAndroid Build Coastguard Worker      .. note::
301*9880d681SAndroid Build Coastguard Worker
302*9880d681SAndroid Build Coastguard Worker         The values should be the component names, which may not always
303*9880d681SAndroid Build Coastguard Worker         match up with the actual library names on disk.
304*9880d681SAndroid Build Coastguard Worker
305*9880d681SAndroid Build Coastguard Worker      Build systems are expected to properly include all of the libraries
306*9880d681SAndroid Build Coastguard Worker      required by the linked components (i.e., the transitive closure of
307*9880d681SAndroid Build Coastguard Worker      ``required_libraries``).
308*9880d681SAndroid Build Coastguard Worker
309*9880d681SAndroid Build Coastguard Worker      Build systems are also expected to understand that those library
310*9880d681SAndroid Build Coastguard Worker      components must be built prior to linking -- they do not also need
311*9880d681SAndroid Build Coastguard Worker      to be listed under ``dependencies``.
312*9880d681SAndroid Build Coastguard Worker
313*9880d681SAndroid Build Coastguard Worker-  ``type = BuildTool``
314*9880d681SAndroid Build Coastguard Worker
315*9880d681SAndroid Build Coastguard Worker   ``BuildTool`` components are like ``Tool`` components, except that the
316*9880d681SAndroid Build Coastguard Worker   tool is supposed to be built for the platform where the build is running
317*9880d681SAndroid Build Coastguard Worker   (instead of that platform being targeted). Build systems are expected
318*9880d681SAndroid Build Coastguard Worker   to handle the fact that required libraries may need to be built for
319*9880d681SAndroid Build Coastguard Worker   multiple platforms in order to be able to link this tool.
320*9880d681SAndroid Build Coastguard Worker
321*9880d681SAndroid Build Coastguard Worker   ``BuildTool`` components currently use the exact same properties as
322*9880d681SAndroid Build Coastguard Worker   ``Tool`` components, the type distinction is only used to differentiate
323*9880d681SAndroid Build Coastguard Worker   what the tool is built for.
324*9880d681SAndroid Build Coastguard Worker
325