[clang] 5eedf07 - [apple clang] disable in-process CC1 to preserve crashlog compatibility

Alex Lorenz via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 5 10:58:38 PDT 2020


Author: Alex Lorenz
Date: 2020-06-05T10:55:42-07:00
New Revision: 5eedf07ab999d0a8ba43f41e0c1012d8f6e62c11

URL: https://github.com/llvm/llvm-project/commit/5eedf07ab999d0a8ba43f41e0c1012d8f6e62c11
DIFF: https://github.com/llvm/llvm-project/commit/5eedf07ab999d0a8ba43f41e0c1012d8f6e62c11.diff

LOG: [apple clang] disable in-process CC1 to preserve crashlog compatibility

The in-process CC1 currently doesn't interoperate with the macOS crash analytics,
which we would like to keep enabled for Apple clang. This commit restores the
out-of-process CC1 to the Apple clang CMake configuration for now.

Differential Revision: https://reviews.llvm.org/D80849

Added: 
    clang/test/Driver/apple-clang-defaults.c

Modified: 
    clang/cmake/caches/Apple-stage1.cmake
    clang/cmake/caches/Apple-stage2.cmake
    clang/test/lit.cfg.py
    clang/test/lit.site.cfg.py.in

Removed: 
    


################################################################################
diff  --git a/clang/cmake/caches/Apple-stage1.cmake b/clang/cmake/caches/Apple-stage1.cmake
index 4b11342086a5..8a4fe6dfdfdf 100644
--- a/clang/cmake/caches/Apple-stage1.cmake
+++ b/clang/cmake/caches/Apple-stage1.cmake
@@ -20,6 +20,7 @@ set(CMAKE_MACOSX_RPATH ON CACHE BOOL "")
 set(LLVM_ENABLE_ZLIB OFF CACHE BOOL "")
 set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
+set(CLANG_SPAWN_CC1 ON CACHE BOOL "")
 set(CLANG_BOOTSTRAP_PASSTHROUGH
   CMAKE_OSX_ARCHITECTURES
   CACHE STRING "")

diff  --git a/clang/cmake/caches/Apple-stage2.cmake b/clang/cmake/caches/Apple-stage2.cmake
index eb4827002011..b24ec558c071 100644
--- a/clang/cmake/caches/Apple-stage2.cmake
+++ b/clang/cmake/caches/Apple-stage2.cmake
@@ -16,6 +16,7 @@ set(LLVM_ENABLE_BACKTRACES OFF CACHE BOOL "")
 set(LLVM_ENABLE_MODULES ON CACHE BOOL "")
 set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
 set(CLANG_PLUGIN_SUPPORT OFF CACHE BOOL "")
+set(CLANG_SPAWN_CC1 ON CACHE BOOL "")
 set(BUG_REPORT_URL "http://developer.apple.com/bugreporter/" CACHE STRING "")
 
 set(LLVM_BUILD_EXTERNAL_COMPILER_RT ON CACHE BOOL "Build Compiler-RT with just-built clang")

diff  --git a/clang/test/Driver/apple-clang-defaults.c b/clang/test/Driver/apple-clang-defaults.c
new file mode 100644
index 000000000000..5673e32855a5
--- /dev/null
+++ b/clang/test/Driver/apple-clang-defaults.c
@@ -0,0 +1,7 @@
+// RUN: %clang -c %s -### 2>&1 | FileCheck %s --check-prefix=APPLE-CLANG
+// RUN: %clang -fintegrated-cc1 -c %s -### 2>&1 | FileCheck %s --check-prefix=EXPLICIT-IN-PROCESS
+
+// REQUIRES: clang-vendor=com.apple.clang
+
+// APPLE-CLANG-NOT: (in-process)
+// EXPLICIT-IN-PROCESS: (in-process)

diff  --git a/clang/test/lit.cfg.py b/clang/test/lit.cfg.py
index 0358a9d8a959..413f81175420 100644
--- a/clang/test/lit.cfg.py
+++ b/clang/test/lit.cfg.py
@@ -198,3 +198,7 @@ def calculate_arch_features(arch_string):
 
 if config.enable_shared:
     config.available_features.add("enable_shared")
+
+# Add a vendor-specific feature.
+if config.clang_vendor_uti:
+    config.available_features.add('clang-vendor=' + config.clang_vendor_uti)

diff  --git a/clang/test/lit.site.cfg.py.in b/clang/test/lit.site.cfg.py.in
index 4527ccadbb4a..d9b5b2f2592e 100644
--- a/clang/test/lit.site.cfg.py.in
+++ b/clang/test/lit.site.cfg.py.in
@@ -30,6 +30,7 @@ config.host_arch = "@HOST_ARCH@"
 config.python_executable = "@Python3_EXECUTABLE@"
 config.use_z3_solver = lit_config.params.get('USE_Z3_SOLVER', "@USE_Z3_SOLVER@")
 config.has_plugins = @LLVM_ENABLE_PLUGINS@
+config.clang_vendor_uti = "@CLANG_VENDOR_UTI@"
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.


        


More information about the cfe-commits mailing list