Skip to content

Commit

Permalink
Add README note
Browse files Browse the repository at this point in the history
  • Loading branch information
fmeum committed Aug 20, 2024
1 parent b1c9af5 commit a96364a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ Setup instructions are available with [each release](https://github.com/bazel-co
## Usage

The toolchain automatically enables the `fully_static_link` feature to produce statically linked binaries that run anywhere.
`cc_binary` targets with dynamic library dependencies (e.g. `dynamic_deps` or `cc_import`s) as well as `cc_test` targets with `--dynamic_mode` at its default value will be linked dynamically. Such binaries require the `musl` dynamic linker to be present at `/lib/ld-musl-<arch>.so.1` on the target system (i.e. the host when running `bazel test` on Linux).

`cc_binary` targets with dynamic library dependencies (e.g. `dynamic_deps` or `cc_import`s), `linkstatic = False` or `--dynamic_mode=fully` will be linked dynamically. Such binaries require the `musl` dynamic linker to be present at `/lib/ld-musl-<arch>.so.1` on the target system.
Since the path to the dynamic linker is hardcoded into the binary as an absolute path, there is no way to supply it hermetically.

Dynamically linked `cc_test`s are automatically executed with a hermetic `musl` dynamic linker (requires Bazel 7 or higher).

## Comparison with other `cc_toolchain` implementations

### [aspect-build/gcc-toolchain](https://github.com/aspect-build/gcc-toolchain)
Expand Down

0 comments on commit a96364a

Please sign in to comment.