Skip to content

Commit

Permalink
Modify the legacy features to pass flags to lto-index actions as well
Browse files Browse the repository at this point in the history
With bazelbuild#6791 Bazel will not obtain these flags from C++ link actions anymore.

RELNOTES: None.
PiperOrigin-RevId: 256340042
  • Loading branch information
scentini authored and irengrig committed Jul 15, 2019
1 parent 639d16c commit db6d6c8
Showing 1 changed file with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'c++-link-executable'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'fdo_instrument_path'",
" flag: '-fprofile-generate=%{fdo_instrument_path}'",
Expand Down Expand Up @@ -316,6 +319,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'c++-link-executable'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'cs_fdo_instrument_path'",
" flag: '-fcs-profile-generate=%{cs_fdo_instrument_path}'",
Expand Down Expand Up @@ -388,6 +394,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" with_feature { feature: 'supports_interface_shared_libraries' }",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" flag_group {",
" expand_if_all_available: 'generate_interface_library'",
" flag: '%{generate_interface_library}'",
Expand All @@ -410,6 +418,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" with_feature { feature: 'supports_interface_shared_libraries' }",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" flag_group {",
" expand_if_all_available: 'generate_interface_library'",
" flag: '" + cppLinkDynamicLibraryToolPath + "'",
Expand All @@ -427,6 +437,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'symbol_counts_output'",
" flag: '-Wl,--print-symbol-counts=%{symbol_counts_output}'",
Expand All @@ -442,6 +455,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" flag_set {",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" flag_group {",
" flag: '-shared'",
" }",
Expand All @@ -457,6 +472,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'linkstamp_paths'",
" iterate_over: 'linkstamp_paths'",
Expand All @@ -474,6 +492,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'c++-link-executable'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'output_execpath'",
" flag: '-o'",
Expand All @@ -492,6 +513,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'runtime_library_search_directories'",
" iterate_over: 'runtime_library_search_directories'",
Expand Down Expand Up @@ -519,6 +543,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'runtime_library_search_directories'",
" iterate_over: 'runtime_library_search_directories'",
Expand All @@ -545,6 +572,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'library_search_directories'",
" iterate_over: 'library_search_directories'",
Expand Down Expand Up @@ -603,6 +633,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
ifTrue(
doNotSplitLinkingCmdline,
" flag_group {",
Expand Down Expand Up @@ -769,6 +802,7 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" name: 'force_pic_flags'",
" flag_set {",
" action: 'c++-link-executable'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'force_pic'",
ifLinux(platform, "flag: '-pie'"),
Expand All @@ -786,6 +820,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'user_link_flags'",
" iterate_over: 'user_link_flags'",
Expand All @@ -803,6 +840,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'legacy_link_flags'",
" iterate_over: 'legacy_link_flags'",
Expand All @@ -820,6 +860,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" flag_set {",
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-executable'",
" with_feature { feature: 'static_link_cpp_runtimes' }",
" flag_group {",
" flag: '-static-libgcc'",
Expand All @@ -836,6 +878,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'is_using_fission'",
" flag: '-Wl,--gdb-index'",
Expand All @@ -852,6 +897,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'strip_debug_symbols'",
" flag: '-Wl,-S'",
Expand Down Expand Up @@ -882,6 +930,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'c++-link-executable'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" action: 'objc-executable'",
" action: 'objc++-executable'",
" flag_group {",
Expand Down Expand Up @@ -915,6 +966,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'c++-link-executable'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" flag: '--coverage'",
" }",
Expand Down Expand Up @@ -1329,6 +1383,8 @@ public static ImmutableList<CToolchain.Feature> getFeaturesToAppearLastInFeature
" flag_set {",
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" flag: '-static'",
" }",
Expand Down Expand Up @@ -1376,6 +1432,9 @@ public static ImmutableList<CToolchain.Feature> getFeaturesToAppearLastInFeature
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" action: 'clif-match'",
" action: 'lto-backend'",
" flag_group {",
Expand Down Expand Up @@ -1428,6 +1487,9 @@ public static ImmutableList<CToolchain.Feature> getFeaturesToAppearLastInFeature
" action: 'c++-link-executable'",
" action: 'c++-link-dynamic-library'",
" action: 'c++-link-nodeps-dynamic-library'",
" action: 'lto-index-for-dynamic-library'",
" action: 'lto-index-for-nodeps-dynamic-library'",
" action: 'lto-index-for-executable'",
" flag_group {",
" expand_if_all_available: 'linker_param_file'",
dynamicLibraryParamFile,
Expand Down

0 comments on commit db6d6c8

Please sign in to comment.