From 32f035a05e04c0a396e1b43ee8f63bb412c13907 Mon Sep 17 00:00:00 2001 From: Max Ihlenfeldt Date: Fri, 10 Feb 2023 12:03:41 +0000 Subject: [PATCH] [PATCH] Revert "Use -ffile-compilation-dir= instead of -fdebug-compilation-dir=" and "[ios] Fix breakpoint in Swift files" ffile-compilation-dir is supported since clang 13, while meta-clang dunfel and hardknott are based on clang versions 11 and 12 respectively. Thus, revert the change and use fdebug-compilation-dir, which is supported by both versions. This reverts commits 34a955823630096f5b01c2b01d51c1ea59d22763 and 765a3d2a795431f4d5d06d0f39b3512dac4a81d5, except for the changes to toolchain/ios/swiftc.py. Upstream-Status: Inappropriate Signed-off-by: Max Ihlenfeldt --- build/config/compiler/BUILD.gn | 21 ++++++--------------- build/config/compiler/compiler.gni | 7 +++++-- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn index d1d3835578db0..6de8875a45eee 100644 --- a/build/config/compiler/BUILD.gn +++ b/build/config/compiler/BUILD.gn @@ -1290,7 +1290,6 @@ config("compiler_codegen") { config("compiler_deterministic") { cflags = [] ldflags = [] - swiftflags = [] # Eliminate build metadata (__DATE__, __TIME__ and __TIMESTAMP__) for # deterministic build. See https://crbug.com/314403 @@ -1319,20 +1318,12 @@ config("compiler_deterministic") { # different build directory like "out/feature_a" and "out/feature_b" if # we build same files with same compile flag. # Other paths are already given in relative, no need to normalize them. - if (is_nacl) { - # TODO(https://crbug.com/1231236): Use -ffile-compilation-dir= here. - cflags += [ - "-Xclang", - "-fdebug-compilation-dir", - "-Xclang", - ".", - ] - } else { - # -ffile-compilation-dir is an alias for both -fdebug-compilation-dir= - # and -fcoverage-compilation-dir=. - cflags += [ "-ffile-compilation-dir=." ] - swiftflags += [ "-file-compilation-dir=." ] - } + cflags += [ + "-Xclang", + "-fdebug-compilation-dir", + "-Xclang", + ".", + ] if (!is_win) { # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) asmflags = [ "-Wa,-fdebug-compilation-dir,." ] diff --git a/build/config/compiler/compiler.gni b/build/config/compiler/compiler.gni index 7a43b1113a495..5bec423af6c89 100644 --- a/build/config/compiler/compiler.gni +++ b/build/config/compiler/compiler.gni @@ -267,8 +267,11 @@ declare_args() { # deterministic builds to reduce compile times, so this is less relevant for # official builders. strip_absolute_paths_from_debug_symbols_default = - is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux || - is_chromeos || (is_apple && !enable_dsyms) + # TODO(crbug.com/1010267): remove '!use_clang_coverage', coverage build has + # dependency to absolute path of source files. + !use_clang_coverage && + (is_android || is_fuchsia || is_nacl || (is_win && use_lld) || is_linux || + is_chromeos || (is_apple && !enable_dsyms)) # If the platform uses stripped absolute paths by default, then we don't expose # it as a configuration option. If this is causing problems, please file a bug.