Commit e4bc370
Ck/cherry pick cc shared library (bazelbuild#15754)
* Add regular library in interface_library group of cc_shared_library
The regular library was already accessible via the main_shared_library_output group but making it also available in interface_library when there is no actual interface library available is inline with the current behavior of cc_binary.
RELNOTES:none
PiperOrigin-RevId: 455497044
Change-Id: Ia80fed253e0c79584f23f08eb25b930362e3ff02
* Remove unnecessary file from runfiles of cc_shared_library
When a precompilied library appeared in the transitive closure of a
cc_shared_library, we would be adding the library itself to runfiles as well as
the symlink created in the solib directory. Although harmless, it is
unnecessary to add the original library since the symlink in the solib
directory will be followed anyway by the Bazel runfiles logic. The behavior now
matches that of cc_binary(linkshared=1)
The same reasoning can be applied for the main output of a cc_shared_library or
a cc_binary(linkshared=1). However, for the latter the logic is written the
opposite way, it only adds the library and not the symlink in solib. Unlike
cc_binary(linkshared=1), for cc_shared_library we must add the symlink in
cc_shared_library because this is what its dependents are linked against. We
could just add the symlink in solib and be done since it will in turn pull the
original library. However, to keep it more similar to cc_binary(linkshared=1)
we add also add the original library, this is documented in this CL with a
comment.
RELNOTES:none
PiperOrigin-RevId: 456074285
Change-Id: Ic383c04569b3d780ca09fc09713bce95c3304636
Co-authored-by: Googler <[email protected]>1 parent fbc5cb6 commit e4bc370
File tree
2 files changed
+76
-0
lines changed- src/main/starlark
- builtins_bzl/common/cc
2 files changed
+76
-0
lines changedLines changed: 21 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
483 | 488 | | |
484 | 489 | | |
485 | 490 | | |
| |||
489 | 494 | | |
490 | 495 | | |
491 | 496 | | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
492 | 506 | | |
493 | 507 | | |
494 | 508 | | |
| |||
511 | 525 | | |
512 | 526 | | |
513 | 527 | | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
514 | 535 | | |
515 | 536 | | |
516 | 537 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
0 commit comments