bazelbuild / examples

Examples for Bazel
http://bazel.build
Apache License 2.0
800 stars 497 forks source link

Example of minimal hermetic gcc toolchain #407

Open daivinhtran opened 5 months ago

daivinhtran commented 5 months ago

As part of https://github.com/bazelbuild/bazel/issues/21198, this PR adds an example on how to set up a minimal hermetic gcc toolchain without advanced features like feature and action_config.

Follow-up PRs will include

  1. Clang toolchain for single-platform build
  2. Clang toolchain for cross-compilation build. The toolchain includes example of using feature and action_config to further configure the cc actions.

Once these PRs are merged, I'll put up a separate tutorial to cover the new cc toolchain resolution API alongside with the hermetic toolchain examples to replace https://bazel.build/tutorials/ccp-toolchain-config.