ITADN

static linking brotli

#580Openmdkcore0 创建于 2026-03-20
M
mdkcore0commented
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!
0 条评论