diff options
| author | Anuj Mittal <anuj.mittal@intel.com> | 2021-10-13 00:07:17 +0800 | 
|---|---|---|
| committer | Anuj Mittal <anuj.mittal@intel.com> | 2021-10-13 11:23:41 +0800 | 
| commit | a809b8c531f6f0176f7148977b1237319abdd660 (patch) | |
| tree | 88ce637013b0ea30224d778413417c5fe9e972cf /dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch | |
| parent | 467d15d57afea208fb7bc35e486ee274700dca70 (diff) | |
| download | meta-intel-a809b8c531f6f0176f7148977b1237319abdd660.tar.gz | |
Remove support for gatesgarth
Building with oe-core gatesgarth is no longer supported. Remove from
LAYERSERIES_COMPAT and remove the LLVM 11 patches as well.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
Diffstat (limited to 'dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch')
| -rw-r--r-- | dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch | 52 | 
1 files changed, 0 insertions, 52 deletions
diff --git a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch b/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch deleted file mode 100644 index 2b86532c..00000000 --- a/dynamic-layers/clang-layer/recipes-devtools/clang/files/llvm11-0005-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch +++ /dev/null  | |||
| @@ -1,52 +0,0 @@ | |||
| 1 | From 747e48959e18ac8b586078a82472a0799d12925c Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Raphael Isemann <teemperor@gmail.com> | ||
| 3 | Date: Thu, 1 Apr 2021 18:41:44 +0200 | ||
| 4 | Subject: [PATCH 5/6] Avoid calling ParseCommandLineOptions in BackendUtil if | ||
| 5 | possible | ||
| 6 | |||
| 7 | Calling `ParseCommandLineOptions` should only be called from `main` as the | ||
| 8 | CommandLine setup code isn't thread-safe. As BackendUtil is part of the | ||
| 9 | generic Clang FrontendAction logic, a process which has several threads executing | ||
| 10 | Clang FrontendActions will randomly crash in the unsafe setup code. | ||
| 11 | |||
| 12 | This patch avoids calling the function unless either the debug-pass option or | ||
| 13 | limit-float-precision option is set. Without these two options set the | ||
| 14 | `ParseCommandLineOptions` call doesn't do anything beside parsing | ||
| 15 | the command line `clang` which doesn't set any options. | ||
| 16 | |||
| 17 | See also D99652 where LLDB received a workaround for this crash. | ||
| 18 | |||
| 19 | Reviewed By: JDevlieghere | ||
| 20 | |||
| 21 | Differential Revision: https://reviews.llvm.org/D99740 | ||
| 22 | |||
| 23 | Upstream-Status: Backport [Taken from opencl-clang patches; https://github.com/intel/opencl-clang/blob/ocl-open-110/patches/clang/0003-Avoid-calling-ParseCommandLineOptions-in-BackendUtil.patch] | ||
| 24 | |||
| 25 | Signed-off-by: Naveen Saini <naveen.kumar.saini@intel.com> | ||
| 26 | --- | ||
| 27 | clang/lib/CodeGen/BackendUtil.cpp | 8 ++++++++ | ||
| 28 | 1 file changed, 8 insertions(+) | ||
| 29 | |||
| 30 | diff --git a/clang/lib/CodeGen/BackendUtil.cpp b/clang/lib/CodeGen/BackendUtil.cpp | ||
| 31 | index dce0940670a2..ab478090ed1c 100644 | ||
| 32 | --- a/clang/lib/CodeGen/BackendUtil.cpp | ||
| 33 | +++ b/clang/lib/CodeGen/BackendUtil.cpp | ||
| 34 | @@ -797,7 +797,15 @@ static void setCommandLineOpts(const CodeGenOptions &CodeGenOpts) { | ||
| 35 | BackendArgs.push_back("-limit-float-precision"); | ||
| 36 | BackendArgs.push_back(CodeGenOpts.LimitFloatPrecision.c_str()); | ||
| 37 | } | ||
| 38 | + // Check for the default "clang" invocation that won't set any cl::opt values. | ||
| 39 | + // Skip trying to parse the command line invocation to avoid the issues | ||
| 40 | + // described below. | ||
| 41 | + if (BackendArgs.size() == 1) | ||
| 42 | + return; | ||
| 43 | BackendArgs.push_back(nullptr); | ||
| 44 | + // FIXME: The command line parser below is not thread-safe and shares a global | ||
| 45 | + // state, so this call might crash or overwrite the options of another Clang | ||
| 46 | + // instance in the same process. | ||
| 47 | llvm::cl::ParseCommandLineOptions(BackendArgs.size() - 1, | ||
| 48 | BackendArgs.data()); | ||
| 49 | } | ||
| 50 | -- | ||
| 51 | 2.17.1 | ||
| 52 | |||
