diff --git a/0001-GCC-compatibility-Ignore-fstack-clash-protection.patch b/0001-GCC-compatibility-Ignore-fstack-clash-protection.patch deleted file mode 100644 index 5683b7106c4f95af2a72249e17372537212d4084..0000000000000000000000000000000000000000 --- a/0001-GCC-compatibility-Ignore-fstack-clash-protection.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 428ca4520a79ec5a6df9c6adc8b8069623868cdb Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Fri, 26 Jan 2018 11:38:04 -0800 -Subject: [PATCH] GCC compatibility: Ignore -fstack-clash-protection - -Reviewers: sylvestre.ledru - -Subscribers: cfe-commits - -Differential Revision: https://reviews.llvm.org/D42593 ---- - include/clang/Driver/Options.td | 1 + - test/Driver/clang_f_opts.c | 1 + - 2 files changed, 2 insertions(+) - -diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td -index 41f31cf..e9078a2 100644 ---- a/include/clang/Driver/Options.td -+++ b/include/clang/Driver/Options.td -@@ -2705,6 +2705,7 @@ defm single_precision_constant : BooleanFFlag<"single-precision-constant">, - Group; - defm spec_constr_count : BooleanFFlag<"spec-constr-count">, Group; - defm stack_check : BooleanFFlag<"stack-check">, Group; -+defm stack_clash_protection : BooleanFFlag<"stack-clash-protection">, Group; - defm strength_reduce : - BooleanFFlag<"strength-reduce">, Group; - defm tls_model : BooleanFFlag<"tls-model">, Group; -diff --git a/test/Driver/clang_f_opts.c b/test/Driver/clang_f_opts.c -index 5755c5d..8710ff4 100644 ---- a/test/Driver/clang_f_opts.c -+++ b/test/Driver/clang_f_opts.c -@@ -284,6 +284,7 @@ - // RUN: -ffriend-injection \ - // RUN: -fno-implement-inlines -fimplement-inlines \ - // RUN: -fstack-check \ -+// RUN: -fstack-clash-protection \ - // RUN: -fforce-addr \ - // RUN: -malign-functions=100 \ - // RUN: -malign-loops=100 \ --- -1.8.3.1 - diff --git a/0001-gtest-reorg.patch b/0001-gtest-reorg.patch deleted file mode 100644 index 4d8693a64d72438216e96421f8b035e7bebb660c..0000000000000000000000000000000000000000 --- a/0001-gtest-reorg.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 3b2afecc227d652f84f883d4018d43971de6a311 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Wed, 21 Mar 2018 07:17:00 -0700 -Subject: [PATCH] gtest reorg - ---- - CMakeLists.txt | 12 +++++------- - 1 file changed, 5 insertions(+), 7 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2eee8e6..01d290f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -142,12 +142,6 @@ Please install Python or specify the PYTHON_EXECUTABLE CMake variable.") - set(LLVM_UTILS_PROVIDED ON) - set(CLANG_TEST_DEPS FileCheck count not) - endif() -- set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -- if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -- AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -- AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -- add_subdirectory(${UNITTEST_DIR} utils/unittest) -- endif() - else() - # Seek installed Lit. - find_program(LLVM_LIT -@@ -477,7 +471,11 @@ endif() - - - if( CLANG_INCLUDE_TESTS ) -- if(EXISTS ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest/include/gtest/gtest.h) -+ set(UNITTEST_DIR ${LLVM_MAIN_SRC_DIR}/utils/unittest) -+ if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h -+ AND NOT EXISTS ${LLVM_LIBRARY_DIR}/${CMAKE_STATIC_LIBRARY_PREFIX}gtest${CMAKE_STATIC_LIBRARY_SUFFIX} -+ AND EXISTS ${UNITTEST_DIR}/CMakeLists.txt) -+ add_subdirectory(${UNITTEST_DIR} utils/unittest) - add_subdirectory(unittests) - list(APPEND CLANG_TEST_DEPS ClangUnitTests) - list(APPEND CLANG_TEST_PARAMS --- -1.8.3.1 - diff --git a/0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch b/0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch deleted file mode 100644 index 4664fdc63e7d8d8676c0b5607224cdd28ebd7242..0000000000000000000000000000000000000000 --- a/0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 06cde370a44393d65bae7f61279900b5838b4a2c Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Tue, 23 Jan 2018 18:59:20 -0800 -Subject: [PATCH] lit.cfg: Add hack so lit can find not and FileCheck - ---- - test/lit.cfg.py | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/test/lit.cfg.py b/test/lit.cfg.py -index 5323cfe..5b4184e 100644 ---- a/test/lit.cfg.py -+++ b/test/lit.cfg.py -@@ -39,7 +39,10 @@ config.test_source_root = os.path.dirname(__file__) - # test_exec_root: The root path where tests should be run. - config.test_exec_root = os.path.join(config.clang_obj_root, 'test') - -+old_llvm_tools_dir = llvm_config.config.llvm_tools_dir -+llvm_config.config.llvm_tools_dir = '/usr/lib64/llvm' - llvm_config.use_default_substitutions() -+llvm_config.config.llvm_tools_dir = old_llvm_tools_dir - - llvm_config.use_clang() - --- -1.8.3.1 - diff --git a/clang-10.0.1.src.tar.xz b/clang-12.0.1.src.tar.xz similarity index 60% rename from clang-10.0.1.src.tar.xz rename to clang-12.0.1.src.tar.xz index 81b5af1b269cd42dbd6b7834e801b2984dffa4ea..6eaa7e3aca193f2dd2d8afcb6ffc6282aacfc7c6 100644 Binary files a/clang-10.0.1.src.tar.xz and b/clang-12.0.1.src.tar.xz differ diff --git a/clang-tools-extra-10.0.1.src.tar.xz b/clang-tools-extra-10.0.1.src.tar.xz deleted file mode 100644 index 7dda61c42e50be509efab212b3152c74c26d8319..0000000000000000000000000000000000000000 Binary files a/clang-tools-extra-10.0.1.src.tar.xz and /dev/null differ diff --git a/clang-tools-extra-12.0.1.src.tar.xz b/clang-tools-extra-12.0.1.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..4fe27ad89b32eec9a0bf3a5abb90826388047e9b Binary files /dev/null and b/clang-tools-extra-12.0.1.src.tar.xz differ diff --git a/clang.spec b/clang.spec index 8989e2f76e30fb11f3a97783202167db3eac3cdc..89a4cdee9ee8e3d51adbfec1133f0698781e4f6a 100644 --- a/clang.spec +++ b/clang.spec @@ -1,12 +1,12 @@ -%global maj_ver 10 +%global maj_ver 12 %global min_ver 0 %global patch_ver 1 %global clang_srcdir clang-%{version}.src %global clang_tools_srcdir clang-tools-extra-%{version}.src Name: clang -Version: 10.0.1 -Release: 6 +Version: 12.0.1 +Release: 1 License: GPL-2.0-only and Apache-2.0 and MIT Summary: An "LLVM native" C/C++/Objective-C compiler URL: http://llvm.org @@ -14,24 +14,24 @@ Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{versio Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_tools_srcdir}.tar.xz Source2: clang-config.h -Patch0000: 0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch -Patch0001: 0001-GCC-compatibility-Ignore-fstack-clash-protection.patch -Patch0002: 0001-gtest-reorg.patch - -BuildRequires: cmake gcc-c++ python-sphinx +BuildRequires: cmake gcc-c++ python-sphinx git BuildRequires: llvm-devel = %{version} -BuildRequires: compiler-rt = %{version} BuildRequires: llvm-static = %{version} BuildRequires: llvm-googletest = %{version} BuildRequires: libxml2-devel perl-generators ncurses-devel emacs libatomic -BuildRequires: python3-lit python3-sphinx python3-devel chrpath +BuildRequires: python3-lit python3-sphinx python3-devel Requires: libstdc++-devel gcc-c++ emacs-filesystem +Requires: %{name}-resource-filesystem = %{version} Provides: clang(major) = %{maj_ver} Provides: %{name}-libs = %{version}-%{release} Obsoletes: %{name}-libs < %{version}-%{release} Recommends: libomp = %{version} +Recommends: compiler-rt = %{version} + +Conflicts: compiler-rt < %{version} +Conflicts: compiler-rt > %{version} %description The Clang project provides a language front-end and tooling infrastructure for\ @@ -47,6 +47,13 @@ Requires: %{name}-tools-extra = %{version}-%{release} %description devel Development header files for clang. +%package resource-filesystem +Summary: Filesystem package that owns the clang resource directory +Provides: %{name}-resource-filesystem(major) = %{maj_ver} + +%description resource-filesystem +This package owns the clang resouce directory: $libdir/clang/$version/ + %package help Summary: Help manual for %{name} @@ -87,7 +94,7 @@ clang-format integration for git. pathfix.py -i %{__python3} -pn \ clang-tidy/tool/*.py -%autosetup -n %{clang_srcdir} -p1 +%autosetup -n %{clang_srcdir} -p1 -Sgit pathfix.py -i %{__python3} -pn \ tools/clang-format/*.py \ tools/clang-format/git-clang-format \ @@ -107,6 +114,7 @@ cd _build %cmake .. \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INSTALL_RPATH:BOOL=";" \ -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DLLVM_CONFIG:FILEPATH=/usr/bin/llvm-config-%{__isa_bits} \ @@ -154,18 +162,14 @@ rm -Rvf %{buildroot}%{_pkgdocdir} rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh -ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} +# Create sub-directories in the clang resource directory that will be +# populated by other packages +mkdir -p %{buildroot}%{_libdir}/clang/%{version}/{include,lib,share}/ +# Remove clang-tidy headers. +rm -Rvf %{buildroot}%{_includedir}/clang-tidy/ -cd $RPM_BUILD_ROOT/usr -file `find -type f`| grep -w ELF | awk -F":" '{print $1}' | for i in `xargs` -do - chrpath -d $i -done -cd - -mkdir -p $RPM_BUILD_ROOT/etc/ld.so.conf.d -echo "%{_bindir}/%{name}-%{maj_ver}" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf -echo "%{_libdir}/%{name}-%{maj_ver}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf +ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} %check # Checking is disabled because we don't pack libLLVMTestingSupport.a, which makes @@ -200,7 +204,6 @@ echo "%{_libdir}/%{name}-%{maj_ver}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name} %{_bindir}/clang-offload-wrapper %{_bindir}/clang-scan-deps %{_bindir}/pp-trace -%{_bindir}/clang-import-test %{_bindir}/clang-offload-bundler %{_bindir}/diagtool %{_bindir}/hmaptool @@ -210,7 +213,6 @@ echo "%{_libdir}/%{name}-%{maj_ver}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name} %{_datadir}/clang/clang-format-diff.py* %{_libdir}/clang/ %{_libdir}/*.so.* -%config(noreplace) /etc/ld.so.conf.d/* %files devel %{_libdir}/*.so @@ -219,6 +221,12 @@ echo "%{_libdir}/%{name}-%{maj_ver}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name} %{_libdir}/cmake/* %dir %{_datadir}/clang/ +%files resource-filesystem +%dir %{_libdir}/clang/%{version}/ +%dir %{_libdir}/clang/%{version}/include/ +%dir %{_libdir}/clang/%{version}/lib/ +%dir %{_libdir}/clang/%{version}/share/ + %files help %{_mandir}/man1/clang.1.gz %{_mandir}/man1/diagtool.1.gz @@ -258,11 +266,12 @@ echo "%{_libdir}/%{name}-%{maj_ver}" >> $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name} %{_bindir}/git-clang-format %changelog -* Thu Sep 16 2021 chenchen - 10.0.1-6 -- del rpath from some binaries and bin +* Wed Dec 29 2021 panxiaohe - 12.0.1-1 +- update to 12.0.1 +- add clang-resource-filesystem sub-package -* Mon Aug 02 2021 chenyanpanHW - 10.0.1-5 -- DESC: delete -Sgit from %autosetup, and delete BuildRequires git +* Tue Sep 07 2021 chenchen - 10.0.1-5 +- del rpath from some binaries and bin * Fri Apr 30 2021 licihua - 10.0.1-4 - Reduce build time.