Skip to content

Commit 8956a5b

Browse files
keithcopybara-github
authored andcommitted
Fix interface library soname
Copybara Import from #677 BEGIN_PUBLIC Fix interface library soname (#677) This path case is a bit complicated, copied from the other use of dynamic_library_soname. The boolean at the end was originally fixed in: bazelbuild/bazel@044a14c But it wasn't copied directly to the original version of the starlark implementation in: bazelbuild/bazel@25cf03c This mismatch results in missing binaries at runtime Closes #677 END_PUBLIC Startblock: * // Put other blockers before this line to avoid churning. * has lgtm * is approved * and then * all comments are resolved * and then *[] COPYBARA_INTEGRATE_REVIEW=#677 from keith:ks/fix-interface-library-soname d3b2b93 PiperOrigin-RevId: 902861494 Change-Id: I3dc721827901b24f9c6a4e67f8f6c7dc166a5d6c
1 parent f2cb3b4 commit 8956a5b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

cc/private/link/cc_linking_helper.bzl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ A module to create C/C++ link actions in a consistent way.
1818
load("@bazel_skylib//lib:paths.bzl", "paths")
1919
load(
2020
"//cc/common:cc_helper_internal.bzl",
21+
"root_relative_path",
2122
"wrap_with_check_private_api",
2223
_use_pic_for_binaries = "use_pic_for_binaries",
2324
_use_pic_for_dynamic_libs = "use_pic_for_dynamic_libs",
@@ -290,8 +291,9 @@ def _create_dynamic_link_actions(
290291
if not feature_configuration.is_enabled("targets_windows") and not feature_configuration.is_enabled("set_soname"):
291292
link_action_kwargs["linkopts"].append("-Wl,-soname=" + _cc_internal.dynamic_library_soname(
292293
actions,
293-
linker_output.short_path,
294-
False,
294+
# Must match https://github.com/bazelbuild/bazel/blob/795af54db5c348af5ca8b2961a982b399206ea20/src/main/java/com/google/devtools/build/lib/rules/cpp/SolibSymlinkAction.java#L169.
295+
root_relative_path(linker_output),
296+
dynamic_link_type != LINK_TARGET_TYPE.NODEPS_DYNAMIC_LIBRARY,
295297
))
296298

297299
mnemonic = "ObjcLink" if dynamic_link_type == LINK_TARGET_TYPE.OBJC_EXECUTABLE else None

0 commit comments

Comments
 (0)