Skip to content

Commit

Permalink
Do not condition linker_flags from DYNAMIC linking_mode_flags for tra…
Browse files Browse the repository at this point in the history
…nsitive dynamic libraries on dynamic_linking_mode feature

bazelbuild/bazel#6861

RELNOTES: None.
PiperOrigin-RevId: 238941083
  • Loading branch information
hlopko authored and copybara-github committed Mar 18, 2019
1 parent 10f38e1 commit 0c017eb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions tools/migration/legacy_fields_migration_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,12 @@ def link_actions(toolchain):
return ALL_CC_LINK_ACTIONS


def transitive_link_actions(toolchain):
def executable_link_actions(toolchain):
"""Returns transitive link actions for cc or objc rules."""
if _is_objc_toolchain(toolchain):
return TRANSITIVE_LINK_ACTIONS + ALL_OBJC_LINK_ACTIONS
return CC_LINK_EXECUTABLE + ALL_OBJC_LINK_ACTIONS
else:
return TRANSITIVE_LINK_ACTIONS
return CC_LINK_EXECUTABLE


def _is_objc_toolchain(toolchain):
Expand Down Expand Up @@ -429,7 +429,7 @@ def _extract_legacy_link_flag_sets_for(toolchain):
])
result.append([
feature_name,
transitive_link_actions(toolchain), lmf.linker_flag, []
executable_link_actions(toolchain), lmf.linker_flag, []
])
elif mode == "MOSTLY_STATIC":
result.append(
Expand Down
2 changes: 1 addition & 1 deletion tools/migration/legacy_fields_migration_lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def test_all_linker_flag_ordering(self):
self.assertEqual(output.feature[0].flag_set[5].flag_group[0].flag,
["lmf-dynamic-flag-4"])
self.assertEqual(output.feature[0].flag_set[5].action,
TRANSITIVE_LINK_ACTIONS)
CC_LINK_EXECUTABLE)

self.assertEqual(output.feature[0].flag_set[6].flag_group[0].flag,
["dl-flag-5"])
Expand Down

0 comments on commit 0c017eb

Please sign in to comment.