Date: Friday, July 9, 2021 @ 06:19:54 Author: foutrelis Revision: 419327
upgpkg: clang 12.0.1-1: new upstream release Modified: clang/trunk/PKGBUILD Deleted: clang/trunk/clangd-CompletionModel-cmake.patch clang/trunk/opencl-respect-calling-convention-for-builtin.patch clang/trunk/partially-revert-scan-view-remove-Reporter.py.patch -----------------------------------------------------+ PKGBUILD | 21 - clangd-CompletionModel-cmake.patch | 66 ----- opencl-respect-calling-convention-for-builtin.patch | 107 -------- partially-revert-scan-view-remove-Reporter.py.patch | 225 ------------------ 4 files changed, 4 insertions(+), 415 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2021-07-09 06:05:22 UTC (rev 419326) +++ PKGBUILD 2021-07-09 06:19:54 UTC (rev 419327) @@ -2,7 +2,7 @@ # Contributor: Jan "heftig" Steffens <[email protected]> pkgname=clang -pkgver=12.0.0 +pkgver=12.0.1 pkgrel=1 pkgdesc="C language family frontend for LLVM" arch=('x86_64') @@ -20,20 +20,14 @@ source=($_source_base/$pkgname-$pkgver.src.tar.xz{,.sig} $_source_base/clang-tools-extra-$pkgver.src.tar.xz{,.sig} $_source_base/llvm-$pkgver.src.tar.xz{,.sig} - partially-revert-scan-view-remove-Reporter.py.patch - opencl-respect-calling-convention-for-builtin.patch - clangd-CompletionModel-cmake.patch clang-link-with-Bsymbolic-functions.patch enable-SSP-and-PIE-by-default.patch) -sha256sums=('e26e452e91d4542da3ebbf404f024d3e1cbf103f4cd110c26bf0a19621cca9ed' +sha256sums=('6e912133bcf56e9cfe6a346fa7e5c52c2cde3e4e48b7a6cc6fcc7c75047da45f' 'SKIP' - 'ad41e0b527a65ade95c1ba690a5434cefaab4a2daa1be307caaa1e8541fe6d5c' + '65659efdf97dbed70ae0caee989936b731f249dddc46f1cb4225b2f49b232ae5' 'SKIP' - '49dc47c8697a1a0abd4ee51629a696d7bfe803662f2a7252a3b16fc75f3a8b50' + '7d9a8405f557cefc5a21bf5672af73903b64749d9bc3a50322239f56f34ffddf' 'SKIP' - '68be2fb78e62f76702a156d4c1759b4c6f0d805e1b492e9c6f490ce40862138d' - '859d34dac43999edfc4c33e1cbb6e7458921fa9f16a93514701c1a9706665d24' - '6739abedc8870879618414c5358fda4fcfd4a3ac7a22030ac7c409779b68f669' '5bc0b47c70990bb8dd0cf4138a8ab9e15cf6b008b7c0cf2c7aac3736b559e0e6' 'a877fa5cf1c1cca3bd55f9a36cf8c1bdd061ff398aeace90fe3cbd9e82550da3') validpgpkeys+=('B6C8F98282B944E3B0D5C2530FC3042E345AD05D') # Hans Wennborg <[email protected]> @@ -67,13 +61,6 @@ mv "$srcdir/clang-tools-extra-$pkgver.src" tools/extra patch -Np2 -i ../enable-SSP-and-PIE-by-default.patch - # Some fixes from the release/12.x branch - patch -Np2 -i ../partially-revert-scan-view-remove-Reporter.py.patch - patch -Np2 -i ../opencl-respect-calling-convention-for-builtin.patch - - # https://bugs.llvm.org/show_bug.cgi?id=49990 - patch -Np2 -d tools/extra <../clangd-CompletionModel-cmake.patch - # https://bugs.archlinux.org/task/70697 patch -Np2 -i ../clang-link-with-Bsymbolic-functions.patch } Deleted: clangd-CompletionModel-cmake.patch =================================================================== --- clangd-CompletionModel-cmake.patch 2021-07-09 06:05:22 UTC (rev 419326) +++ clangd-CompletionModel-cmake.patch 2021-07-09 06:19:54 UTC (rev 419327) @@ -1,66 +0,0 @@ -From f51ab1871655a9a96134c2636c37dcb5a6b01ac3 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille <[email protected]> -Date: Mon, 22 Mar 2021 10:05:25 +0100 -Subject: [PATCH] Make clangd CompletionModel usable even with non-standard - (but supported) layout - -llvm supports specifying a non-standard layout where each project lies in its -own place. Do not assume a fixed layout and use the appropriate cmake variable -instead. - -Differential Revision: https://reviews.llvm.org/D96787 ---- - clang-tools-extra/clangd/quality/CompletionModel.cmake | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/clang-tools-extra/clangd/quality/CompletionModel.cmake b/clang-tools-extra/clangd/quality/CompletionModel.cmake -index 60c6d2aa8433..41bc2ed1890b 100644 ---- a/clang-tools-extra/clangd/quality/CompletionModel.cmake -+++ b/clang-tools-extra/clangd/quality/CompletionModel.cmake -@@ -5,8 +5,8 @@ - # will define a C++ class called ${cpp_class} - which may be a - # namespace-qualified class name. - function(gen_decision_forest model filename cpp_class) -- set(model_compiler ${CMAKE_SOURCE_DIR}/../clang-tools-extra/clangd/quality/CompletionModelCodegen.py) -- -+ set(model_compiler ${LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR}/clangd/quality/CompletionModelCodegen.py) -+ - set(output_dir ${CMAKE_CURRENT_BINARY_DIR}) - set(header_file ${output_dir}/${filename}.h) - set(cpp_file ${output_dir}/${filename}.cpp) - -From 7907c46fe6195728fafd843b8c0fb19a3e68e9ad Mon Sep 17 00:00:00 2001 -From: Harald van Dijk <[email protected]> -Date: Wed, 5 May 2021 19:25:34 +0100 -Subject: [PATCH] Make clangd CompletionModel not depend on directory layout. - -The current code accounts for two possible layouts, but there is at -least a third supported layout: clang-tools-extra may also be checked -out as clang/tools/extra with the releases, which was not yet handled. -Rather than treating that as a special case, use the location of -CompletionModel.cmake to handle all three cases. This should address the -problems that prompted D96787 and the problems that prompted the -proposed revert D100625. - -Reviewed By: usaxena95 - -Differential Revision: https://reviews.llvm.org/D101851 ---- - clang-tools-extra/clangd/quality/CompletionModel.cmake | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang-tools-extra/clangd/quality/CompletionModel.cmake b/clang-tools-extra/clangd/quality/CompletionModel.cmake -index 41bc2ed1890b..dc0c0cde4dab 100644 ---- a/clang-tools-extra/clangd/quality/CompletionModel.cmake -+++ b/clang-tools-extra/clangd/quality/CompletionModel.cmake -@@ -4,8 +4,9 @@ - # ${CMAKE_CURRENT_BINARY_DIR}. The generated header - # will define a C++ class called ${cpp_class} - which may be a - # namespace-qualified class name. -+set(CLANGD_COMPLETION_MODEL_COMPILER ${CMAKE_CURRENT_LIST_DIR}/CompletionModelCodegen.py) - function(gen_decision_forest model filename cpp_class) -- set(model_compiler ${LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR}/clangd/quality/CompletionModelCodegen.py) -+ set(model_compiler ${CLANGD_COMPLETION_MODEL_COMPILER}) - - set(output_dir ${CMAKE_CURRENT_BINARY_DIR}) - set(header_file ${output_dir}/${filename}.h) Deleted: opencl-respect-calling-convention-for-builtin.patch =================================================================== --- opencl-respect-calling-convention-for-builtin.patch 2021-07-09 06:05:22 UTC (rev 419326) +++ opencl-respect-calling-convention-for-builtin.patch 2021-07-09 06:19:54 UTC (rev 419327) @@ -1,107 +0,0 @@ -From e0fe1c58acfa0bde36afde8354cb31fc1e0b75e2 Mon Sep 17 00:00:00 2001 -From: Luke Drummond <[email protected]> -Date: Wed, 10 Mar 2021 18:14:42 +0000 -Subject: [PATCH] [OpenCL] Respect calling convention for builtin - -`__translate_sampler_initializer` has a calling convention of -`spir_func`, but clang generated calls to it using the default CC. - -Instruction Combining was lowering these mismatching calling conventions -to `store i1* undef` which itself was subsequently lowered to a trap -instruction by simplifyCFG resulting in runtime `SIGILL` - -There are arguably two bugs here: but whether there's any wisdom in -converting an obviously invalid call into a runtime crash over aborting -with a sensible error message will require further discussion. So for -now it's enough to set the right calling convention on the runtime -helper. - -Reviewed By: svenh, bader - -Differential Revision: https://reviews.llvm.org/D98411 - -(cherry picked from commit fcfd3fda71905d7c48f75a531c2265ad3b9876ea) ---- - clang/lib/CodeGen/CodeGenModule.cpp | 12 +++++++----- - clang/test/CodeGenOpenCL/sampler.cl | 12 ++++++------ - 2 files changed, 13 insertions(+), 11 deletions(-) - -diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp -index 31afbc6b4262..9c9bd4e374af 100644 ---- a/clang/lib/CodeGen/CodeGenModule.cpp -+++ b/clang/lib/CodeGen/CodeGenModule.cpp -@@ -6215,15 +6215,17 @@ llvm::SanitizerStatReport &CodeGenModule::getSanStats() { - - return *SanStats; - } -+ - llvm::Value * - CodeGenModule::createOpenCLIntToSamplerConversion(const Expr *E, - CodeGenFunction &CGF) { - llvm::Constant *C = ConstantEmitter(CGF).emitAbstract(E, E->getType()); -- auto SamplerT = getOpenCLRuntime().getSamplerType(E->getType().getTypePtr()); -- auto FTy = llvm::FunctionType::get(SamplerT, {C->getType()}, false); -- return CGF.Builder.CreateCall(CreateRuntimeFunction(FTy, -- "__translate_sampler_initializer"), -- {C}); -+ auto *SamplerT = getOpenCLRuntime().getSamplerType(E->getType().getTypePtr()); -+ auto *FTy = llvm::FunctionType::get(SamplerT, {C->getType()}, false); -+ auto *Call = CGF.Builder.CreateCall( -+ CreateRuntimeFunction(FTy, "__translate_sampler_initializer"), {C}); -+ Call->setCallingConv(Call->getCalledFunction()->getCallingConv()); -+ return Call; - } - - CharUnits CodeGenModule::getNaturalPointeeTypeAlignment( -diff --git a/clang/test/CodeGenOpenCL/sampler.cl b/clang/test/CodeGenOpenCL/sampler.cl -index e6bda49f51c8..5ad8d0dbbf37 100644 ---- a/clang/test/CodeGenOpenCL/sampler.cl -+++ b/clang/test/CodeGenOpenCL/sampler.cl -@@ -39,7 +39,7 @@ kernel void foo(sampler_t smp_par) { - // Case 2b - sampler_t smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_NEAREST; - // CHECK: [[smp_ptr:%[A-Za-z0-9_\.]+]] = alloca %opencl.sampler_t addrspace(2)* -- // CHECK: [[SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 19) -+ // CHECK: [[SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 19) - // CHECK: store %opencl.sampler_t addrspace(2)* [[SAMP]], %opencl.sampler_t addrspace(2)** [[smp_ptr]] - - // Case 1b -@@ -56,12 +56,12 @@ kernel void foo(sampler_t smp_par) { - - // Case 1a/2a - fnc4smp(glb_smp); -- // CHECK: [[SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) -+ // CHECK: [[SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) - // CHECK: call spir_func void [[FUNCNAME]](%opencl.sampler_t addrspace(2)* [[SAMP]]) - - // Case 1a/2c - fnc4smp(glb_smp_const); -- // CHECK: [[SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) -+ // CHECK: [[SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) - // CHECK: call spir_func void [[FUNCNAME]](%opencl.sampler_t addrspace(2)* [[SAMP]]) - - // Case 1c -@@ -70,12 +70,12 @@ kernel void foo(sampler_t smp_par) { - // CHECK: call spir_func void [[FUNCNAME]](%opencl.sampler_t addrspace(2)* [[SAMP]]) - - fnc4smp(5); -- // CHECK: [[SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 5) -+ // CHECK: [[SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 5) - // CHECK: call spir_func void [[FUNCNAME]](%opencl.sampler_t addrspace(2)* [[SAMP]]) - - const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR; - fnc4smp(const_smp); -- // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) -+ // CHECK: [[CONST_SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) - // CHECK: store %opencl.sampler_t addrspace(2)* [[CONST_SAMP]], %opencl.sampler_t addrspace(2)** [[CONST_SMP_PTR:%[a-zA-Z0-9]+]] - fnc4smp(const_smp); - // CHECK: [[SAMP:%[0-9]+]] = load %opencl.sampler_t addrspace(2)*, %opencl.sampler_t addrspace(2)** [[CONST_SMP_PTR]] -@@ -83,7 +83,7 @@ kernel void foo(sampler_t smp_par) { - - constant sampler_t constant_smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR; - fnc4smp(constant_smp); -- // CHECK: [[SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) -+ // CHECK: [[SAMP:%[0-9]+]] = call spir_func %opencl.sampler_t addrspace(2)* @__translate_sampler_initializer(i32 35) - // CHECK: call spir_func void [[FUNCNAME]](%opencl.sampler_t addrspace(2)* [[SAMP]]) - - // TODO: enable sampler initialization with non-constant integer. Deleted: partially-revert-scan-view-remove-Reporter.py.patch =================================================================== --- partially-revert-scan-view-remove-Reporter.py.patch 2021-07-09 06:05:22 UTC (rev 419326) +++ partially-revert-scan-view-remove-Reporter.py.patch 2021-07-09 06:19:54 UTC (rev 419327) @@ -1,225 +0,0 @@ -From 3263c81589eca689341ab5084723bdb7fe4a1286 Mon Sep 17 00:00:00 2001 -From: Tom Stellard <[email protected]> -Date: Thu, 11 Feb 2021 22:28:19 +0000 -Subject: [PATCH] Partially Revert "scan-view: Remove Reporter.py and - associated AppleScript files" - -This reverts some of commit dbb01536f6f49fa428f170e34466072ef439b3e9. - -The Reporter module was still being used by the ScanView.py module and deleting -it caused scan-view to fail. This commit adds back Reporter.py but removes the -code the references the AppleScript files which were removed in -dbb01536f6f49fa428f170e34466072ef439b3e9. - -Reviewed By: NoQ - -Differential Revision: https://reviews.llvm.org/D96367 - -(cherry picked from commit e3cd3a3c91524c957e06bb0170343548f02b6842) ---- - clang/tools/scan-view/CMakeLists.txt | 1 + - clang/tools/scan-view/share/Reporter.py | 183 ++++++++++++++++++++++++ - 2 files changed, 184 insertions(+) - create mode 100644 clang/tools/scan-view/share/Reporter.py - -diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt -index dd3d33439299..eccc6b83195b 100644 ---- a/clang/tools/scan-view/CMakeLists.txt -+++ b/clang/tools/scan-view/CMakeLists.txt -@@ -5,6 +5,7 @@ set(BinFiles - - set(ShareFiles - ScanView.py -+ Reporter.py - startfile.py - bugcatcher.ico) - -diff --git a/clang/tools/scan-view/share/Reporter.py b/clang/tools/scan-view/share/Reporter.py -new file mode 100644 -index 000000000000..31a14fb0cf74 ---- /dev/null -+++ b/clang/tools/scan-view/share/Reporter.py -@@ -0,0 +1,183 @@ -+#!/usr/bin/env python -+# -*- coding: utf-8 -*- -+ -+"""Methods for reporting bugs.""" -+ -+import subprocess, sys, os -+ -+__all__ = ['ReportFailure', 'BugReport', 'getReporters'] -+ -+# -+ -+class ReportFailure(Exception): -+ """Generic exception for failures in bug reporting.""" -+ def __init__(self, value): -+ self.value = value -+ -+# Collect information about a bug. -+ -+class BugReport(object): -+ def __init__(self, title, description, files): -+ self.title = title -+ self.description = description -+ self.files = files -+ -+# Reporter interfaces. -+ -+import os -+ -+import email, mimetypes, smtplib -+from email import encoders -+from email.message import Message -+from email.mime.base import MIMEBase -+from email.mime.multipart import MIMEMultipart -+from email.mime.text import MIMEText -+ -+#===------------------------------------------------------------------------===# -+# ReporterParameter -+#===------------------------------------------------------------------------===# -+ -+class ReporterParameter(object): -+ def __init__(self, n): -+ self.name = n -+ def getName(self): -+ return self.name -+ def getValue(self,r,bugtype,getConfigOption): -+ return getConfigOption(r.getName(),self.getName()) -+ def saveConfigValue(self): -+ return True -+ -+class TextParameter (ReporterParameter): -+ def getHTML(self,r,bugtype,getConfigOption): -+ return """\ -+<tr> -+<td class="form_clabel">%s:</td> -+<td class="form_value"><input type="text" name="%s_%s" value="%s"></td> -+</tr>"""%(self.getName(),r.getName(),self.getName(),self.getValue(r,bugtype,getConfigOption)) -+ -+class SelectionParameter (ReporterParameter): -+ def __init__(self, n, values): -+ ReporterParameter.__init__(self,n) -+ self.values = values -+ -+ def getHTML(self,r,bugtype,getConfigOption): -+ default = self.getValue(r,bugtype,getConfigOption) -+ return """\ -+<tr> -+<td class="form_clabel">%s:</td><td class="form_value"><select name="%s_%s"> -+%s -+</select></td>"""%(self.getName(),r.getName(),self.getName(),'\n'.join(["""\ -+<option value="%s"%s>%s</option>"""%(o[0], -+ o[0] == default and ' selected="selected"' or '', -+ o[1]) for o in self.values])) -+ -+#===------------------------------------------------------------------------===# -+# Reporters -+#===------------------------------------------------------------------------===# -+ -+class EmailReporter(object): -+ def getName(self): -+ return 'Email' -+ -+ def getParameters(self): -+ return [TextParameter(x) for x in ['To', 'From', 'SMTP Server', 'SMTP Port']] -+ -+ # Lifted from python email module examples. -+ def attachFile(self, outer, path): -+ # Guess the content type based on the file's extension. Encoding -+ # will be ignored, although we should check for simple things like -+ # gzip'd or compressed files. -+ ctype, encoding = mimetypes.guess_type(path) -+ if ctype is None or encoding is not None: -+ # No guess could be made, or the file is encoded (compressed), so -+ # use a generic bag-of-bits type. -+ ctype = 'application/octet-stream' -+ maintype, subtype = ctype.split('/', 1) -+ if maintype == 'text': -+ fp = open(path) -+ # Note: we should handle calculating the charset -+ msg = MIMEText(fp.read(), _subtype=subtype) -+ fp.close() -+ else: -+ fp = open(path, 'rb') -+ msg = MIMEBase(maintype, subtype) -+ msg.set_payload(fp.read()) -+ fp.close() -+ # Encode the payload using Base64 -+ encoders.encode_base64(msg) -+ # Set the filename parameter -+ msg.add_header('Content-Disposition', 'attachment', filename=os.path.basename(path)) -+ outer.attach(msg) -+ -+ def fileReport(self, report, parameters): -+ mainMsg = """\ -+BUG REPORT -+--- -+Title: %s -+Description: %s -+"""%(report.title, report.description) -+ -+ if not parameters.get('To'): -+ raise ReportFailure('No "To" address specified.') -+ if not parameters.get('From'): -+ raise ReportFailure('No "From" address specified.') -+ -+ msg = MIMEMultipart() -+ msg['Subject'] = 'BUG REPORT: %s'%(report.title) -+ # FIXME: Get config parameters -+ msg['To'] = parameters.get('To') -+ msg['From'] = parameters.get('From') -+ msg.preamble = mainMsg -+ -+ msg.attach(MIMEText(mainMsg, _subtype='text/plain')) -+ for file in report.files: -+ self.attachFile(msg, file) -+ -+ try: -+ s = smtplib.SMTP(host=parameters.get('SMTP Server'), -+ port=parameters.get('SMTP Port')) -+ s.sendmail(msg['From'], msg['To'], msg.as_string()) -+ s.close() -+ except: -+ raise ReportFailure('Unable to send message via SMTP.') -+ -+ return "Message sent!" -+ -+class BugzillaReporter(object): -+ def getName(self): -+ return 'Bugzilla' -+ -+ def getParameters(self): -+ return [TextParameter(x) for x in ['URL','Product']] -+ -+ def fileReport(self, report, parameters): -+ raise NotImplementedError -+ -+ -+class RadarClassificationParameter(SelectionParameter): -+ def __init__(self): -+ SelectionParameter.__init__(self,"Classification", -+ [['1', 'Security'], ['2', 'Crash/Hang/Data Loss'], -+ ['3', 'Performance'], ['4', 'UI/Usability'], -+ ['6', 'Serious Bug'], ['7', 'Other']]) -+ -+ def saveConfigValue(self): -+ return False -+ -+ def getValue(self,r,bugtype,getConfigOption): -+ if bugtype.find("leak") != -1: -+ return '3' -+ elif bugtype.find("dereference") != -1: -+ return '2' -+ elif bugtype.find("missing ivar release") != -1: -+ return '3' -+ else: -+ return '7' -+ -+### -+ -+def getReporters(): -+ reporters = [] -+ reporters.append(EmailReporter()) -+ return reporters -+
