diff --git a/0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch b/0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch deleted file mode 100644 index 2c15ece8f2053a266e7bb11067934b4d5519249e..0000000000000000000000000000000000000000 --- a/0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch +++ /dev/null @@ -1,52 +0,0 @@ -From a1bccf89a02accab69b359ef004faa95257333c0 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Fri, 7 Sep 2018 18:27:16 +0000 -Subject: [PATCH] Convert clang-format-diff.py to python3 using 2to3 - ---- - tools/clang-format/clang-format-diff.py | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/tools/clang-format/clang-format-diff.py b/tools/clang-format/clang-format-diff.py -index ffa30e70dd..1525a3815c 100755 ---- a/tools/clang-format/clang-format-diff.py -+++ b/tools/clang-format/clang-format-diff.py -@@ -1,4 +1,4 @@ --#!/usr/bin/env python -+#!/usr/bin/python3 - # - #===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===# - # -@@ -27,7 +27,7 @@ import difflib - import re - import string - import subprocess --import StringIO -+import io - import sys - - -@@ -89,9 +89,9 @@ def main(): - ['-lines', str(start_line) + ':' + str(end_line)]) - - # Reformat files containing changes in place. -- for filename, lines in lines_by_file.iteritems(): -+ for filename, lines in lines_by_file.items(): - if args.i and args.verbose: -- print 'Formatting', filename -+ print('Formatting', filename) - command = [args.binary, filename] - if args.i: - command.append('-i') -@@ -109,7 +109,7 @@ def main(): - if not args.i: - with open(filename) as f: - code = f.readlines() -- formatted_code = StringIO.StringIO(stdout).readlines() -+ formatted_code = io.StringIO(stdout).readlines() - diff = difflib.unified_diff(code, formatted_code, - filename, filename, - '(before formatting)', '(after formatting)') --- -2.14.3 - diff --git a/0001-Convert-scan-view-to-python3-using-2to3.patch b/0001-Convert-scan-view-to-python3-using-2to3.patch deleted file mode 100644 index 2534c6ed475b97f8d12d164370366793e7e5fb8c..0000000000000000000000000000000000000000 --- a/0001-Convert-scan-view-to-python3-using-2to3.patch +++ /dev/null @@ -1,93 +0,0 @@ -From c760f8d703af0c67774681b5a259d5dd3a1e5a77 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Wed, 19 Sep 2018 08:53:10 -0700 -Subject: [PATCH] Convert scan-view to python3 using 2to3 - ---- - tools/scan-view/bin/scan-view | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) - -diff --git a/tools/scan-view/bin/scan-view b/tools/scan-view/bin/scan-view -index 1b6e8ba..ca3dac5 100755 ---- a/tools/scan-view/bin/scan-view -+++ b/tools/scan-view/bin/scan-view -@@ -7,9 +7,9 @@ import sys - import imp - import os - import posixpath --import thread -+import _thread - import time --import urllib -+import urllib.request, urllib.parse, urllib.error - import webbrowser - - # How long to wait for server to start. -@@ -27,7 +27,7 @@ kMaxPortsToTry = 100 - - def url_is_up(url): - try: -- o = urllib.urlopen(url) -+ o = urllib.request.urlopen(url) - except IOError: - return False - o.close() -@@ -35,7 +35,7 @@ def url_is_up(url): - - - def start_browser(port, options): -- import urllib -+ import urllib.request, urllib.parse, urllib.error - import webbrowser - - url = 'http://%s:%d' % (options.host, port) -@@ -52,10 +52,10 @@ def start_browser(port, options): - sys.stderr.flush() - time.sleep(kSleepTimeout) - else: -- print >> sys.stderr, 'WARNING: Unable to detect that server started.' -+ print('WARNING: Unable to detect that server started.', file=sys.stderr) - - if options.debug: -- print >> sys.stderr, '%s: Starting webbrowser...' % sys.argv[0] -+ print('%s: Starting webbrowser...' % sys.argv[0], file=sys.stderr) - webbrowser.open(url) - - -@@ -69,9 +69,9 @@ def run(port, options, root): - - import ScanView - try: -- print 'Starting scan-view at: http://%s:%d' % (options.host, -- port) -- print ' Use Ctrl-C to exit.' -+ print('Starting scan-view at: http://%s:%d' % (options.host, -+ port)) -+ print(' Use Ctrl-C to exit.') - httpd = ScanView.create_server((options.host, port), - options, root) - httpd.serve_forever() -@@ -80,9 +80,9 @@ def run(port, options, root): - - - def port_is_open(port): -- import SocketServer -+ import socketserver - try: -- t = SocketServer.TCPServer((kDefaultHost, port), None) -+ t = socketserver.TCPServer((kDefaultHost, port), None) - except: - return False - t.server_close() -@@ -135,7 +135,7 @@ def main(): - # Kick off thread to wait for server and start web browser, if - # requested. - if args.startBrowser: -- t = thread.start_new_thread(start_browser, (port, args)) -+ t = _thread.start_new_thread(start_browser, (port, args)) - - run(port, args, args.root) - --- -1.8.3.1 - diff --git a/0001-Don-t-prefer-python2.7.patch b/0001-Don-t-prefer-python2.7.patch deleted file mode 100644 index 28ca4e013e3f37f43a4b0b10f09827ab27672e7d..0000000000000000000000000000000000000000 --- a/0001-Don-t-prefer-python2.7.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d13bd5108e3471cc6f6203ba1c0c0e67323bbb12 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Wed, 5 Sep 2018 21:43:42 -0700 -Subject: [PATCH] Don't prefer python2.7 - ---- - CMakeLists.txt | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 52b8819..6f233fd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -109,7 +109,6 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR ) - set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX} ) - - if(LLVM_INCLUDE_TESTS) -- set(Python_ADDITIONAL_VERSIONS 2.7) - include(FindPythonInterp) - if(NOT PYTHONINTERP_FOUND) - message(FATAL_ERROR --- -1.8.3.1 - diff --git a/0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch b/0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch deleted file mode 100644 index b9d0aee4942286548644c74269f8a157868bf781..0000000000000000000000000000000000000000 --- a/0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch +++ /dev/null @@ -1,120 +0,0 @@ -From d84a971ba917569829b51fff6057e5fd0d85e402 Mon Sep 17 00:00:00 2001 -From: Tom Stellard -Date: Thu, 18 Jan 2018 02:57:51 +0000 -Subject: [PATCH] Driver: Prefer vendor supplied gcc toolchain - -Summary: -This patch fixes an issue on Fedora where if you had the x86_64 cross -compiler installed on your x86_64 system, then clang would use that compiler -as the default toolchain. This was happening because the cross compiler -is installed to /usr/lib/gcc/x86_64-linux-gnu/ and this directory comes before -the default compiler directory (/usr/lib/gcc/x86_64-redhat-linux/) in the search -list. - -This patch re-orders the search list so that vendor supplied gcc toolchains -are selected before toolchains with a generic target, which should prevent -these kind of issues on other OSes too. - -Subscribers: srhines, cfe-commits - -Differential Revision: https://reviews.llvm.org/D42608 ---- - lib/Driver/ToolChains/Gnu.cpp | 47 ++++++++++++++++++++++--------------------- - 1 file changed, 24 insertions(+), 23 deletions(-) - -diff --git a/lib/Driver/ToolChains/Gnu.cpp b/lib/Driver/ToolChains/Gnu.cpp -index 3755673..5a49a6e 100644 ---- a/lib/Driver/ToolChains/Gnu.cpp -+++ b/lib/Driver/ToolChains/Gnu.cpp -@@ -1811,18 +1811,19 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - // lifetime or initialization issues. - static const char *const AArch64LibDirs[] = {"/lib64", "/lib"}; - static const char *const AArch64Triples[] = { -- "aarch64-none-linux-gnu", "aarch64-linux-gnu", "aarch64-redhat-linux", -- "aarch64-suse-linux"}; -+ "aarch64-redhat-linux", "aarch64-suse-linux", -+ "aarch64-none-linux-gnu", "aarch64-linux-gnu"}; - static const char *const AArch64beLibDirs[] = {"/lib"}; - static const char *const AArch64beTriples[] = {"aarch64_be-none-linux-gnu", - "aarch64_be-linux-gnu"}; - - static const char *const ARMLibDirs[] = {"/lib"}; - static const char *const ARMTriples[] = {"arm-linux-gnueabi"}; -- static const char *const ARMHFTriples[] = {"arm-linux-gnueabihf", -- "armv7hl-redhat-linux-gnueabi", -+ static const char *const ARMHFTriples[] = {"armv7hl-redhat-linux-gnueabi", - "armv6hl-suse-linux-gnueabi", -- "armv7hl-suse-linux-gnueabi"}; -+ "armv7hl-suse-linux-gnueabi", -+ "arm-linux-gnueabihf", -+ }; - static const char *const ARMebLibDirs[] = {"/lib"}; - static const char *const ARMebTriples[] = {"armeb-linux-gnueabi"}; - static const char *const ARMebHFTriples[] = { -@@ -1830,19 +1831,19 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const X86_64LibDirs[] = {"/lib64", "/lib"}; - static const char *const X86_64Triples[] = { -- "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", -- "x86_64-pc-linux-gnu", "x86_64-redhat-linux6E", -- "x86_64-redhat-linux", "x86_64-suse-linux", -- "x86_64-manbo-linux-gnu", "x86_64-linux-gnu", -- "x86_64-slackware-linux", "x86_64-unknown-linux", -- "x86_64-amazon-linux"}; -+ "x86_64-redhat-linux6E", "x86_64-redhat-linux", -+ "x86_64-suse-linux", "x86_64-slackware-linux", -+ "x86_64-manbo-linux-gnu", "x86_64-amazon-linux", -+ "x86_64-linux-gnu", "x86_64-unknown-linux-gnu", -+ "x86_64-pc-linux-gnu", "x86_64-linux-gnu", -+ "x86_64-unknown-linux"}; - static const char *const X32LibDirs[] = {"/libx32"}; - static const char *const X86LibDirs[] = {"/lib32", "/lib"}; - static const char *const X86Triples[] = { -- "i686-linux-gnu", "i686-pc-linux-gnu", "i486-linux-gnu", -- "i386-linux-gnu", "i386-redhat-linux6E", "i686-redhat-linux", -- "i586-redhat-linux", "i386-redhat-linux", "i586-suse-linux", -- "i486-slackware-linux", "i686-montavista-linux", "i586-linux-gnu"}; -+ "i386-redhat-linux6E", "i686-redhat-linux", "i586-redhat-linux", -+ "i386-redhat-linux", "i586-suse-linux", "i486-slackware-linux", -+ "i686-montavista-linux", "i686-linux-gnu", "i686-pc-linux-gnu", -+ "i486-linux-gnu", "i386-linux-gnu", "i586-linux-gnu"}; - - static const char *const MIPSLibDirs[] = {"/lib"}; - static const char *const MIPSTriples[] = {"mips-linux-gnu", "mips-mti-linux", -@@ -1864,16 +1865,16 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const PPCLibDirs[] = {"/lib32", "/lib"}; - static const char *const PPCTriples[] = { -- "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe", -- "powerpc-suse-linux", "powerpc-montavista-linuxspe"}; -+ "powerpc-suse-linux", "powerpc-montavista-linuxspe", -+ "powerpc-linux-gnu", "powerpc-unknown-linux-gnu", "powerpc-linux-gnuspe"}; - static const char *const PPC64LibDirs[] = {"/lib64", "/lib"}; - static const char *const PPC64Triples[] = { -- "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu", -- "powerpc64-suse-linux", "ppc64-redhat-linux"}; -+ "powerpc64-suse-linux", "ppc64-redhat-linux", -+ "powerpc64-linux-gnu", "powerpc64-unknown-linux-gnu"}; - static const char *const PPC64LELibDirs[] = {"/lib64", "/lib"}; - static const char *const PPC64LETriples[] = { -- "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu", -- "powerpc64le-suse-linux", "ppc64le-redhat-linux"}; -+ "powerpc64le-suse-linux", "ppc64le-redhat-linux", -+ "powerpc64le-linux-gnu", "powerpc64le-unknown-linux-gnu"}; - - static const char *const RISCV32LibDirs[] = {"/lib", "/lib32"}; - static const char *const RISCVTriples[] = {"riscv32-unknown-linux-gnu", -@@ -1889,8 +1890,8 @@ void Generic_GCC::GCCInstallationDetector::AddDefaultGCCPrefixes( - - static const char *const SystemZLibDirs[] = {"/lib64", "/lib"}; - static const char *const SystemZTriples[] = { -- "s390x-linux-gnu", "s390x-unknown-linux-gnu", "s390x-ibm-linux-gnu", -- "s390x-suse-linux", "s390x-redhat-linux"}; -+ "s390x-ibm-linux-gnu", "s390x-suse-linux", "s390x-redhat-linux", -+ "s390x-linux-gnu", "s390x-unknown-linux-gnu"}; - - - using std::begin; --- -1.8.3.1 - diff --git a/0001-Fix-uninitialized-value-in-ABIArgInfo.patch b/0001-Fix-uninitialized-value-in-ABIArgInfo.patch deleted file mode 100644 index 9755200a7668880c9805235ecee87fbcc1628220..0000000000000000000000000000000000000000 --- a/0001-Fix-uninitialized-value-in-ABIArgInfo.patch +++ /dev/null @@ -1,38 +0,0 @@ -From 565b9633ee68b311c1a954022869d9e99fee7286 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. ---- - include/clang/CodeGen/CGFunctionInfo.h | 11 +++++------ - 1 file changed, 5 insertions(+), 6 deletions(-) - -diff --git a/include/clang/CodeGen/CGFunctionInfo.h b/include/clang/CodeGen/CGFunctionInfo.h -index cf64e9f3ee..131eb38393 100644 ---- a/include/clang/CodeGen/CGFunctionInfo.h -+++ b/include/clang/CodeGen/CGFunctionInfo.h -@@ -112,14 +112,13 @@ private: - } - - ABIArgInfo(Kind K) -- : TheKind(K), PaddingInReg(false), InReg(false), SuppressSRet(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), SuppressSRet(false) {} - - public: -- ABIArgInfo() -- : TypeData(nullptr), PaddingType(nullptr), DirectOffset(0), -- TheKind(Direct), PaddingInReg(false), InReg(false), -- SuppressSRet(false) {} -+ ABIArgInfo() : ABIArgInfo(Direct) {} - - static ABIArgInfo getDirect(llvm::Type *T = nullptr, unsigned Offset = 0, - llvm::Type *Padding = nullptr, --- -2.19.2 - diff --git a/cfe-7.0.0.src.tar.xz b/clang-10.0.0.src.tar.xz similarity index 57% rename from cfe-7.0.0.src.tar.xz rename to clang-10.0.0.src.tar.xz index ccc1c48e66b4ae2839de433baab6c2ae21e67e1e..cc2d7dce1b9dc79cd03dfd751961a1318b9e952c 100644 Binary files a/cfe-7.0.0.src.tar.xz and b/clang-10.0.0.src.tar.xz differ diff --git a/clang-tools-extra-10.0.0.src.tar.xz b/clang-tools-extra-10.0.0.src.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..f566dec1effad6b68bcc55f8e8943ed2e23013fc Binary files /dev/null and b/clang-tools-extra-10.0.0.src.tar.xz differ diff --git a/clang-tools-extra-7.0.0.src.tar.xz b/clang-tools-extra-7.0.0.src.tar.xz deleted file mode 100644 index b35f09d0e14686561003de9701fd3e760b8f20e2..0000000000000000000000000000000000000000 Binary files a/clang-tools-extra-7.0.0.src.tar.xz and /dev/null differ diff --git a/clang.spec b/clang.spec index 994e9e68eb03ac1848c7088ca1f04f0f16e5a454..7ad60918853a34915a91a196a7cc29f670faa33f 100644 --- a/clang.spec +++ b/clang.spec @@ -1,28 +1,23 @@ -%global maj_ver 7 +%global maj_ver 10 %global min_ver 0 %global patch_ver 0 -%global clang_srcdir cfe-%{version}.src +%global clang_srcdir clang-%{version}.src %global clang_tools_srcdir clang-tools-extra-%{version}.src Name: clang -Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 7 +Version: 10.0.0 +Release: 0 License: NCSA Summary: An "LLVM native" C/C++/Objective-C compiler URL: http://llvm.org -Source0: http://releases.llvm.org/%{version}/%{clang_srcdir}.tar.xz -Source1: http://llvm.org/releases/%{version}/%{clang_tools_srcdir}.tar.xz +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_srcdir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{clang_tools_srcdir}.tar.xz Source100: clang-config.h Patch0: 0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch Patch1: 0001-GCC-compatibility-Ignore-fstack-clash-protection.patch -Patch2: 0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch -Patch4: 0001-gtest-reorg.patch -Patch5: 0001-Don-t-prefer-python2.7.patch -Patch6: 0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch -Patch7: 0001-Convert-scan-view-to-python3-using-2to3.patch -Patch8: 0001-Fix-uninitialized-value-in-ABIArgInfo.patch +Patch2: 0001-gtest-reorg.patch BuildRequires: cmake gcc-c++ python-sphinx git BuildRequires: llvm-devel = %{version} @@ -30,7 +25,7 @@ BuildRequires: compiler-rt = %{version} BuildRequires: llvm-static = %{version} BuildRequires: llvm-googletest = %{version} BuildRequires: libxml2-devel perl-generators ncurses-devel emacs libatomic -BuildRequires: python2-lit python3-lit python2-rpm-macros python3-sphinx python3-devel +BuildRequires: python3-lit python3-sphinx python3-devel Requires: libstdc++-devel gcc-c++ emacs-filesystem Provides: clang(major) = %{maj_ver} @@ -83,24 +78,14 @@ A set of extra tools built using Clang's tooling API. Summary: clang-format integration for git Requires: %{name} = %{version}-%{release} Requires: git -Requires: python2 %description -n git-clang-format clang-format integration for git. -%package -n python2-clang -Summary: Python2 bindings for clang -Requires: %{name}-libs = %{version}-%{release} -Requires: python2 -%description -n python2-clang -%{summary}. - %prep %setup -T -q -b 1 -n %{clang_tools_srcdir} pathfix.py -i %{__python3} -pn \ clang-tidy/tool/*.py -pathfix.py -i %{__python2} -pn \ - include-fixer/find-all-symbols/tool/run-find-all-symbols.py %autosetup -n %{clang_srcdir} -p1 -Sgit pathfix.py -i %{__python3} -pn \ @@ -152,9 +137,6 @@ cd _build %install %make_install -C _build -mkdir -p %{buildroot}%{python2_sitelib}/clang/ -install -p -m644 bindings/python/clang/* %{buildroot}%{python2_sitelib}/clang/ - mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/clang/Config/config.h @@ -173,13 +155,16 @@ rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} %check -cd _build -PATH=%{_libdir}/llvm:$PATH make %{?_smp_mflags} check-clang || \ -%ifarch %{arm} -: -%else -false -%endif +# Checking is disabled because we don't pack libLLVMTestingSupport.a, which makes +# standalone build of clang impossible. + +#cd _build +#PATH=%{_libdir}/llvm:$PATH make %{?_smp_mflags} check-clang || \ +#%ifarch %{arm} +#: +#%else +#false +#%endif %files %{_bindir}/clang @@ -190,7 +175,12 @@ false %{_bindir}/clang-cl %{_bindir}/clang-cpp %{_bindir}/clang-format -%{_bindir}/clang-func-mapping +%{_bindir}/clang-doc +%{_bindir}/clang-extdef-mapping +%{_bindir}/clang-move +%{_bindir}/clang-offload-wrapper +%{_bindir}/clang-scan-deps +%{_bindir}/pp-trace %{_bindir}/clang-import-test %{_bindir}/clang-offload-bundler %{_bindir}/diagtool @@ -216,7 +206,6 @@ false %files analyzer %{_bindir}/scan-view %{_bindir}/scan-build -%{_bindir}/scan-build %{_libexecdir}/ccc-analyzer %{_libexecdir}/c++-analyzer %{_datadir}/scan-view/ @@ -242,14 +231,16 @@ false %{_datadir}/clang/run-clang-tidy.py* %{_datadir}/clang/run-find-all-symbols.py* %{_datadir}/clang/clang-rename.py* +%{_datadir}/clang/index.js +%{_datadir}/clang/clang-doc-default-stylesheet.css %files -n git-clang-format %{_bindir}/git-clang-format -%files -n python2-clang -%{python2_sitelib}/clang/ - %changelog +* Sat Jun 06 2020 Shinwell Hu - 10.0.0-0 +- Upgrade to 10.0.0 + * Thu May 28 2020 leiju - 7.0.0-7 - Fix uninitialized value in ABIArgInfo