11.0.0-rc1 Release

This commit is contained in:
Tom Stellard 2020-02-27 01:47:44 +00:00
parent 8c8d9c672c
commit 46e006a53e
6 changed files with 28 additions and 235 deletions

4
.gitignore vendored
View File

@ -99,3 +99,7 @@
/clang-tools-extra-10.0.0.src.tar.xz.sig
/clang-tools-extra-10.0.0.src.tar.xz
/clang-10.0.0.src.tar.xz
/clang-11.0.0rc1.src.tar.xz
/clang-tools-extra-11.0.0rc1.src.tar.xz
/clang-tools-extra-11.0.0rc1.src.tar.xz.sig
/clang-11.0.0rc1.src.tar.xz.sig

View File

@ -1,146 +0,0 @@
From bcc0c894f38fd8b43af521e356a167b1a12dd497 Mon Sep 17 00:00:00 2001
From: Xiang1 Zhang <xiang1.zhang@intel.com>
Date: Tue, 19 May 2020 13:29:30 +0800
Subject: [PATCH] Add cet.h for writing CET-enabled assembly code
Summary:
Add x86 feature with IBT and/or SHSTK bits to ELF program property if they are enabled. Otherwise, contents in this header file are unused.
This file is mainly design for assembly source code which want to enable CET
Reviewers: hjl.tools, annita.zhang, LuoYuanke, craig.topper, tstellar, pengfei, rsmith
Reviewed By: LuoYuanke
Subscribers: cfe-commits, mgorny
Tags: #clang
Differential Revision: https://reviews.llvm.org/D79617
---
clang/lib/Headers/CMakeLists.txt | 1 +
clang/lib/Headers/cet.h | 66 ++++++++++++++++++++++++++++++++++++++++
clang/test/CodeGen/asm-cet.S | 27 ++++++++++++++++
3 files changed, 94 insertions(+)
create mode 100644 clang/lib/Headers/cet.h
create mode 100644 clang/test/CodeGen/asm-cet.S
diff --git a/clang/lib/Headers/CMakeLists.txt b/clang/lib/Headers/CMakeLists.txt
index 60d359f..c5215ee 100644
--- a/clang/lib/Headers/CMakeLists.txt
+++ b/clang/lib/Headers/CMakeLists.txt
@@ -46,6 +46,7 @@ set(files
__clang_cuda_math_forward_declares.h
__clang_cuda_runtime_wrapper.h
cetintrin.h
+ cet.h
cldemoteintrin.h
clzerointrin.h
cpuid.h
diff --git a/clang/lib/Headers/cet.h b/clang/lib/Headers/cet.h
new file mode 100644
index 0000000..ffb19de
--- /dev/null
+++ b/clang/lib/Headers/cet.h
@@ -0,0 +1,66 @@
+/*===------ cet.h -Control-flow Enforcement Technology feature ------------===
+ * Add x86 feature with IBT and/or SHSTK bits to ELF program property if they
+ * are enabled. Otherwise, contents in this header file are unused. This file
+ * is mainly design for assembly source code which want to enable CET.
+ *
+ * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+ * See https://llvm.org/LICENSE.txt for license information.
+ * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+ *
+ *===-----------------------------------------------------------------------===
+ */
+#ifndef __CET_H
+#define __CET_H
+
+#ifdef __ASSEMBLER__
+
+#ifndef __CET__
+# define _CET_ENDBR
+#endif
+
+#ifdef __CET__
+
+# ifdef __LP64__
+# if __CET__ & 0x1
+# define _CET_ENDBR endbr64
+# else
+# define _CET_ENDBR
+# endif
+# else
+# if __CET__ & 0x1
+# define _CET_ENDBR endbr32
+# else
+# define _CET_ENDBR
+# endif
+# endif
+
+
+# ifdef __LP64__
+# define __PROPERTY_ALIGN 3
+# else
+# define __PROPERTY_ALIGN 2
+# endif
+
+ .pushsection ".note.gnu.property", "a"
+ .p2align __PROPERTY_ALIGN
+ .long 1f - 0f /* name length. */
+ .long 4f - 1f /* data length. */
+ /* NT_GNU_PROPERTY_TYPE_0. */
+ .long 5 /* note type. */
+0:
+ .asciz "GNU" /* vendor name. */
+1:
+ .p2align __PROPERTY_ALIGN
+ /* GNU_PROPERTY_X86_FEATURE_1_AND. */
+ .long 0xc0000002 /* pr_type. */
+ .long 3f - 2f /* pr_datasz. */
+2:
+ /* GNU_PROPERTY_X86_FEATURE_1_XXX. */
+ .long __CET__
+3:
+ .p2align __PROPERTY_ALIGN
+4:
+ .popsection
+#endif
+#endif
+#endif
diff --git a/clang/test/CodeGen/asm-cet.S b/clang/test/CodeGen/asm-cet.S
new file mode 100644
index 0000000..3644ed7
--- /dev/null
+++ b/clang/test/CodeGen/asm-cet.S
@@ -0,0 +1,27 @@
+// REQUIRES: x86-registered-target
+// RUN: %clang --target=x86_64-pc-linux -fcf-protection -include cet.h -c %s -o - | llvm-readelf -n | FileCheck %s
+// RUN: %clang --target=x86_64-pc-linux -include cet.h -c %s -o - | llvm-readelf -S | FileCheck %s --check-prefixes=NOCET
+// RUN: %clang --target=x86_64-pc-linux -include cet.h -S %s -o - | FileCheck %s --check-prefixes=NOENDBR
+// RUN: %clang --target=x86_64-pc-linux -fcf-protection -include cet.h -S %s -o - | FileCheck %s --check-prefixes=ENDBR64
+
+// RUN: %clang --target=i386-pc-linux -fcf-protection -include cet.h -c %s -o - | llvm-readelf -n | FileCheck %s
+// RUN: %clang --target=i386-pc-linux -include cet.h -c %s -o - | llvm-readelf -S | FileCheck %s --check-prefixes=NOCET
+// RUN: %clang --target=i386-pc-linux -include cet.h -S %s -o - | FileCheck %s --check-prefixes=NOENDBR
+// RUN: %clang --target=i386-pc-linux -fcf-protection -include cet.h -S %s -o - | FileCheck %s --check-prefixes=ENDBR32
+
+// CHECK: IBT, SHSTK
+
+// NOCET: Section Headers
+// NOCET-NOT: .note.gnu.property
+
+// NOENDBR: foo
+// NOENDBR-NOT: endbr
+
+// ENDBR64: endbr64
+// ENDBR32: endbr32
+ .text
+ .globl foo
+ .type foo, @function
+foo:
+ _CET_ENDBR
+ ret
--
1.8.3.1

View File

@ -1,64 +0,0 @@
From d970ab63e22eb5918774953da6b99ac27e5832a0 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Tue, 16 Jun 2020 11:20:20 -0700
Subject: [PATCH] Driver: Accept multiple --config options if filenames are the
same
Summary:
We're trying to use the --config options to pass distro specific
options for Fedora via the CFLAGS variable. However, some projects
end up using the CFLAGS variable multiple times in their command line,
which leads to an error when --config is used.
This patch resolves this issue by allowing more than one --config option
on the command line as long as the file names are the same.
Reviewers: sepavloff, hfinkel
Reviewed By: sepavloff
Subscribers: cfe-commits, llvm-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D81424
---
clang/lib/Driver/Driver.cpp | 8 ++++++--
clang/test/Driver/config-file.c | 5 +++++
2 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 3add665..a8442d2 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -833,8 +833,12 @@ bool Driver::loadConfigFile() {
std::vector<std::string> ConfigFiles =
CLOptions->getAllArgValues(options::OPT_config);
if (ConfigFiles.size() > 1) {
- Diag(diag::err_drv_duplicate_config);
- return true;
+ if (!std::all_of(
+ ConfigFiles.begin(), ConfigFiles.end(),
+ [ConfigFiles](std::string s) { return s == ConfigFiles[0]; })) {
+ Diag(diag::err_drv_duplicate_config);
+ return true;
+ }
}
if (!ConfigFiles.empty()) {
diff --git a/clang/test/Driver/config-file.c b/clang/test/Driver/config-file.c
index 04127d4..fde7260 100644
--- a/clang/test/Driver/config-file.c
+++ b/clang/test/Driver/config-file.c
@@ -71,3 +71,8 @@
// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
// CHECK-PRECEDENCE: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
// CHECK-PRECEDENCE: -Wall
+
+
+//--- Duplicate --config options are allowed if the value is the same
+// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 --config config-4 -S %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-SAME-CONFIG
+// CHECK-SAME-CONFIG: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
--
1.8.3.1

View File

@ -1,4 +1,4 @@
From 856b789b9de0895786ba23681c4337172676e01e Mon Sep 17 00:00:00 2001
From 8097a9d4295dbc39cbd541ccace7bc5884852366 Mon Sep 17 00:00:00 2001
From: Tom Stellard <tstellar@redhat.com>
Date: Fri, 31 Jan 2020 11:04:57 -0800
Subject: [PATCH] clang: Don't install static libraries
@ -8,18 +8,18 @@ Subject: [PATCH] clang: Don't install static libraries
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/clang/cmake/modules/AddClang.cmake b/clang/cmake/modules/AddClang.cmake
index cbd618e..9cf076a 100644
index 704278a0e93..1737b24a2bc 100644
--- a/clang/cmake/modules/AddClang.cmake
+++ b/clang/cmake/modules/AddClang.cmake
@@ -97,7 +97,7 @@ macro(add_clang_library name)
if(TARGET ${name})
target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
@@ -111,7 +111,7 @@ macro(add_clang_library name)
if(TARGET ${lib})
target_link_libraries(${lib} INTERFACE ${LLVM_COMMON_LIBS})
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
+ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN))
set(export_to_clangtargets)
if(${name} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
"clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
- if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN)
+ if (ARG_SHARED AND (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ARG_INSTALL_WITH_TOOLCHAIN))
set(export_to_clangtargets)
if(${lib} IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
"clang-libraries" IN_LIST LLVM_DISTRIBUTION_COMPONENTS OR
--
1.8.3.1
2.18.1

View File

@ -1,10 +1,10 @@
%global compat_build 0
%global maj_ver 10
%global maj_ver 11
%global min_ver 0
%global patch_ver 0
#%%global rc_ver 6
%global baserelease 11
%global rc_ver 1
%global baserelease 0.1
%global clang_tools_binaries \
%{_bindir}/clang-apply-replacements \
@ -13,7 +13,6 @@
%{_bindir}/clang-doc \
%{_bindir}/clang-extdef-mapping \
%{_bindir}/clang-format \
%{_bindir}/clang-import-test \
%{_bindir}/clang-include-fixer \
%{_bindir}/clang-move \
%{_bindir}/clang-offload-bundler \
@ -98,12 +97,9 @@ Source4: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc
Patch4: 0002-gtest-reorg.patch
Patch11: 0001-ToolChain-Add-lgcc_s-to-the-linker-flags-when-using-.patch
Patch13: 0001-Make-funwind-tables-the-default-for-all-archs.patch
Patch14: 0001-clang-fix-undefined-behaviour-in-RawComment-getForma.patch
# Not Upstream
Patch15: 0001-clang-Don-t-install-static-libraries.patch
Patch16: 0001-Driver-Accept-multiple-config-options-if-filenames-a.patch
Patch17: 0001-Add-cet.h-for-writing-CET-enabled-assembly-code.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -257,10 +253,7 @@ pathfix.py -i %{__python3} -pn \
%patch4 -p1 -b .gtest
%patch11 -p1 -b .libcxx-fix
%patch13 -p2 -b .unwind-all
%patch14 -p2 -b .clangd
%patch15 -p2 -b .no-install-static
%patch16 -p2 -b .config-multiple
%patch17 -p2 -b .cet.h
mv ../%{clang_tools_srcdir} tools/extra
@ -408,6 +401,9 @@ popd
%endif
# Remove clang-tidy headers. We don't ship the libraries for these.
rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
%check
%if !0%{?compat_build}
# requires lit.py from LLVM utilities
@ -491,6 +487,9 @@ LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %cmake_build --target check-all || \
%endif
%changelog
* Mon Aug 10 2020 Tom Stellard <tstellar@redhat.com> - 11.0.0-0.1.rc1
- 11.0.0-rc1 Release
* Tue Aug 04 2020 Tom Stellard <tstellar@redhat.com> - 10.0.0-11
- Remove Requires: emacs-filesystem

View File

@ -1,4 +1,4 @@
SHA512 (clang-10.0.0.src.tar.xz.sig) = cb46d9c616de9ba6e11602269f93a003fc24951b75844d2d62ad7c435bd9ace0357bf396141b9a3e97034f617ad8f301a1a5556a3feb94b17647f8b76c0b6236
SHA512 (clang-tools-extra-10.0.0.src.tar.xz.sig) = f0527b315ce9f2c86a19dabd462d0d466ac0843262f06d5f2b69333f77457ec9cb99f8ce9fdaa00048dfaec3de5613fb884c4259acd4a75463ba3c6714e35423
SHA512 (clang-tools-extra-10.0.0.src.tar.xz) = 33b6019e64e9ac94bd7c000b77a4a927602a2705baa9b370e392a56b53fe09c8dad1ff7d583892729e9eb291440433ad7d71df768a96d927e4dbc1988fc01d99
SHA512 (clang-10.0.0.src.tar.xz) = b1cccc13c46abcda3d689f51d486fa613ecec40c581c72d8b15951715100a2b8fb24370161601e6716cdba5a784337439e99ec2f0766f988e9cce92de6d775da
SHA512 (clang-11.0.0rc1.src.tar.xz) = b526c2a9cd53a928d8c01965a37557999653e7c3af26f97f53dd46f9f1133250ae83bfb84148d5e8cfae9ff728973669f5cca2e1e7cde7a758f577e6e8a214ae
SHA512 (clang-tools-extra-11.0.0rc1.src.tar.xz) = d1edb7ef676fc261ef7fdeab0cd4ae009b575cab416e9b9947705a7e3640c45de73bfc9d87f833770c3f5aca3000f31459fb9bb043aeae6177bf67d104dc4236
SHA512 (clang-tools-extra-11.0.0rc1.src.tar.xz.sig) = 5d884da912f2d3e0b67231d9d08438d430593da1d46f9f878f3cfe710dddb41ae89bb823a05240851de1e6634d219631818a205c85fab76a3373810e2613c758
SHA512 (clang-11.0.0rc1.src.tar.xz.sig) = 68ec822dcba32891aa9166dc70fec8c005b8c704730c23ae3af56edf6094df1d2933e0e96bcbf5c66e0ac1d50e70fb5b2f2cdc1991b73adab581b581815727e6