forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
C++: Fix crash reported in bazelbuild#7721
objc_libraries used to always take the static libraries of C++ dependencies even if dynamic libraries were available. This is because support for dynamic linking of C++ dependencies hasn't been added to objective-C rules yet. With bazelbuild@3e727b1#diff-033df3f3a834149658486b8a5754baefL438, we started propagating both static libraries and dynamic libraries in the new implementation of LibraryToLink. Since cc_test by default will always try to link dynamically, the behavior changed and if we had the dependency chain cc_test -> objc_library -> cc_library; the cc_test would start using the .so file from the cc_library, whereas before it used the .a file. Linking the .so file gives an error since as mentioned, support for this hasn't been added to Objective-C. The fix has been to nullify the dynamic library fields of LibraryToLink as long as a static library was present. This makes the behavior the same as before. RELNOTES:none PiperOrigin-RevId: 239226003
- Loading branch information
1 parent
044a5f9
commit ea1703b
Showing
4 changed files
with
84 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters