Skip to content

Commit 6a44342

Browse files
yannhamclaude
andcommitted
doc: explain why the wrapper script is needed
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6de3ad2 commit 6a44342

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

libdd-otel-thread-ctx-ffi/README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ inline the C wrapper at link time. The requirements are:
2626
some musl-based distro like Alpine might have Rust packages without LLD)
2727
- lld version is at least 19 (TLSDESC support)
2828

29-
If those requirements are met, you can use the small wrapper provided in this
30-
directory to build an optimized release version where the C shim is inlined.
29+
If those requirements are met, you can use the small wrapper script provided in
30+
this directory to build an optimized release version where the C shim is
31+
inlined. A wrapper script is needed because cross-language LTO requires two
32+
`rustc` codegen flags (`-Clinker-plugin-lto` and `-Clinker=clang`) that cannot
33+
be set from a Cargo build script — they must come from `RUSTFLAGS` or
34+
`.cargo/config.toml`. The script sets them via the target-scoped
35+
`CARGO_TARGET_<TRIPLE>_RUSTFLAGS` env var so they don't leak to build scripts
36+
or proc-macros.
3137

3238
```bash
3339
./build-optimized.sh

0 commit comments

Comments
 (0)