diff --git a/.clang.metadata b/.clang.metadata index 77c6957..ea84b60 100644 --- a/.clang.metadata +++ b/.clang.metadata @@ -1,2 +1,3 @@ -0d72ce018c85c54fc709c7da71d3dd1463af0bfc SOURCES/clang-9.0.1.src.tar.xz -f0571ec2135cb735f22baa149ac84e7334d0ac70 SOURCES/clang-tools-extra-9.0.1.src.tar.xz +0e61e92b22a620fe7f833fa8b2a56f2db96f7335 SOURCES/clang-10.0.1.src.tar.xz +26c996da082677aca1016bcf2141dbff01dc7300 SOURCES/clang-tools-extra-10.0.1.src.tar.xz +32fa4b0193960f05064f2ab31b5a89c7cf48a0b9 SOURCES/hans-gpg-key.asc diff --git a/.gitignore b/.gitignore index c3307e3..a673a19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -SOURCES/clang-9.0.1.src.tar.xz -SOURCES/clang-tools-extra-9.0.1.src.tar.xz +SOURCES/clang-10.0.1.src.tar.xz +SOURCES/clang-tools-extra-10.0.1.src.tar.xz +SOURCES/hans-gpg-key.asc diff --git a/SOURCES/0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.patch b/SOURCES/0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.patch deleted file mode 100644 index 2062f00..0000000 --- a/SOURCES/0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.patch +++ /dev/null @@ -1,204 +0,0 @@ -From 5eb29c8b23b652b8dd8988621f5c91191b13ffe3 Mon Sep 17 00:00:00 2001 -From: Yonghong Song -Date: Fri, 2 Aug 2019 21:28:28 +0000 -Subject: [PATCH] [BPF] annotate DIType metadata for builtin - preseve_array_access_index() - -Previously, debuginfo types are annotated to -IR builtin preserve_struct_access_index() and -preserve_union_access_index(), but not -preserve_array_access_index(). The debug info -is useful to identify the root type name which -later will be used for type comparison. - -For user access without explicit type conversions, -the previous scheme works as we can ignore intermediate -compiler generated type conversions (e.g., from union types to -union members) and still generate correct access index string. - -The issue comes with user explicit type conversions, e.g., -converting an array to a structure like below: - struct t { int a; char b[40]; }; - struct p { int c; int d; }; - struct t *var = ...; - ... __builtin_preserve_access_index(&(((struct p *)&(var->b[0]))->d)) ... -Although BPF backend can derive the type of &(var->b[0]), -explicit type annotation make checking more consistent -and less error prone. - -Another benefit is for multiple dimension array handling. -For example, - struct p { int c; int d; } g[8][9][10]; - ... __builtin_preserve_access_index(&g[2][3][4].d) ... -It would be possible to calculate the number of "struct p"'s -before accessing its member "d" if array debug info is -available as it contains each dimension range. - -This patch enables to annotate IR builtin preserve_array_access_index() -with proper debuginfo type. The unit test case and language reference -is updated as well. - -Signed-off-by: Yonghong Song - -Differential Revision: https://reviews.llvm.org/D65664 - -llvm-svn: 367724 -(cherry picked from commit d0ea05d5eff475a27a5d3bbe4d9fd389935f9cb2) ---- - clang/lib/CodeGen/CGExpr.cpp | 12 ++++++++--- - .../CodeGen/builtin-preserve-access-index-array.c | 18 +++++++++++++++++ - clang/test/CodeGen/builtin-preserve-access-index.c | 23 +++++++++++----------- - llvm/docs/LangRef.rst | 4 ++++ - llvm/include/llvm/IR/IRBuilder.h | 10 +++++++--- - llvm/test/CodeGen/BPF/CORE/intrinsic-array.ll | 2 +- - 6 files changed, 51 insertions(+), 18 deletions(-) - create mode 100644 clang/test/CodeGen/builtin-preserve-access-index-array.c - -diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp -index b6c2567..21c4103 100644 ---- a/clang/lib/CodeGen/CGExpr.cpp -+++ b/clang/lib/CodeGen/CGExpr.cpp -@@ -3405,6 +3405,7 @@ static Address emitArraySubscriptGEP(CodeGenFunction &CGF, Address addr, - ArrayRef indices, - QualType eltType, bool inbounds, - bool signedIndices, SourceLocation loc, -+ QualType *arrayType = nullptr, - const llvm::Twine &name = "arrayidx") { - // All the indices except that last must be zero. - #ifndef NDEBUG -@@ -3433,9 +3434,12 @@ static Address emitArraySubscriptGEP(CodeGenFunction &CGF, Address addr, - } else { - // Remember the original array subscript for bpf target - unsigned idx = LastIndex->getZExtValue(); -+ llvm::DIType *DbgInfo = nullptr; -+ if (arrayType) -+ DbgInfo = CGF.getDebugInfo()->getOrCreateStandaloneType(*arrayType, loc); - eltPtr = CGF.Builder.CreatePreserveArrayAccessIndex(addr.getPointer(), - indices.size() - 1, -- idx); -+ idx, DbgInfo); - } - - return Address(eltPtr, eltAlign); -@@ -3572,19 +3576,21 @@ LValue CodeGenFunction::EmitArraySubscriptExpr(const ArraySubscriptExpr *E, - auto *Idx = EmitIdxAfterBase(/*Promote*/true); - - // Propagate the alignment from the array itself to the result. -+ QualType arrayType = Array->getType(); - Addr = emitArraySubscriptGEP( - *this, ArrayLV.getAddress(), {CGM.getSize(CharUnits::Zero()), Idx}, - E->getType(), !getLangOpts().isSignedOverflowDefined(), SignedIndices, -- E->getExprLoc()); -+ E->getExprLoc(), &arrayType); - EltBaseInfo = ArrayLV.getBaseInfo(); - EltTBAAInfo = CGM.getTBAAInfoForSubobject(ArrayLV, E->getType()); - } else { - // The base must be a pointer; emit it with an estimate of its alignment. - Addr = EmitPointerWithAlignment(E->getBase(), &EltBaseInfo, &EltTBAAInfo); - auto *Idx = EmitIdxAfterBase(/*Promote*/true); -+ QualType ptrType = E->getBase()->getType(); - Addr = emitArraySubscriptGEP(*this, Addr, Idx, E->getType(), - !getLangOpts().isSignedOverflowDefined(), -- SignedIndices, E->getExprLoc()); -+ SignedIndices, E->getExprLoc(), &ptrType); - } - - LValue LV = MakeAddrLValue(Addr, E->getType(), EltBaseInfo, EltTBAAInfo); -diff --git a/clang/test/CodeGen/builtin-preserve-access-index-array.c b/clang/test/CodeGen/builtin-preserve-access-index-array.c -new file mode 100644 -index 0000000..a449b28 ---- /dev/null -+++ b/clang/test/CodeGen/builtin-preserve-access-index-array.c -@@ -0,0 +1,18 @@ -+// RUN: %clang -target x86_64 -emit-llvm -S -g %s -o - | FileCheck %s -+ -+#define _(x) (__builtin_preserve_access_index(x)) -+ -+struct s1 { -+ char a; -+ int b[4]; -+}; -+ -+const void *unit1(struct s1 *arg) { -+ return _(&arg->b[2]); -+} -+// CHECK: define dso_local i8* @unit1 -+// CHECK: call [4 x i32]* @llvm.preserve.struct.access.index.p0a4i32.p0s_struct.s1s(%struct.s1* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S1:[0-9]+]] -+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[ARRAY:[0-9]+]] -+// -+// CHECK: ![[ARRAY]] = !DICompositeType(tag: DW_TAG_array_type -+// CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1" -diff --git a/clang/test/CodeGen/builtin-preserve-access-index.c b/clang/test/CodeGen/builtin-preserve-access-index.c -index 954a3b8..1084416 100644 ---- a/clang/test/CodeGen/builtin-preserve-access-index.c -+++ b/clang/test/CodeGen/builtin-preserve-access-index.c -@@ -31,16 +31,16 @@ const void *unit4(const int *arg) { - } - // CHECK: define dso_local i8* @unit4 - // CHECK-NOT: getelementptr --// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 1) -+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[POINTER:[0-9]+]] - - const void *unit5(const int *arg[5]) { - return _(&arg[1][2]); - } - // CHECK: define dso_local i8* @unit5 - // CHECK-NOT: getelementptr --// CHECK: call i32** @llvm.preserve.array.access.index.p0p0i32.p0p0i32(i32** %{{[0-9a-z]+}}, i32 0, i32 1) -+// CHECK: call i32** @llvm.preserve.array.access.index.p0p0i32.p0p0i32(i32** %{{[0-9a-z]+}}, i32 0, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}} - // CHECK-NOT: getelementptr --// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 2) -+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0i32(i32* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[POINTER:[0-9]+]] - - struct s1 { - char a; -@@ -141,7 +141,7 @@ const void *unit13(struct s4 *arg) { - // CHECK: define dso_local i8* @unit13 - // CHECK: call %union.u* @llvm.preserve.struct.access.index.p0s_union.us.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S4:[0-9]+]] - // CHECK: call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %{{[0-9a-z]+}}, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_I_U:[0-9]+]] --// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2) -+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}} - - const void *unit14(union u3 *arg) { - return _(&arg->c.b[2]); -@@ -149,13 +149,13 @@ const void *unit14(union u3 *arg) { - // CHECK: define dso_local i8* @unit14 - // CHECK: call %union.u3* @llvm.preserve.union.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U3:[0-9]+]] - // CHECK: call [4 x i32]* @llvm.preserve.struct.access.index.p0a4i32.p0s_struct.ss(%struct.s* %{{[0-9a-z]+}}, i32 0, i32 0), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_I_S:[0-9]+]] --// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2) -+// CHECK: call i32* @llvm.preserve.array.access.index.p0i32.p0a4i32([4 x i32]* %{{[0-9a-z]+}}, i32 1, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}} - - const void *unit15(struct s4 *arg) { - return _(&arg[2].c.a); - } - // CHECK: define dso_local i8* @unit15 --// CHECK: call %struct.s4* @llvm.preserve.array.access.index.p0s_struct.s4s.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 0, i32 2) -+// CHECK: call %struct.s4* @llvm.preserve.array.access.index.p0s_struct.s4s.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}} - // CHECK: call %union.u* @llvm.preserve.struct.access.index.p0s_union.us.p0s_struct.s4s(%struct.s4* %{{[0-9a-z]+}}, i32 1, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[STRUCT_S4]] - // CHECK: call %union.u* @llvm.preserve.union.access.index.p0s_union.us.p0s_union.us(%union.u* %{{[0-9a-z]+}}, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_I_U]] - -@@ -163,15 +163,16 @@ const void *unit16(union u3 *arg) { - return _(&arg[2].a); - } - // CHECK: define dso_local i8* @unit16 --// CHECK: call %union.u3* @llvm.preserve.array.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0, i32 2) -+// CHECK: call %union.u3* @llvm.preserve.array.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 0, i32 2), !dbg !{{[0-9]+}}, !llvm.preserve.access.index !{{[0-9]+}} - // CHECK: call %union.u3* @llvm.preserve.union.access.index.p0s_union.u3s.p0s_union.u3s(%union.u3* %{{[0-9a-z]+}}, i32 1), !dbg !{{[0-9]+}}, !llvm.preserve.access.index ![[UNION_U3]] - -+// CHECK: ![[POINTER]] = !DIDerivedType(tag: DW_TAG_pointer_type -+// CHECK: ![[STRUCT_S4]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s4" -+// CHECK: ![[UNION_I_U]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u" -+// CHECK: ![[UNION_U3]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u3" -+// CHECK: ![[STRUCT_I_S]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s" - // CHECK: ![[STRUCT_S1]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s1" - // CHECK: ![[STRUCT_S2]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s2" - // CHECK: ![[STRUCT_S3]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s3" - // CHECK: ![[UNION_U1]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u1" - // CHECK: ![[UNION_U2]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u2" --// CHECK: ![[STRUCT_S4]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s4" --// CHECK: ![[UNION_I_U]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u" --// CHECK: ![[UNION_U3]] = distinct !DICompositeType(tag: DW_TAG_union_type, name: "u3" --// CHECK: ![[STRUCT_I_S]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "s" --- -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.1.src.tar.xz.sig b/SOURCES/clang-10.0.1.src.tar.xz.sig new file mode 100644 index 0000000..26c50da Binary files /dev/null and b/SOURCES/clang-10.0.1.src.tar.xz.sig differ diff --git a/SOURCES/clang-tools-extra-10.0.1.src.tar.xz.sig b/SOURCES/clang-tools-extra-10.0.1.src.tar.xz.sig new file mode 100644 index 0000000..dc5cf4b Binary files /dev/null and b/SOURCES/clang-tools-extra-10.0.1.src.tar.xz.sig differ diff --git a/SPECS/clang.spec b/SPECS/clang.spec index 86551ac..c1e2b66 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 1 -#%%global rc_ver 3 -%global baserelease 2 - -#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,7 +63,7 @@ %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 @@ -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 Patch11: 0001-ToolChain-Add-lgcc_s-to-the-linker-flags-when-using-.patch -# Fix crash with kernel bpf self-tests -Patch14: 0001-BPF-annotate-DIType-metadata-for-builtin-preseve_arr.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} @@ -233,7 +254,11 @@ pathfix.py -i %{__python3} -pn \ %patch4 -p1 -b .gtest %patch11 -p1 -b .libcxx-fix -%patch14 -p2 -b .bpf-fix +%patch13 -p2 -b .unwind-all +%patch15 -p2 -b .no-install-static + + +#%patch14 -p2 -b .bpf-fix mv ../%{clang_tools_srcdir} tools/extra @@ -271,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} \ @@ -303,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 @@ -348,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 @@ -386,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 @@ -432,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* @@ -450,6 +478,12 @@ LD_LIBRARY_PATH=%{buildroot}%{_libdir} ninja check-all -C _build || \ %endif %changelog +* Fri Jul 24 2020 sguelton@redhat.com - 10.0.1-1 +- 10.0.1 release + +* 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