Summary: | devel/cargo-c: Generated pkg-config files have broken Libs.private definitions | ||
---|---|---|---|
Product: | Ports & Packages | Reporter: | Daniel Engberg <diizzy> |
Component: | Individual Port(s) | Assignee: | Jan Beich <jbeich> |
Status: | New --- | ||
Severity: | Affects Only Me | Flags: | jbeich:
maintainer-feedback+
|
Priority: | --- | ||
Version: | Latest | ||
Hardware: | Any | ||
OS: | Any | ||
See Also: | https://github.com/lu-zero/cargo-c/issues/247 |
Description
Daniel Engberg
2023-04-10 14:47:50 UTC
Looking this seems to "leak" from libc crate? Only -lgcc_s (see upstream issue) breaks static linking. $ cc a.c -static $(pkg-config -static --cflags --libs imagequant | sed 's/gcc_s/gcc/') $ file ./a.out ./a.out: ELF 64-bit LSB executable, x86-64, version 1 (FreeBSD), statically linked, for FreeBSD 14.0 (1400085), FreeBSD-style, with debug_info, not stripped $ cat a.c #include <libimagequant.h> int main() { (void)liq_attr_create(); return 0; } Overlinking isn't a problem with static libraries as ld(1) only includes object files (*.o) from archives (*.a) that satisfy references. However, object files can be large, so one may want to pass -Wl,--gc-section to trim unused stuff. Note, to overlink a static library pass -Wl,--whole-archive |