diff --git a/.clang.metadata b/.clang.metadata index 85df618..33bc102 100644 --- a/.clang.metadata +++ b/.clang.metadata @@ -1,2 +1,3 @@ -6977cf7a802a053c57fa74138d3648b563e71e88 SOURCES/cfe-9.0.0.src.tar.xz -ac64403321d8486699d8bea5376b2438663dbb41 SOURCES/clang-tools-extra-9.0.0.src.tar.xz +cfaa4c4e89a45b604e6f3057f984d73365074727 SOURCES/clang-10.0.0.src.tar.xz +e41467d4e8c6afe917c9f9c44b1d6a95a85adadb SOURCES/clang-tools-extra-10.0.0.src.tar.xz +32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc diff --git a/.gitignore b/.gitignore index 506fa61..8c8f23b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/cfe-9.0.0.src.tar.xz -SOURCES/clang-tools-extra-9.0.0.src.tar.xz +SOURCES/clang-10.0.0.src.tar.xz +SOURCES/clang-tools-extra-10.0.0.src.tar.xz +SOURCES/hans-gpg-key.asc diff --git a/SOURCES/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch b/SOURCES/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch deleted file mode 100644 index c7c6d7f..0000000 --- a/SOURCES/0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 20ffd5bc4e45980dc804c5fa422e5182cbc975b7 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Tue, 13 Aug 2019 13:38:40 -0700 -Subject: [PATCH] Fix Driver/modules.cpp test to work when build directory name - contains '.s' - ---- - clang/test/Driver/modules.cpp | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/clang/test/Driver/modules.cpp b/clang/test/Driver/modules.cpp -index 7c549c1..9e06151 100644 ---- a/clang/test/Driver/modules.cpp -+++ b/clang/test/Driver/modules.cpp -@@ -15,7 +15,8 @@ - // RUN: %clang -std=c++2a %t/module.pcm -S -o %t/module.pcm.o -v 2>&1 | FileCheck %s --check-prefix=CHECK-COMPILE - // - // CHECK-COMPILE: -cc1 {{.*}} {{-emit-obj|-S}} --// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}} -+// Check for extra space to avoid failures when the build directory contains '.s' in its path. -+// CHECK-COMPILE-SAME: -o {{.*}}.{{pcm.o|s}}{{ }} - // CHECK-COMPILE-SAME: -x pcm - // CHECK-COMPILE-SAME: {{.*}}.pcm - --- -1.8.3.1 - diff --git a/SOURCES/0001-Fix-uninitialized-value-in-ABIArgInfo.patch b/SOURCES/0001-Fix-uninitialized-value-in-ABIArgInfo.patch deleted file mode 100644 index 6291203..0000000 --- a/SOURCES/0001-Fix-uninitialized-value-in-ABIArgInfo.patch +++ /dev/null @@ -1,37 +0,0 @@ -From bae24f2020f7dc9db372c7e3f38d77fc5fa320d0 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Fri, 1 Feb 2019 06:39:13 +0000 -Subject: [PATCH] Fix uninitialized value in ABIArgInfo - -GCC-9 takes advantage of this uninitialized values to optimize stuff, -which ends up in failing validation when compiling clang. ---- - clang/include/clang/CodeGen/CGFunctionInfo.h | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/clang/include/clang/CodeGen/CGFunctionInfo.h b/clang/include/clang/CodeGen/CGFunctionInfo.h -index 1f81072..caf7105 100644 ---- a/clang/include/clang/CodeGen/CGFunctionInfo.h -+++ b/clang/include/clang/CodeGen/CGFunctionInfo.h -@@ -110,13 +110,13 @@ private: - } - - ABIArgInfo(Kind K) -- : TheKind(K), PaddingInReg(false), InReg(false) { -- } -+ : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), -+ TheKind(K), PaddingInReg(false), InAllocaSRet(false), IndirectByVal(false), -+ IndirectRealign(false), SRetAfterThis(false), InReg(false), -+ CanBeFlattened(false), SignExt(false) {} - - public: -- ABIArgInfo() -- : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), -- TheKind(Direct), PaddingInReg(false), InReg(false) {} -+ ABIArgInfo() : ABIArgInfo(Direct) {} - - static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, - llvm::Type *Padding = nullptr, --- -1.8.3.1 - diff --git a/SOURCES/0001-Make-funwind-tables-the-default-for-all-archs.patch b/SOURCES/0001-Make-funwind-tables-the-default-for-all-archs.patch new file mode 100644 index 0000000..d9e9125 --- /dev/null +++ b/SOURCES/0001-Make-funwind-tables-the-default-for-all-archs.patch @@ -0,0 +1,39 @@ +From 690373af5a5d50cf115ed6e4d2849bb786f9dc8e Mon Sep 17 00:00:00 2001 +From: serge-sans-paille +Date: Tue, 10 Dec 2019 09:18:03 +0000 +Subject: [PATCH] Make -funwind-tables the default for all archs + +--- + clang/lib/Driver/ToolChain.cpp | 2 +- + clang/lib/Driver/ToolChains/Gnu.cpp | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/clang/lib/Driver/ToolChain.cpp b/clang/lib/Driver/ToolChain.cpp +index b1fddb0af55..43af40ed0e8 100644 +--- a/clang/lib/Driver/ToolChain.cpp ++++ b/clang/lib/Driver/ToolChain.cpp +@@ -244,7 +244,7 @@ std::string ToolChain::getInputFilename(const InputInfo &Input) const { + } + + bool ToolChain::IsUnwindTablesDefault(const ArgList &Args) const { +- return false; ++ return true; + } + + Tool *ToolChain::getClang() const { +diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp +index 33cdd3585c2..15e82be8f3a 100644 +--- a/clang/lib/Driver/ToolChains/Gnu.cpp ++++ b/clang/lib/Driver/ToolChains/Gnu.cpp +@@ -2535,7 +2535,7 @@ void Generic_GCC::printVerboseInfo(raw_ostream &OS) const { + } + + bool Generic_GCC::IsUnwindTablesDefault(const ArgList &Args) const { +- return getArch() == llvm::Triple::x86_64; ++ return true; + } + + bool Generic_GCC::isPICDefault() const { +-- +2.20.1 + diff --git a/SOURCES/0001-clang-Don-t-install-static-libraries.patch b/SOURCES/0001-clang-Don-t-install-static-libraries.patch new file mode 100644 index 0000000..4bf7d35 --- /dev/null +++ b/SOURCES/0001-clang-Don-t-install-static-libraries.patch @@ -0,0 +1,25 @@ +From 856b789b9de0895786ba23681c4337172676e01e Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 31 Jan 2020 11:04:57 -0800 +Subject: [PATCH] clang: Don't install static libraries + +--- + clang/cmake/modules/AddClang.cmake | 2 +- + 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 +--- 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}) + +- 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 +-- +1.8.3.1 + diff --git a/SOURCES/clang-10.0.0.src.tar.xz.sig b/SOURCES/clang-10.0.0.src.tar.xz.sig new file mode 100644 index 0000000..1fd2d98 Binary files /dev/null and b/SOURCES/clang-10.0.0.src.tar.xz.sig differ diff --git a/SOURCES/clang-tools-extra-10.0.0.src.tar.xz.sig b/SOURCES/clang-tools-extra-10.0.0.src.tar.xz.sig new file mode 100644 index 0000000..70b6c07 Binary files /dev/null and b/SOURCES/clang-tools-extra-10.0.0.src.tar.xz.sig differ diff --git a/SPECS/clang.spec b/SPECS/clang.spec index 99b3dc0..a9af51b 100644 --- a/SPECS/clang.spec +++ b/SPECS/clang.spec @@ -1,44 +1,41 @@ %global compat_build 0 -%global maj_ver 9 +%global maj_ver 10 %global min_ver 0 %global patch_ver 0 -#%%global rc_ver 3 -%global baserelease 5 - -#i686 disabled because llvm-test is not built for this target -# other targets disables because of failing tests -%ifnarch s390x i686 ppc64le %{arm} -%global enable_test_pkg 1 -%endif +#%%global rc_ver 6 +%global baserelease 1 %global clang_tools_binaries \ - %{_bindir}/clangd \ %{_bindir}/clang-apply-replacements \ %{_bindir}/clang-change-namespace \ + %{_bindir}/clang-check \ %{_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 \ + %{_bindir}/clang-offload-wrapper \ %{_bindir}/clang-query \ %{_bindir}/clang-refactor \ - %{_bindir}/clang-reorder-fields \ %{_bindir}/clang-rename \ - %{_bindir}/clang-tidy + %{_bindir}/clang-reorder-fields \ + %{_bindir}/clang-scan-deps \ + %{_bindir}/clang-tidy \ + %{_bindir}/clangd \ + %{_bindir}/diagtool \ + %{_bindir}/hmaptool \ + %{_bindir}/pp-trace %global clang_binaries \ %{_bindir}/clang \ %{_bindir}/clang++ \ %{_bindir}/clang-%{maj_ver} \ %{_bindir}/clang++-%{maj_ver} \ - %{_bindir}/clang-check \ %{_bindir}/clang-cl \ %{_bindir}/clang-cpp \ - %{_bindir}/clang-extdef-mapping \ - %{_bindir}/clang-format \ - %{_bindir}/clang-import-test \ - %{_bindir}/clang-offload-bundler \ - %{_bindir}/clang-scan-deps \ - %{_bindir}/diagtool \ - %{_bindir}/hmaptool %if 0%{?compat_build} %global pkg_name clang%{maj_ver}.%{min_ver} @@ -66,11 +63,11 @@ %global build_install_prefix %{buildroot}%{install_prefix} %ifarch ppc64le -# Too many threads on 32 core ppc64 systems causes OOM errors. +# Too many threads on ppc64 systems causes OOM errors. %global _smp_mflags -j8 %endif -%global clang_srcdir cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src +%global clang_srcdir clang-%{version}%{?rc_ver:rc%{rc_ver}}.src %global clang_tools_srcdir clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src Name: %pkg_name @@ -80,15 +77,33 @@ Summary: A C language family front-end for LLVM License: NCSA URL: http://llvm.org -Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{clang_srcdir}.tar.xz +%if 0%{?rc_ver:1} +Source0: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{clang_srcdir}.tar.xz +Source3: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{clang_srcdir}.tar.xz.sig +%else +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_srcdir}.tar.xz +Source3: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_srcdir}.tar.xz.sig +%endif %if !0%{?compat_build} -Source1: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz +%if 0%{?rc_ver:1} +Source1: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{clang_tools_srcdir}.tar.xz +Source2: https://prereleases.llvm.org/%{version}/rc%{rc_ver}/%{clang_tools_srcdir}.tar.xz.sig +%else +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_tools_srcdir}.tar.xz +Source2: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_tools_srcdir}.tar.xz.sig %endif +%endif +Source4: https://prereleases.llvm.org/%{version}/hans-gpg-key.asc Patch4: 0002-gtest-reorg.patch -Patch9: 0001-Fix-uninitialized-value-in-ABIArgInfo.patch Patch11: 0001-ToolChain-Add-lgcc_s-to-the-linker-flags-when-using-.patch -Patch12: 0001-Fix-Driver-modules.cpp-test-to-work-when-build-direc.patch +Patch13: 0001-Make-funwind-tables-the-default-for-all-archs.patch + +### Fix crash with kernel bpf self-tests +##Patch14: 0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.patch + +# Not Upstream +Patch15: 0001-clang-Don-t-install-static-libraries.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -143,6 +158,9 @@ Requires: emacs-filesystem Provides: clang(major) = %{maj_ver} +Conflicts: compiler-rt < %{version} +Conflicts: compiler-rt > %{version} + %description clang: noun 1. A loud, resonant, metallic sound. @@ -156,6 +174,9 @@ as libraries and designed to be loosely-coupled and extensible. %package libs Summary: Runtime library for clang Recommends: compiler-rt%{?_isa} = %{version} +# libomp-devel is required, so clang can find the omp.h header when compiling +# with -fopenmp. +Recommends: libomp-devel%{_isa} = %{version} Recommends: libomp%{_isa} = %{version} %description libs @@ -167,8 +188,8 @@ Summary: Development header files for clang Requires: %{name}%{?_isa} = %{version}-%{release} # The clang CMake files reference tools from clang-tools-extra. Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release} -%endif Requires: %{name}-libs = %{version}-%{release} +%endif %description devel Development header files for clang. @@ -199,14 +220,14 @@ A set of extra tools built using Clang's tooling API. # just want clang. %package -n git-clang-format Summary: Integration of clang-format for git -Requires: %{name}%{?_isa} = %{version}-%{release} +Requires: %{name}-tools-extra = %{version}-%{release} Requires: git Requires: python3 %description -n git-clang-format clang-format integration for git. - + %package -n python3-clang Summary: Python3 bindings for clang Requires: %{name}-libs%{?_isa} = %{version}-%{release} @@ -232,9 +253,12 @@ pathfix.py -i %{__python3} -pn \ %setup -q -n %{clang_srcdir} %patch4 -p1 -b .gtest -%patch9 -p2 -b .abi-arginfo %patch11 -p1 -b .libcxx-fix -%patch12 -p2 -b .module-test-fix +%patch13 -p2 -b .unwind-all +%patch15 -p2 -b .no-install-static + + +#%patch14 -p2 -b .bpf-fix mv ../%{clang_tools_srcdir} tools/extra @@ -272,8 +296,8 @@ cd _build -DPYTHON_EXECUTABLE=%{__python3} \ -DCMAKE_INSTALL_RPATH:BOOL=";" \ %ifarch s390 s390x %{arm} %ix86 ppc64le - -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ - -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ + -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ + -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ %endif %if 0%{?compat_build} -DLLVM_CONFIG:FILEPATH=%{_bindir}/llvm-config-%{maj_ver}.%{min_ver}-%{__isa_bits} \ @@ -304,10 +328,11 @@ cd _build -DLLVM_ENABLE_RTTI=ON \ -DLLVM_BUILD_DOCS=ON \ -DLLVM_ENABLE_SPHINX=ON \ - -DCLANG_LINK_CLANG_DYLIB=OFF \ + -DCLANG_LINK_CLANG_DYLIB=ON \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \ \ -DCLANG_BUILD_EXAMPLES:BOOL=OFF \ + -DBUILD_SHARED_LIBS=OFF \ -DCLANG_REPOSITORY_STRING="%{?fedora:Fedora}%{?rhel:Red Hat} %{version}-%{release}" %ninja_build -l 8 @@ -349,6 +374,8 @@ rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py* # TODO: Package html docs rm -Rvf %{buildroot}%{_pkgdocdir} +rm -Rvf %{buildroot}%{install_prefix}/share/clang/clang-doc-default-stylesheet.css +rm -Rvf %{buildroot}%{install_prefix}/share/clang/index.js # TODO: What are the Fedora guidelines for packaging bash autocomplete files? rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh @@ -387,15 +414,10 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ninja check-all -C _build || \ %if !0%{?compat_build} %files %{clang_binaries} -%{_bindir}/c-index-test %{_mandir}/man1/clang.1.gz %{_mandir}/man1/clang++.1.gz %{_mandir}/man1/clang-%{maj_ver}.1.gz %{_mandir}/man1/clang++-%{maj_ver}.1.gz -%{_mandir}/man1/diagtool.1.gz -%{_emacs_sitestartdir}/clang-format.el -%{_datadir}/clang/clang-format.py* -%{_datadir}/clang/clang-format-diff.py* %endif %files libs @@ -433,10 +455,15 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ninja check-all -C _build || \ %files tools-extra %{clang_tools_binaries} +%{_bindir}/c-index-test %{_bindir}/find-all-symbols %{_bindir}/modularize +%{_mandir}/man1/diagtool.1.gz +%{_emacs_sitestartdir}/clang-format.el %{_emacs_sitestartdir}/clang-rename.el %{_emacs_sitestartdir}/clang-include-fixer.el +%{_datadir}/clang/clang-format.py* +%{_datadir}/clang/clang-format-diff.py* %{_datadir}/clang/clang-include-fixer.py* %{_datadir}/clang/clang-tidy-diff.py* %{_datadir}/clang/run-clang-tidy.py* @@ -451,6 +478,15 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ninja check-all -C _build || \ %endif %changelog +* Thu Apr 9 2020 sguelton@redhat.com - 10.0.0-1 +- 10.0.0 final + +* Fri Jan 10 2020 Tom Stellard - 9.0.1-2 +- Fix crash with kernel bpf self-tests + +* Thu Dec 19 2019 Tom Stellard - 9.0.1-1 +- 9.0.1 Release + * Fri Nov 15 2019 Tom Stellard - 9.0.0-5 - Fix typo from previous patch: move clang-libs dep to correct sub-package