diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java index 089ae24b37bd3f..d30464ab7d026b 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkActionBuilder.java @@ -872,8 +872,7 @@ public CppLinkAction build() throws InterruptedException, RuleErrorException { getLinkType().linkerOrArchiver().equals(LinkerOrArchiver.LINKER), configuration.getBinDirectory(repositoryName).getExecPath(), output.getExecPathString(), - SolibSymlinkAction.getDynamicLibrarySoname( - output.getRootRelativePath(), /* preserveName= */ false), + output.getRootRelativePath().getBaseName(), linkType.equals(LinkTargetType.DYNAMIC_LIBRARY), paramFile != null ? paramFile.getExecPathString() : null, thinltoParamFile != null ? thinltoParamFile.getExecPathString() : null, diff --git a/src/test/shell/bazel/cpp_darwin_integration_test.sh b/src/test/shell/bazel/cpp_darwin_integration_test.sh index e26d2a902e93fd..4676e6c8f38c2a 100755 --- a/src/test/shell/bazel/cpp_darwin_integration_test.sh +++ b/src/test/shell/bazel/cpp_darwin_integration_test.sh @@ -124,41 +124,59 @@ EOF } function test_cc_test_with_explicit_install_name() { - mkdir -p cpp - cat > cpp/BUILD < cpp/install_name/BUILD < cpp/foo.h < cpp/install_name/foo.cc < cpp/foo.cc < cpp/install_name/bar.cc < cpp/test.cc < cpp/install_name/baz.cc < cpp/install_name/test.cc <