Do not condition linker_flags from DYNAMIC linking_mode_flags for transitive dynamic libraries on dynamic_linking_mode feature

https://github.com/bazelbuild/bazel/issues/6861

RELNOTES: None.
PiperOrigin-RevId: 238941083
This commit is contained in:
hlopko 2019-03-18 01:04:01 -07:00 committed by Copybara-Service
parent 10f38e16da
commit 0c017ebc6d
2 changed files with 5 additions and 5 deletions

View File

@ -66,12 +66,12 @@ def link_actions(toolchain):
return ALL_CC_LINK_ACTIONS return ALL_CC_LINK_ACTIONS
def transitive_link_actions(toolchain): def executable_link_actions(toolchain):
"""Returns transitive link actions for cc or objc rules.""" """Returns transitive link actions for cc or objc rules."""
if _is_objc_toolchain(toolchain): if _is_objc_toolchain(toolchain):
return TRANSITIVE_LINK_ACTIONS + ALL_OBJC_LINK_ACTIONS return CC_LINK_EXECUTABLE + ALL_OBJC_LINK_ACTIONS
else: else:
return TRANSITIVE_LINK_ACTIONS return CC_LINK_EXECUTABLE
def _is_objc_toolchain(toolchain): def _is_objc_toolchain(toolchain):
@ -429,7 +429,7 @@ def _extract_legacy_link_flag_sets_for(toolchain):
]) ])
result.append([ result.append([
feature_name, feature_name,
transitive_link_actions(toolchain), lmf.linker_flag, [] executable_link_actions(toolchain), lmf.linker_flag, []
]) ])
elif mode == "MOSTLY_STATIC": elif mode == "MOSTLY_STATIC":
result.append( result.append(

View File

@ -524,7 +524,7 @@ class LegacyFieldsMigrationLibTest(unittest.TestCase):
self.assertEqual(output.feature[0].flag_set[5].flag_group[0].flag, self.assertEqual(output.feature[0].flag_set[5].flag_group[0].flag,
["lmf-dynamic-flag-4"]) ["lmf-dynamic-flag-4"])
self.assertEqual(output.feature[0].flag_set[5].action, 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, self.assertEqual(output.feature[0].flag_set[6].flag_group[0].flag,
["dl-flag-5"]) ["dl-flag-5"])