Skip to content

Fix static linking against libbsd on ubuntu#180

Closed
mrdomino wants to merge 1 commit intorust-lang:masterfrom
mrdomino:fix-static
Closed

Fix static linking against libbsd on ubuntu#180
mrdomino wants to merge 1 commit intorust-lang:masterfrom
mrdomino:fix-static

Conversation

@mrdomino
Copy link

@mrdomino mrdomino commented Aug 25, 2025

I noticed that I was getting a shared dependency on libbsd.so from a package using pkg-config recently, and it seems to be due to this changed line; the Ubuntu libbsd pkg-config name is libbsd, so previously is_static_available would look for liblibbsd.

At a glance, it seems like a few different libraries have libfoo.pc as libbsd does, so I’ve proposed the following change, just adding {}.a to the list after lib{}.a.

I noticed that I was getting a shared dependency on libbsd.so from a
package using pkg-config recently, and it seems to be due to this
changed line; the Ubuntu libbsd pkg-config name is `libbsd`, so
previously `is_static_available` would look for `liblibbsd`.

At a glance, it seems like a few different libraries have `libfoo.pc` as
libbsd does, so I’ve proposed the following change, just adding `{}.a`
to the list after `lib{}.a`.
@mrdomino
Copy link
Author

mrdomino commented Aug 25, 2025

Huh, actually, this does not fix it.

Here is an example log:

https://github.com/mrdomino/readpassphrase-3/actions/runs/17199525547/job/48787478567?pr=11#step:8:48

I’d expect that line to be cargo:rustc-link-lib=static=bsd based on build.rs passing statik(true):

https://github.com/mrdomino/readpassphrase-3/pull/11/files#diff-d0d98998092552a1d3259338c2c71e118a5b8343dd4703c0c7f552ada7f9cb42R15

But it is not (nor is it in a local checkout that has pkg-config-rs with this change in it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments