Allow controlling whether the soname is set in cc_shared_library. #18798
Labels
help wanted
Someone outside the Bazel team could own this
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Add new toolchain feature to allow the soname to be added to cc_shared_libraries when the feature is enabled.
The following condition (https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/rules/cpp/CcLinkingHelper.java;drc=044a14cca2747aeff258fc71eaeb153c08cb34d5;l=687) should have:
The feature "add_soname_to_transitive_shared_libraries" doesn't exist yet and needs to be added to the default unix_cc_toolchain_config.bzl toolchain.
This is an incompatible change and projects would have to explicitly enable the feature for all their shared libraries or individual ones. This is an incompatible change because existing builds copy and rename the cc_shared_library library output, if the soname is set then whatever links against it will use the soname and the library won't be found at runtime.
A workaround is to pass the flag
-Wl,-soname=libA.so
viacc_shared_library.user_link_flags
.Originally posted by @Distancess in #18765 (reply in thread)
The text was updated successfully, but these errors were encountered: