Conversation
ee96d73 to
74b1731
Compare
sdroege
left a comment
There was a problem hiding this comment.
Thanks, this looks correct but can you add some tests for this?
| // this would be cleaner with an if-let chain of strip_prefix and | ||
| // strip_suffix, and would be "safer" without random slicing |
There was a problem hiding this comment.
Please update that accordingly. MSRV was updated :) Then clippy is also more happy.
| // adding a library multiple times with different modifiers is not allowed by | ||
| // rustc, but can be allowed by c compilers | ||
| if added_libs.contains(&val) { |
There was a problem hiding this comment.
This de-dup should probably go into a separate commit with explanation (can be in the same PR).
Duplicated libraries are now skipped before emitting linker arguments. When testing the new changes with DPDK, the flags generated from the pkg-config file had some duplicated libraries. Passing same values to rustc-link-arg multiple times results in: "error: overriding linking modifiers from command line is not supported". The cause of this issue is that DPDK provides two files: libdpdk.pc and libdpdk-libs.pc. libdpdk.pc requires libdpdk-libs.pc, so contents of both files get merged and returned by the pkt-config command. However, some objects appear in both files, which causes the error.
74b1731 to
3bd7004
Compare
So I added a field There are no other tests which require |
|
For now, the approach I am going with is to ignore
Based on this snippet from GNU LD docs, it might be safe to assume that making this change should be functionally correct, and that the whole archive being used while the archive being unavailable should result in an error (which it would after this change) |
This should fix #179.
Tested locally by statically linking DPDK, which would lead to runtime errors without this patch. Open to any feedback, thanks!