From 1b46105eb00109b325fec48cc0e3a8fef1bbec10 Mon Sep 17 00:00:00 2001 From: Luca Di Grazia Date: Sun, 4 Sep 2022 19:31:30 +0200 Subject: [PATCH] Modify the legacy features to pass flags to lto-index actions as well With https://github.com/bazelbuild/bazel/issues/6791 Bazel will not obtain these flags from C++ link actions anymore. RELNOTES: None. PiperOrigin-RevId: 256340042 --- .../build/lib/rules/cpp/CppActionConfigs.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java index 9184dd38f0b..20c20b4b357 100644 --- a/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java +++ b/dataset/GitHub_Java/bazelbuild.bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java @@ -298,8 +298,8 @@ public static ImmutableList 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'", " }", " }"))); @@ -341,8 +341,8 @@ public static ImmutableList 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'", " }", " }"))); @@ -360,8 +360,9 @@ public static ImmutableList 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}'", " }", " }"))); } @@ -1572,7 +1573,7 @@ public static ImmutableList 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); }