From 0c017ebc6dfe8d7a21eb8b54d0219a92bf5500d7 Mon Sep 17 00:00:00 2001 From: hlopko Date: Mon, 18 Mar 2019 01:04:01 -0700 Subject: [PATCH] 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 --- tools/migration/legacy_fields_migration_lib.py | 8 ++++---- tools/migration/legacy_fields_migration_lib_test.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/migration/legacy_fields_migration_lib.py b/tools/migration/legacy_fields_migration_lib.py index 7e7c642..6107f92 100644 --- a/tools/migration/legacy_fields_migration_lib.py +++ b/tools/migration/legacy_fields_migration_lib.py @@ -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): @@ -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( diff --git a/tools/migration/legacy_fields_migration_lib_test.py b/tools/migration/legacy_fields_migration_lib_test.py index a47ad52..93972cc 100644 --- a/tools/migration/legacy_fields_migration_lib_test.py +++ b/tools/migration/legacy_fields_migration_lib_test.py @@ -524,7 +524,7 @@ class LegacyFieldsMigrationLibTest(unittest.TestCase): 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"])