use-ffile-compilation-dir.patch 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. From 34a955823630096f5b01c2b01d51c1ea59d22763 Mon Sep 17 00:00:00 2001
  2. From: Zequan Wu <zequanwu@google.com>
  3. Date: Tue, 20 Jul 2021 14:13:50 +0000
  4. Subject: [PATCH] Use -ffile-compilation-dir= instead of
  5. -fdebug-compilation-dir=
  6. Bug: 1010267
  7. Change-Id: If2b4ead8535a76490eb466a38e3d8fed6ea91079
  8. Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2770738
  9. Auto-Submit: Zequan Wu <zequanwu@google.com>
  10. Commit-Queue: Nico Weber <thakis@chromium.org>
  11. Reviewed-by: Nico Weber <thakis@chromium.org>
  12. Cr-Commit-Position: refs/heads/master@{#903456}
  13. ---
  14. build/config/compiler/BUILD.gn | 18 ++++++++++++------
  15. build/config/compiler/compiler.gni | 7 ++-----
  16. 2 files changed, 14 insertions(+), 11 deletions(-)
  17. diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
  18. index ede07d111c..6db16c1cdd 100644
  19. --- a/build/config/compiler/BUILD.gn
  20. +++ b/build/config/compiler/BUILD.gn
  21. @@ -1216,12 +1216,18 @@ config("compiler_deterministic") {
  22. # different build directory like "out/feature_a" and "out/feature_b" if
  23. # we build same files with same compile flag.
  24. # Other paths are already given in relative, no need to normalize them.
  25. - cflags += [
  26. - "-Xclang",
  27. - "-fdebug-compilation-dir",
  28. - "-Xclang",
  29. - ".",
  30. - ]
  31. + if (is_nacl) {
  32. + cflags += [
  33. + "-Xclang",
  34. + "-fdebug-compilation-dir",
  35. + "-Xclang",
  36. + ".",
  37. + ]
  38. + } else {
  39. + # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
  40. + # and -fcoverage-compilation-dir=.
  41. + cflags += [ "-ffile-compilation-dir=." ]
  42. + }
  43. if (!is_win) {
  44. # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
  45. asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
  46. diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
  47. index 8c259c360a..642319b4f4 100644
  48. --- a/build/config/compiler/compiler.gni
  49. +++ b/build/config/compiler/compiler.gni
  50. @@ -225,11 +225,8 @@ declare_args() {
  51. # deterministic builds to reduce compile times, so this is less relevant for
  52. # official builders.
  53. strip_absolute_paths_from_debug_symbols_default =
  54. - # TODO(crbug.com/1010267): remove '!use_clang_coverage', coverage build has
  55. - # dependency to absolute path of source files.
  56. - !use_clang_coverage &&
  57. - (is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
  58. - is_chromeos || (is_apple && !enable_dsyms))
  59. + is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
  60. + is_chromeos || (is_apple && !enable_dsyms)
  61. # If the platform uses stripped absolute paths by default, then we don't expose
  62. # it as a configuration option. If this is causing problems, please file a bug.