Lines Matching +full:bazel +full:- +full:bin

5 .. _Configuring CROSSTOOL: https://docs.bazel.build/versions/0.23.0/tutorial/crosstool.html
6 .. _Understanding CROSSTOOL: https://docs.bazel.build/versions/0.23.0/crosstool-reference.html
7 .. _Configuring C++ toolchains: https://docs.bazel.build/versions/master/tutorial/cc-toolchain-conf…
8 .. _cc_library: https://docs.bazel.build/versions/master/be/c-cpp.html#cc_library
9 .. _crosstool_config.proto: https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/cross…
12 .. _toolchain: https://docs.bazel.build/versions/master/be/platform.html#toolchain
16 ----------
23 ------------
25 **WARNING:** This documentation is out of date. Some of the linked Bazel
27 TODOs. In particular, building and configuring a cross-compiling C++ toolchain
32 uses whatever C/C++ toolchain Bazel is configured to use. This means
36 Bazel uses a CROSSTOOL file to configure the C/C++ toolchain, plus a few build
37 rules that declare constraints, dependencies, and file groups. By default, Bazel
41 doesn't work with cross-compilation. Explicit configuration is required in these
44 This documented is intended to serve as a walk-through for configuring a custom
48 command-line arguments and produce the same error messages. MSVC is not
52 TODO: Change the example to use a cross-compiling toolchain.
59 --------
63 referenced from other Bazel workspaces.
86 Note that this toolchain has Unixy subdirectories like ``bin``, ``lib``, and
91 …$ curl http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz | tar …
92 $ mv clang+llvm-7.0.0-x86_64-linux-gnu-ubuntu-16.04 tools
94 bin include lib libexec share
100 to Bazel. If you have more than one C/C++ toolchain (e.g., different tools for
125 tool_path { name: "ar" path: "bin/llvm-ar" }
126 tool_path { name: "cpp" path: "bin/clang-cpp" }
127 tool_path { name: "dwp" path: "bin/llvm-dwp" }
128 tool_path { name: "gcc" path: "bin/clang" }
129 tool_path { name: "gcov" path: "bin/llvm-profdata" }
130 tool_path { name: "ld" path: "bin/ld.lld" }
131 tool_path { name: "nm" path: "bin/llvm-nm" }
132 tool_path { name: "objcopy" path: "bin/llvm-objcopy" }
133 tool_path { name: "objdump" path: "bin/llvm-objdump" }
134 tool_path { name: "strip" path: "bin/llvm-strip" }
136 compiler_flag: "-no-canonical-prefixes"
137 linker_flag: "-no-canonical-prefixes"
139 compiler_flag: "-v"
148 For a more complete example, build any ``cc_binary`` with Bazel without
150 Bazel generates for the automatically detected host toolchain. This can
151 be found in ``$(bazel info
161 * ``tool_path`` fields describe the various tools Bazel may invoke. The paths
172 We'll create a set of targets that will link the CROSSTOOL into Bazel's
174 in ``tools/BUILD.bazel``.
190 "bin/*",
197 Next, we'll create a ``cc_toolchain`` target that tells Bazel where to find some
206 name = "cc-compiler-clang",
227 name = "clang-toolchain",
229 "x86_64": ":cc-compiler-clang",
230 "x86_64|clang": ":cc-compiler-clang",
238 of extra flags to Bazel.
252 $ cat >example/BUILD.bazel <<EOF
259 $ bazel build \
260 --crosstool_top=//tools:clang-toolchain \
261 --cpu=x86_64 \
262 --compiler=clang \
263 --host_cpu=x86_64 \
264 -s \
267 You should see an invocation of ``tools/bin/clang`` in the output.
269 * ``--crosstool_top`` should be the label for the ``cc_toolchain_suite`` target
271 * ``--cpu=x86_64`` should be the ``cpu`` attribute in ``cc_toolchain`` and in
273 * ``--compiler=clang`` should be the ``toolchain_identifier`` attribute in
275 * ``--host_cpu`` should be the same as ``--cpu``. If we were cross-compiling,
277 performed), not the host platform (where Bazel is invoked).
278 * ``-s`` prints commands.
299 Bazel command (such as ``build``), an optional configuration name (``clang``)
300 and a list of flags to be passed to Bazel when that configuration is used.
306 build:clang --crosstool_top=@bazel_cc_toolchains//tools:clang-toolchain
307 build:clang --cpu=x86_64
308 build:clang --compiler=clang
309 build:clang --host_cpu=x86_64
312 You can build with ``bazel build --config=clang ...``.
335 $ cat >BUILD.bazel <<EOF
344 $ bazel build --config=clang -s //:hello
346 You should see clang commands in Bazel's output.