Skip to content

Commit

Permalink
README section on supporting new targets
Browse files Browse the repository at this point in the history
  • Loading branch information
Siddhartha Bagaria committed Mar 8, 2022
1 parent b84d672 commit 58af217
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,24 @@ bazel build \
//...
```

#### Supporting New Target Platforms

The following is a rough (untested) list of steps:

1. To help us detect if you are cross-compiling or not, note the arch string as
given by `python3 -c 'import platform; print(platform.machine())`.
2. Edit `SUPPORTED_TARGETS` in
[toolchain/internal/common.bzl](toolchain/internal/common.bzl) with the os
and the arch string from above.
3. Add `target_system_name`, etc. in
[toolchain/cc_toolchain_config.bzl](toolchain/cc_toolchain_config.bzl).
4. For cross-compiling, add a `platform` bazel type for your target platform in
[platforms/BUILD.bazel](platforms/BUILD.bazel), and add an appropriate
sysroot entry to your `llvm_toolchain` repository definition.
5. If not cross-compiling, bring your own LLVM (see section above) through the
`toolchain_roots` or `urls` attribute.
6. Test your build.

#### Sandbox

Sandboxing the toolchain introduces a significant overhead (100ms per action,
Expand Down

0 comments on commit 58af217

Please sign in to comment.