Comments (6)
Thanks for the update!
from pkg-config-rs.
Wouldn't the more correct way to deal with this be to add these linker flags to the pkg-config file for these object files?
from pkg-config-rs.
Wouldn't the more correct way to deal with this be to add these linker flags to the pkg-config file for these object files?
That's one solution. My problem is within a large enterprise codebase where I do not have access to modify the many packages and dependencies that I need now and will need over time. With rustc defaulting to +whole-archive
for every single library - not just the problematic ones - this leads to a lot of unnecessary code getting linked in.
from pkg-config-rs.
We've also discovered a related issue with rustc that would make this change unusable for now. This section of the compiler ends the link step if any two packages with the same names have modifiers; not if they have different modifiers, but if they have any at all. So if we were able to add linking modifiers in this crate, it would error if any explicit dependencies share a dependency.
from pkg-config-rs.
How would you like this to work btw? Having API to specify per package, or even per library, linking modifiers? This seems like the wrong place for doing that to me. No other language I'm aware of needs this when consuming pkg-config files :)
from pkg-config-rs.
So actually I think we can close this. It is not an issue with pkg-config but an issue with rustc where cargo test
defaults to whole-archive
. Thanks for chatting :)
from pkg-config-rs.
Related Issues (20)
- Static linking is too restrictive HOT 13
- Install/build pkg-config if it's not available on the system HOT 6
- Dependencies on the environment variables are not properly reported to cargo HOT 4
- Using pkg-config in build.rs on FreeBSD brokes ncurses normal work HOT 2
- Improving cross-compilation experience HOT 3
- Add readme = "README.md" in cargo.toml to have the readme displayed on crates.io HOT 2
- Dependency being constantly rebuilt due to 'env_metadata' being set to 'true' HOT 8
- Should we parse -isystem Cflags? HOT 2
- customized pkg-config is incomplete? HOT 1
- Bug: Missing support for `pkgconf` for Fedora HOT 3
- v0.3.21 raised MSRV to 1.47.0 HOT 4
- Placing pkg-config.exe file to this git if possible HOT 3
- Libraries linked in incorrect order HOT 3
- Incorrect parse result for raw archive path HOT 3
- `PKG_CONFIG_PATH_FOR_BUILD` env var HOT 4
- Allow disabling pkg-config altogether HOT 7
- static-nobundle option
- PKG_CONFIG_ALLOW_SYSTEM_CFLAGS and cross-compiling
- pkg-config finds mingw *.a library for msvc target HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pkg-config-rs.