1From 32f035a05e04c0a396e1b43ee8f63bb412c13907 Mon Sep 17 00:00:00 2001
2From: Max Ihlenfeldt <max@igalia.com>
3Date: Fri, 10 Feb 2023 12:03:41 +0000
4Subject: [PATCH] [PATCH] Revert "Use -ffile-compilation-dir= instead of
5 -fdebug-compilation-dir=" and "[ios] Fix breakpoint in Swift files"
6
7ffile-compilation-dir is supported since clang 13, while
8meta-clang dunfel and hardknott are based on clang versions
911 and 12 respectively. Thus, revert the change and use
10fdebug-compilation-dir, which is supported by both
11versions.
12
13This reverts commits 34a955823630096f5b01c2b01d51c1ea59d22763 and
14765a3d2a795431f4d5d06d0f39b3512dac4a81d5, except for the changes to
15toolchain/ios/swiftc.py.
16
17Upstream-Status: Inappropriate
18
19Signed-off-by: Max Ihlenfeldt <max@igalia.com>
20
21---
22 build/config/compiler/BUILD.gn     | 21 ++++++---------------
23 build/config/compiler/compiler.gni |  7 +++++--
24 2 files changed, 11 insertions(+), 17 deletions(-)
25
26diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
27index d1d3835578db0..6de8875a45eee 100644
28--- a/build/config/compiler/BUILD.gn
29+++ b/build/config/compiler/BUILD.gn
30@@ -1290,7 +1290,6 @@ config("compiler_codegen") {
31 config("compiler_deterministic") {
32   cflags = []
33   ldflags = []
34-  swiftflags = []
35
36   # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for
37   # deterministic build.  See https://crbug.com/314403
38@@ -1319,20 +1318,12 @@ config("compiler_deterministic") {
39     # different build directory like "out/feature_a" and "out/feature_b" if
40     # we build same files with same compile flag.
41     # Other paths are already given in relative, no need to normalize them.
42-    if (is_nacl) {
43-      # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here.
44-      cflags += [
45-        "-Xclang",
46-        "-fdebug-compilation-dir",
47-        "-Xclang",
48-        ".",
49-      ]
50-    } else {
51-      # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir=
52-      # and -fcoverage-compilation-dir=.
53-      cflags += [ "-ffile-compilation-dir=." ]
54-      swiftflags += [ "-file-compilation-dir=." ]
55-    }
56+    cflags += [
57+      "-Xclang",
58+      "-fdebug-compilation-dir",
59+      "-Xclang",
60+      ".",
61+    ]
62     if (!is_win) {
63       # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167)
64       asmflags = [ "-Wa,-fdebug-compilation-dir,." ]
65diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni
66index 7a43b1113a495..5bec423af6c89 100644
67--- a/build/config/compiler/compiler.gni
68+++ b/build/config/compiler/compiler.gni
69@@ -267,8 +267,11 @@ declare_args() {
70 # deterministic builds to reduce compile times, so this is less relevant for
71 # official builders.
72 strip_absolute_paths_from_debug_symbols_default =
73-    is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
74-    is_chromeos || (is_apple && !enable_dsyms)
75+    # TODO(crbug.com/1010267): remove '!use_clang_coverage', coverage build has
76+    # dependency to absolute path of source files.
77+    !use_clang_coverage &&
78+    (is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux ||
79+     is_chromeos || (is_apple && !enable_dsyms))
80
81 # If the platform uses stripped absolute paths by default, then we don't expose
82 # it as a configuration option. If this is causing problems, please file a bug.
83