linebender / linebender/parley
static linking brotli
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 736
- Forks
- 120
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 53
Description
Hi, I'm trying to static link a rust program against fontique, but I'm getting the follow error:
```
= note: /usr/lib/gcc/x86_64-alpine-linux-musl/15.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: /tmp/target/x86_64-unknown-linux-musl/debug/deps/libfontique-2c7c87f3c48b4c83.rlib(src_sfnt_sfnt.c.o): in function `sfnt_init_face':
sfnt.c:(.text+0xbe5c): undefined reference to `BrotliDecoderDecompress'
collect2: error: ld returned 1 exit status
= note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
= note: use the `-l` flag to specify native libraries to link
= note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#rustc-link-lib)
```
I have declared brotli, and other static libs, on RUSTFLAGS, but seems to not find it anyway (also have all -dev packages, and the brotli .a file is on the same location of the other ones:
`export RUSTFLAGS="-C target-feature=+crt-static -C link-self-contained=yes -L native=/usr/lib -l static=bz2 -l static=png
-l static=xml2 -l static=fontconfig -l static=freetype -l static=expat -l static=z -l static=brotlicommon -l static=brotlidec"`
(-lbrotlicommon and -lbrotlidec appears on the cc command, already tried adding brotlidec with no luck)
Something obvious I'm missing here? I'm trying to build on alpine (tested v3.23.3 and edge).
Thanks!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the static Rust build on Alpine Linux using the reported RUSTFLAGS and inspect how fontique links its native Brotli dependencies. Confirm which Brotli libraries are required and whether the build completes without undefined references; the issue mentions no repository files or tests to inspect.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100