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/bazel#6791 Bazel will not obtain these flags from C++ link actions anymore.

    RELNOTES: None.
    PiperOrigin-RevId: 256340042
  • Loading branch information
Luca Di Grazia committed Sep 4, 2022
1 parent 75b435b commit 1b46105
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" flag_group {",
" expand_if_all_available: 'fdo_profile_path'",
" flag: '-fprofile-use=%{fdo_profile_path}'",
" flag: '-Wno-profile-instr-unprofiled'",
" flag: '-Wno-profile-instr-out-of-date'",
" flag: '-Xclang-only=-Wno-profile-instr-unprofiled'",
" flag: '-Xclang-only=-Wno-profile-instr-out-of-date'",
" flag: '-fprofile-correction'",
" }",
" }")));
Expand Down Expand Up @@ -341,8 +341,8 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" flag_group {",
" expand_if_all_available: 'fdo_profile_path'",
" flag: '-fprofile-use=%{fdo_profile_path}'",
" flag: '-Wno-profile-instr-unprofiled'",
" flag: '-Wno-profile-instr-out-of-date'",
" flag: '-Xclang-only=-Wno-profile-instr-unprofiled'",
" flag: '-Xclang-only=-Wno-profile-instr-out-of-date'",
" flag: '-fprofile-correction'",
" }",
" }")));
Expand All @@ -360,8 +360,9 @@ public static ImmutableList<CToolchain.Feature> getLegacyFeatures(
" action: 'lto-backend'",
" flag_group {",
" expand_if_all_available: 'fdo_prefetch_hints_path'",
" flag: '-mllvm'",
" flag: '-prefetch-hints-file=" + "%{fdo_prefetch_hints_path}'",
" flag: '-Xclang-only=-mllvm'",
" flag: '-Xclang-only=-prefetch-hints-file="
+ "%{fdo_prefetch_hints_path}'",
" }",
" }")));
}
Expand Down Expand Up @@ -1572,7 +1573,7 @@ public static ImmutableList<CToolchain.Feature> getFeaturesToAppearLastInFeature
}

private static String ifLinux(CppPlatform platform, String... lines) {
// Platform `LINUX` also includes FreeBSD and OpenBSD.
// Platform `LINUX` also includes FreeBSD.
return ifTrue(platform == CppPlatform.LINUX, lines);
}

Expand Down

0 comments on commit 1b46105

Please sign in to comment.