File tree 2 files changed +32
-0
lines changed
2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change 415
415
416
416
- [ Build Software] ( ./sw/doc/build_software.md )
417
417
- [ External dependencies] ( ./third_party/README.md )
418
+ - [ RISC-V toolchain] ( ./toolchain/README.md )
418
419
419
420
- [ Device Software] ( ./sw/device/README.md )
420
421
- [ Build & Test Rules] ( ./rules/opentitan/README.md )
Original file line number Diff line number Diff line change
1
+ # OpenTitan RISC-V toolchain
2
+
3
+ This directory contains the Bazel configuration for OpenTitan's RISC-V
4
+ toolchain.
5
+
6
+ This LLVM toolchain comes from the [ lowrisc-toolchains] repository. See
7
+ ` third_party/lowrisc/BUILD.lowrisc_toolchain.bazel ` for changing the toolchain
8
+ version.
9
+
10
+ [ lowrisc-toolchains ] : https://github.com/lowRISC/lowrisc-toolchains
11
+
12
+ ## Configuration
13
+
14
+ There are four rules used to configure the toolchain:
15
+
16
+ 1 . ` cc_toolchain ` : groups flags, features, and tools into a toolchain.
17
+ 2 . ` cc_tool_map ` : assigns tools to actions.
18
+ 3 . ` cc_args ` : defines flags to add to tools based on actions.
19
+ 3 . ` cc_feature ` : allows ` cc_args ` flags to be conditionally enabled.
20
+
21
+ To add new flags to a tool in the toolchain, define a new ` cc_args ` target
22
+ and assign it to some actions (e.g. compiling C code, linking, etc.). Add the
23
+ new flags to ` cc_toolchain.args ` .
24
+
25
+ To make flags optional, define a new ` cc_feature ` for those ` cc_args ` . Features
26
+ can be enabled at the command line using ` bazel --features=$feature_name ` . Add
27
+ the flags to ` cc_toolchain.known_features ` and optionally to
28
+ ` cc_toolchain.enabled_features ` .
29
+
30
+ Bazel has three built-in features called ` dbg ` , ` fastbuild ` , and ` opt ` that can
31
+ be used to enable and disable flags at different optimization levels.
You can’t perform that action at this time.
0 commit comments