From 58bb42ad7ca263a75c6eeef51482f805726663a5 Mon Sep 17 00:00:00 2001 From: Keith Smiley Date: Tue, 2 Feb 2021 02:44:04 -0800 Subject: [PATCH] Revert "Switch to -fdebug-compilation-dir" This reverts commit 0cb8757781e3ab9b4aee06483b74b46a2e4c6126. This flag isn't supported by Xcode 11.2, which is the newest available version for macOS 10.14 https://github.com/bazelbuild/bazel/pull/12354#issuecomment-765399006 Fixes https://github.com/bazelbuild/bazel/issues/12905 Closes #12882. PiperOrigin-RevId: 355126529 --- tools/osx/crosstool/cc_toolchain_config.bzl | 2 +- tools/osx/crosstool/wrapped_clang.cc | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/osx/crosstool/cc_toolchain_config.bzl b/tools/osx/crosstool/cc_toolchain_config.bzl index 0d541bf1011f32..d90b4a85850626 100644 --- a/tools/osx/crosstool/cc_toolchain_config.bzl +++ b/tools/osx/crosstool/cc_toolchain_config.bzl @@ -5400,7 +5400,7 @@ def _impl(ctx): ACTION_NAMES.objc_compile, ACTION_NAMES.objcpp_compile, ], - flag_groups = [flag_group(flags = ["-fdebug-compilation-dir", "."])], + flag_groups = [flag_group(flags = ["DEBUG_PREFIX_MAP_PWD=."])], ), ], ) diff --git a/tools/osx/crosstool/wrapped_clang.cc b/tools/osx/crosstool/wrapped_clang.cc index febf3cb246cbec..403528707b7bb5 100644 --- a/tools/osx/crosstool/wrapped_clang.cc +++ b/tools/osx/crosstool/wrapped_clang.cc @@ -318,6 +318,9 @@ void ProcessArgument(const std::string arg, const std::string developer_dir, } std::string dest_dir, bitcode_symbol_map; + if (SetArgIfFlagPresent(arg, "DEBUG_PREFIX_MAP_PWD", &dest_dir)) { + new_arg = "-fdebug-prefix-map=" + cwd + "=" + dest_dir; + } if (arg.compare("OSO_PREFIX_MAP_PWD") == 0) { new_arg = "-Wl,-oso_prefix," + cwd + "/"; }