diff --git a/tests/.fmf/version b/.fmf/version similarity index 100% rename from tests/.fmf/version rename to .fmf/version diff --git a/.gitignore b/.gitignore index 2a28ccb..00440da 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,5 @@ /llvm-12.0.0.src.tar.xz.sig /llvm-12.0.1.src.tar.xz /llvm-12.0.1.src.tar.xz.sig +/llvm-13.0.0.src.tar.xz +/llvm-13.0.0.src.tar.xz.sig diff --git a/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch b/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch deleted file mode 100644 index 526b25f..0000000 --- a/0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 60760d66030695105bcf4364f22b7f6053a25253 Mon Sep 17 00:00:00 2001 -From: serge-sans-paille -Date: Thu, 8 Apr 2021 09:33:37 +0200 -Subject: [PATCH] [PATCH][llvm] Make source-interleave-prefix test case - compatible with llvm-test - -llvm-test runs test from a directory that's not the upstream one, and that leads -to some false positive. Workaround this by forcing the current working -directory. ---- - llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test -index 23ce55a..d260ee2 100644 ---- a/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test -+++ b/llvm/test/tools/llvm-objdump/X86/source-interleave-prefix.test -@@ -5,7 +5,7 @@ - - ; RUN: sed -e "s,SRC_COMPDIR,./Inputs,g" %p/Inputs/source-interleave.ll > %t-relative-path.ll - ; RUN: llc -o %t-relative-path.o -filetype=obj -mtriple=x86_64-pc-linux %t-relative-path.ll --; RUN: llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \ -+; RUN: mkdir -p %t0 && cd %t0 && llvm-objdump --prefix myprefix --source %t-relative-path.o 2>&1 | \ - ; RUN: FileCheck %s --check-prefix=CHECK-BROKEN-PREFIX -DFILE=%t-relative-path.o -DPREFIX=. - ; CHECK-BROKEN-PREFIX: warning: '[[FILE]]': failed to find source [[PREFIX]]/Inputs/source-interleave-x86_64.c - --- -1.8.3.1 - diff --git a/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch b/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch new file mode 100644 index 0000000..1866a66 --- /dev/null +++ b/0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch @@ -0,0 +1,33 @@ +From 9320ffeda3915c8f7be744c983a3470a89107bd7 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Tue, 14 Sep 2021 20:21:20 -0700 +Subject: [PATCH] XFAIL missing-abstract-variable.ll test on ppc64le + +It's seems the strategy with this test is to XFAIL it on all +architectures that it fails on. I wonder if we should be passing +it a specific triple? Also, from what I can tell, this tests only +runs when llvm is configured with LLVM_DEFAULT_TARGET_TRIPLE set +to a non-empty value, which is why it may not fail in every build +configuration. + +Differential Revision: https://reviews.llvm.org/D109806 +--- + llvm/test/DebugInfo/Generic/missing-abstract-variable.ll | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll +index bd0de60268b6..cc5d56b0c512 100644 +--- a/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll ++++ b/llvm/test/DebugInfo/Generic/missing-abstract-variable.ll +@@ -4,7 +4,7 @@ + ; powerpc64 (and on x86_64 at at least -O2). Presumably this is a SelectionDAG + ; issue. + ; FIXME: arm64 is an alias for aarch64 on macs, apparently? +-; XFAIL: powerpc64, aarch64, arm64, hexagon ++; XFAIL: powerpc64, aarch64, arm64, hexagon, ppc64le + + ; Build from the following source with clang -O2. + +-- +2.31.1 + diff --git a/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch new file mode 100644 index 0000000..82a00f2 --- /dev/null +++ b/0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch @@ -0,0 +1,75 @@ +From 3dc5722d5c7673a879f2b4680369d3ac8b6b64b6 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Wed, 4 Aug 2021 14:05:38 -0700 +Subject: [PATCH] cmake: Allow shared libraries to customize the soname using + LLVM_ABI_REVISION + +The LLVM_ABI_REVISION variable is intended to be used for release +candidates which introduce an ABI change to a shared library. This +variable can be specified per library, so there is not one global value +for all of LLVM. + +For example, if we LLVM X.0.0-rc2 introduces an ABI change for a library +compared with LLVM X.0.0-rc1, then the LLVM_ABI_REVISION number for +library will be incremented by 1. + +In the main branch, LLVM_ABI_REVISION should always be 0, it is only +meant to be used in the release branch. + +Differential Revision: https://reviews.llvm.org/D105594 +--- + llvm/cmake/modules/AddLLVM.cmake | 7 +++++-- + llvm/tools/llvm-shlib/CMakeLists.txt | 9 +++++++++ + 3 files changed, 19 insertions(+), 2 deletions(-) + +diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake +index 3e009f5061d3..a09405a1be3e 100644 +--- a/llvm/cmake/modules/AddLLVM.cmake ++++ b/llvm/cmake/modules/AddLLVM.cmake +@@ -586,11 +586,14 @@ function(llvm_add_library name) + # Set SOVERSION on shared libraries that lack explicit SONAME + # specifier, on *nix systems that are not Darwin. + if(UNIX AND NOT APPLE AND NOT ARG_SONAME) ++ if (NOT LLVM_ABI_REVISION) ++ set(LLVM_ABI_REVISION 0) ++ endif() + set_target_properties(${name} + PROPERTIES + # Since 4.0.0, the ABI version is indicated by the major version +- SOVERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX} +- VERSION ${LLVM_VERSION_MAJOR}${LLVM_VERSION_SUFFIX}) ++ SOVERSION ${LLVM_VERSION_MAJOR}.${LLVM_ABI_REVISION} ++ VERSION ${LLVM_VERSION_MAJOR}.${LLVM_ABI_REVISION}) + endif() + endif() + +diff --git a/llvm/tools/llvm-shlib/CMakeLists.txt b/llvm/tools/llvm-shlib/CMakeLists.txt +index 76b9a25cbbcd..b876e7fed6b5 100644 +--- a/llvm/tools/llvm-shlib/CMakeLists.txt ++++ b/llvm/tools/llvm-shlib/CMakeLists.txt +@@ -2,6 +2,11 @@ + # library is enabled by setting LLVM_BUILD_LLVM_DYLIB=yes on the CMake + # commandline. By default the shared library only exports the LLVM C API. + ++# In the main branch, LLVM_ABI_REVISION should always be 0. In the release ++# branches, this should be incremented before each release candidate every ++# time the ABI of libLLVM.so changes. ++set(LLVM_ABI_REVISION 0 CACHE STRING "ABI Revision number for SONAMEs (default: 0)") ++ + set(SOURCES + libllvm.cpp + ) +@@ -67,6 +72,10 @@ if(LLVM_BUILD_LLVM_DYLIB) + set_property(TARGET LLVM APPEND_STRING PROPERTY + LINK_FLAGS + " -compatibility_version 1 -current_version ${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}") ++ else() ++ set_target_properties(LLVM ++ PROPERTIES ++ SOVERSION ${LLVM_ABI_REVISION}) + endif() + + if(TARGET libLLVMExports) +-- +2.27.0 + diff --git a/0001-have-lit-preserve-SOURCE_DATE_EPOCH.patch b/0001-have-lit-preserve-SOURCE_DATE_EPOCH.patch new file mode 100644 index 0000000..37052c7 --- /dev/null +++ b/0001-have-lit-preserve-SOURCE_DATE_EPOCH.patch @@ -0,0 +1,27 @@ +commit 46c947af7ead0a939fbd7a93c370e7ead2128d07 +Author: serge-sans-paille +Date: Wed Aug 18 23:48:14 2021 +0200 + + Have lit preserve SOURCE_DATE_EPOCH + + This environment variable has been standardized for reproducible builds. Setting + it can help to have reproducible tests too, so keep it as part of the testing + env when set. + + See https://reproducible-builds.org/docs/source-date-epoch/ + + Differential Revision: https://reviews.llvm.org/D108332 + +diff --git a/llvm/utils/lit/lit/TestingConfig.py b/llvm/utils/lit/lit/TestingConfig.py +index d534d895e4ba..37558bd5059c 100644 +--- a/llvm/utils/lit/lit/TestingConfig.py ++++ b/llvm/utils/lit/lit/TestingConfig.py +@@ -28,7 +28,7 @@ class TestingConfig(object): + 'TMPDIR', 'TMP', 'TEMP', 'TEMPDIR', 'AVRLIT_BOARD', + 'AVRLIT_PORT', 'FILECHECK_OPTS', 'VCINSTALLDIR', + 'VCToolsinstallDir', 'VSINSTALLDIR', 'WindowsSdkDir', +- 'WindowsSDKLibVersion'] ++ 'WindowsSDKLibVersion', 'SOURCE_DATE_EPOCH'] + + if sys.platform == 'win32': + pass_vars.append('INCLUDE') diff --git a/0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch b/0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch deleted file mode 100644 index f2c512b..0000000 --- a/0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 9df652778fc92db9eb371c78bc7d1691417f3a60 Mon Sep 17 00:00:00 2001 -From: Rafik Zurob -Date: Fri, 22 Jan 2021 06:51:19 -0600 -Subject: [PATCH] [llvm-jitlink] Replace use of deprecated gethostbyname by - getaddrinfo. - -This patch replaces use of deprecated gethostbyname by getaddrinfo. - -Author: Rafik Zurob - -Reviewed By: lhames - -Differential Revision: https://reviews.llvm.org/D95477 ---- - llvm/tools/llvm-jitlink/llvm-jitlink.cpp | 28 ++++++++++++++++++++++++---- - 1 file changed, 24 insertions(+), 4 deletions(-) - -diff --git a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp -index da4a164..108dd61 100644 ---- a/llvm/tools/llvm-jitlink/llvm-jitlink.cpp -+++ b/llvm/tools/llvm-jitlink/llvm-jitlink.cpp -@@ -690,15 +690,35 @@ LLVMJITLinkRemoteTargetProcessControl::ConnectToExecutor() { - " is not a valid integer", - inconvertibleErrorCode()); - -+ addrinfo *AI; -+ addrinfo Hints{}; -+ Hints.ai_family = AF_INET; -+ Hints.ai_socktype = SOCK_STREAM; -+ Hints.ai_protocol = PF_INET; -+ Hints.ai_flags = AI_NUMERICSERV; -+ if (getaddrinfo(HostName.c_str(), PortStr.str().c_str(), &Hints, &AI) != 0) -+ return make_error("Failed to resolve " + HostName + ":" + -+ Twine(Port), -+ inconvertibleErrorCode()); -+ - int SockFD = socket(PF_INET, SOCK_STREAM, 0); -- hostent *Server = gethostbyname(HostName.c_str()); - sockaddr_in ServAddr; - memset(&ServAddr, 0, sizeof(ServAddr)); - ServAddr.sin_family = PF_INET; -- memmove(&Server->h_addr, &ServAddr.sin_addr.s_addr, Server->h_length); - ServAddr.sin_port = htons(Port); -- if (connect(SockFD, reinterpret_cast(&ServAddr), -- sizeof(ServAddr)) < 0) -+ -+ // getaddrinfo returns a list of address structures. Go through the list -+ // to find one we can connect to. -+ int ConnectRC = -1; -+ for (addrinfo *Server = AI; Server; Server = Server->ai_next) { -+ memmove(&Server->ai_addr, &ServAddr.sin_addr.s_addr, Server->ai_addrlen); -+ ConnectRC = connect(SockFD, reinterpret_cast(&ServAddr), -+ sizeof(ServAddr)); -+ if (ConnectRC == 0) -+ break; -+ } -+ freeaddrinfo(AI); -+ if (ConnectRC == -1) - return make_error("Failed to connect to " + HostName + ":" + - Twine(Port), - inconvertibleErrorCode()); --- -1.8.3.1 - diff --git a/llvm.spec b/llvm.spec index 49ef67d..69e1b77 100644 --- a/llvm.spec +++ b/llvm.spec @@ -7,21 +7,24 @@ %endif %bcond_with compat_build - -%bcond_with bundle_compat_lib +%bcond_without bundle_compat_lib +%bcond_without check %if %{with bundle_compat_lib} -%global compat_maj_ver 11 -%global compat_ver %{compat_maj_ver}.1.0rc2 +%global compat_maj_ver 12 +%global compat_ver %{compat_maj_ver}.0.1 %endif %global llvm_libdir %{_libdir}/%{name} %global build_llvm_libdir %{buildroot}%{llvm_libdir} #%%global rc_ver 5 -%global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src -%global maj_ver 12 +%global maj_ver 13 %global min_ver 0 -%global patch_ver 1 +%global patch_ver 0 +%if !%{maj_ver} && 0%{?rc_ver} +%global abi_revision 2 +%endif +%global llvm_srcdir llvm-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:rc%{rc_ver}}.src %if %{with compat_build} %global pkg_name llvm%{maj_ver} @@ -38,7 +41,9 @@ %global pkg_name llvm %global install_prefix /usr %global install_libdir %{_libdir} +%global pkg_bindir %{_bindir} %global pkg_libdir %{install_libdir} +%global exec_suffix %{nil} %endif %if 0%{?rhel} @@ -51,15 +56,19 @@ %global build_install_prefix %{buildroot}%{install_prefix} +# Lower memory usage of dwz on s390x +%global _dwz_low_mem_die_limit_s390x 1 +%global _dwz_max_die_limit_s390x 1000000 + Name: %{pkg_name} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} -Release: 3%{?dist} +Release: 1%{?dist} Summary: The Low Level Virtual Machine License: NCSA URL: http://llvm.org -Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz -Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig +Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz +Source1: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:-rc%{rc_ver}}/%{llvm_srcdir}.tar.xz.sig Source2: tstellar-gpg-key.asc %if %{without compat_build} @@ -70,11 +79,15 @@ Source4: lit.fedora.cfg.py Source5: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{compat_ver}/llvm-%{compat_ver}.src.tar.xz %endif -Patch0: 0001-PATCH-llvm-Make-source-interleave-prefix-test-case-c.patch -Patch1: 0001-llvm-jitlink-Replace-use-of-deprecated-gethostbyname.patch +%if 0%{?abi_revision} +Patch0: 0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch +%endif +Patch2: 0001-XFAIL-missing-abstract-variable.ll-test-on-ppc64le.patch # RHEL-specific patches -Patch101: 0001-Deactivate-markdown-doc.patch +Patch101: 0001-Deactivate-markdown-doc.patch +# Fixes the compress-debug-sections-zlib-gnu test failing on s390x +Patch102: 0001-have-lit-preserve-SOURCE_DATE_EPOCH.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -83,6 +96,7 @@ BuildRequires: ninja-build BuildRequires: zlib-devel BuildRequires: libffi-devel BuildRequires: ncurses-devel +BuildRequires: python3-psutil BuildRequires: python3-sphinx %if !0%{?rhel} BuildRequires: python3-recommonmark @@ -97,7 +111,7 @@ BuildRequires: valgrind-devel %endif # LLVM's LineEditor library will use libedit if it is available. BuildRequires: libedit-devel -# We need python3-devel for pathfix.py. +# We need python3-devel for %%py3_shebang_fix BuildRequires: python3-devel BuildRequires: python3-setuptools @@ -172,14 +186,6 @@ Static libraries for the LLVM compiler infrastructure. Summary: LLVM regression tests Requires: %{name}%{?_isa} = %{version}-%{release} Requires: %{name}-libs%{?_isa} = %{version}-%{release} -Requires: python3-lit -# The regression tests need gold. -Requires: binutils -# This is for llvm-config -Requires: %{name}-devel%{?_isa} = %{version}-%{release} -# Bugpoint tests require gcc -Requires: gcc -Requires: findutils Provides: llvm-test(major) = %{maj_ver} @@ -203,7 +209,7 @@ LLVM's modified googletest sources. %autosetup -n %{llvm_srcdir} -p2 -pathfix.py -i %{__python3} -pn \ +%py3_shebang_fix \ test/BugPoint/compile-custom.ll.py \ tools/opt-viewer/*.py \ utils/update_cc_test_checks.py @@ -220,7 +226,7 @@ pathfix.py -i %{__python3} -pn \ # Because of these failures, lto is disabled for now. %global _lto_cflags %{nil} -%ifarch s390 %{arm} %ix86 +%ifarch s390 s390x %{arm} %ix86 # Decrease debuginfo verbosity to reduce memory consumption during final library linking %global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %endif @@ -261,6 +267,7 @@ pathfix.py -i %{__python3} -pn \ \ -DLLVM_INCLUDE_TESTS:BOOL=ON \ -DLLVM_BUILD_TESTS:BOOL=ON \ + -DLLVM_LIT_EXTRA_ARGS=-v \ \ -DLLVM_INCLUDE_EXAMPLES:BOOL=ON \ -DLLVM_BUILD_EXAMPLES:BOOL=OFF \ @@ -283,10 +290,10 @@ pathfix.py -i %{__python3} -pn \ -DLLVM_VERSION_SUFFIX='' \ %endif -DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \ - -DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \ -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \ -DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \ -DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \ + %{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \ \ -DSPHINX_WARNINGS_AS_ERRORS=OFF \ -DCMAKE_INSTALL_PREFIX=%{install_prefix} \ @@ -303,6 +310,7 @@ pathfix.py -i %{__python3} -pn \ %cmake -S ../llvm-%{compat_ver}.src -B ../llvm-compat-libs -G Ninja \ -DCMAKE_INSTALL_PREFIX=%{buildroot}%{_libdir}/llvm%{compat_maj_ver}/ \ + -DCMAKE_SKIP_RPATH:BOOL=ON \ -DCMAKE_BUILD_TYPE=Release \ -DBUILD_SHARED_LIBS:BOOL=OFF \ -DLLVM_BUILD_LLVM_DYLIB=ON \ @@ -311,7 +319,6 @@ pathfix.py -i %{__python3} -pn \ %ninja_build -C ../llvm-compat-libs LLVM - %endif %install @@ -324,16 +331,12 @@ install -m 0755 ../llvm-compat-libs/lib/libLLVM-%{compat_maj_ver}.so %{buildroot rm -Rf ../llvm-compat-libs %endif -%if %{without compat_build} mkdir -p %{buildroot}/%{_bindir} -mv %{buildroot}/%{_bindir}/llvm-config %{buildroot}/%{_bindir}/llvm-config-%{__isa_bits} -# ghost presence -touch %{buildroot}%{_bindir}/llvm-config +%if %{without compat_build} # Fix some man pages -ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config-%{__isa_bits}.1 -mv %{buildroot}%{_mandir}/man1/*tblgen.1 %{buildroot}%{_mandir}/man1/llvm-tblgen.1 +ln -s llvm-config.1 %{buildroot}%{_mandir}/man1/llvm-config%{exec_suffix}-%{__isa_bits}.1 # Install binaries needed for lit tests %global test_binaries llvm-isel-fuzzer llvm-opt-fuzzer @@ -371,50 +374,6 @@ cp -R utils/unittest %{install_srcdir}/utils/ cp utils/update_cc_test_checks.py %{install_srcdir}/utils/ cp -R utils/UpdateTestChecks %{install_srcdir}/utils/ -# One of the lit tests references this file -install -d %{install_srcdir}/docs/CommandGuide/ -install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGuide/ - -# Generate lit config files. Strip off the last lines that initiates the -# test run, so we can customize the configuration. -head -n -2 %{_vpath_builddir}/test/lit.site.cfg.py >> %{lit_cfg} -head -n -2 %{_vpath_builddir}/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg} - -# Install custom fedora config file -cp %{SOURCE4} %{buildroot}%{lit_fedora_cfg} - -# Patch lit config files to load custom fedora config: -for f in %{lit_cfg} %{lit_unit_cfg}; do - echo "lit_config.load_config(config, '%{lit_fedora_cfg}')" >> $f -done - -install -d %{buildroot}%{_libexecdir}/tests/llvm -install -m 0755 %{SOURCE3} %{buildroot}%{_libexecdir}/tests/llvm - -# Install lit tests. We need to put these in a tarball otherwise rpm will complain -# about some of the test inputs having the wrong object file format. -install -d %{buildroot}%{_datadir}/llvm/ - -# The various tar options are there to make sur the archive is the same on 32 and 64 bit arch, i.e. -# the archive creation is reproducible. Move arch-specific content out of the tarball -mv %{lit_cfg} %{install_srcdir}/%{_arch}.site.cfg.py -mv %{lit_unit_cfg} %{install_srcdir}/%{_arch}.Unit.site.cfg.py -tar --sort=name --mtime='UTC 2020-01-01' -c test/ | gzip -n > %{install_srcdir}/test.tar.gz - -# Install the unit test binaries -mkdir -p %{build_llvm_libdir} -cp -R %{_vpath_builddir}/unittests %{build_llvm_libdir}/ -rm -rf `find %{build_llvm_libdir} -iname 'cmake*'` - -# Install libraries used for testing -install -m 0755 %{build_libdir}/BugpointPasses.so %{buildroot}%{_libdir} -install -m 0755 %{build_libdir}/LLVMHello.so %{buildroot}%{_libdir} - -# Install test inputs for PDB tests -echo "%{_datadir}/llvm/src/unittests/DebugInfo/PDB" > %{build_llvm_libdir}/unittests/DebugInfo/PDB/llvm.srcdir.txt -mkdir -p %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/ -cp -R unittests/DebugInfo/PDB/Inputs %{buildroot}%{_datadir}/llvm/src/unittests/DebugInfo/PDB/ - %if %{with gold} # Add symlink to lto plugin in the binutils plugin directory. %{__mkdir_p} %{buildroot}%{_libdir}/bfd-plugins/ @@ -424,7 +383,6 @@ ln -s %{_libdir}/LLVMgold.so %{buildroot}%{_libdir}/bfd-plugins/ %else # Add version suffix to binaries -mkdir -p %{buildroot}/%{_bindir} for f in %{buildroot}/%{install_bindir}/*; do filename=`basename $f` ln -s ../../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} @@ -436,7 +394,6 @@ ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c # Fix multi-lib -mv %{buildroot}%{_bindir}/llvm-config{%{exec_suffix},%{exec_suffix}-%{__isa_bits}} %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h # Create ld.so.conf.d entry @@ -457,8 +414,39 @@ rm -Rf %{build_install_prefix}/share/opt-viewer %endif +# llvm-config special casing. llvm-config is managed by update-alternatives. +# the original file must remain available for compatibility with the CMake +# infrastructure. Without compat, cmake points to the symlink, with compat it +# points to the original file. + +%if %{without compat_build} + +mv %{buildroot}/%{pkg_bindir}/llvm-config %{buildroot}/%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +# We still maintain a versionned symlink for consistency across llvm versions. +# This is specific to the non-compat build and matches the exec prefix for +# compat builds. An isa-agnostic versionned symlink is also maintained in the (un)install +# steps. +(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config%{exec_suffix}-%{__isa_bits} llvm-config-%{maj_ver}-%{__isa_bits} ) +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config-%{maj_ver} + +%else + +rm %{buildroot}%{_bindir}/llvm-config%{exec_suffix} +(cd %{buildroot}/%{pkg_bindir} ; ln -s llvm-config llvm-config%{exec_suffix}-%{__isa_bits} ) + +%endif + +# ghost presence +touch %{buildroot}%{_bindir}/llvm-config%{exec_suffix} + + %check +# Disable check section on arm due to some kind of memory related failure. +# Possibly related to https://bugzilla.redhat.com/show_bug.cgi?id=1920183 +%ifnarch %{arm} + # TODO: Fix the failures below %ifarch %{arm} rm test/tools/llvm-readobj/ELF/dependent-libraries.test @@ -467,25 +455,28 @@ rm test/tools/llvm-readobj/ELF/dependent-libraries.test # non reproducible errors rm test/tools/dsymutil/X86/swift-interface.test -# see rhbz#1988288 -sed -i -e "s/'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH'/'ASAN_SYMBOLIZER_PATH', 'MSAN_SYMBOLIZER_PATH', 'DFLTCC'/" test/lit.cfg.py - +%if %{with check} # FIXME: use %%cmake_build instead of %%__ninja -DFLTCC=0 LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_builddir} +LD_LIBRARY_PATH=%{buildroot}/%{pkg_libdir} %{__ninja} check-all -C %{_vpath_builddir} +%endif + +%endif %ldconfig_scriptlets libs -%if %{without compat_build} - %post devel -%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config llvm-config %{_bindir}/llvm-config-%{__isa_bits} %{__isa_bits} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config%{exec_suffix} llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%if %{without compat_build} +%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config-%{maj_ver} llvm-config-%{maj_ver} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{__isa_bits} +%endif %postun devel if [ $1 -eq 0 ]; then - %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits} -fi - + %{_sbindir}/update-alternatives --remove llvm-config%{exec_suffix} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} +%if %{without compat_build} + %{_sbindir}/update-alternatives --remove llvm-config-%{maj_ver} %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %endif +fi %files %license LICENSE.TXT @@ -493,9 +484,12 @@ fi %{_mandir}/man1/* %{_bindir}/* +%exclude %{_bindir}/llvm-config%{exec_suffix} +%exclude %{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} + %if %{without compat_build} -%exclude %{_bindir}/llvm-config -%exclude %{_bindir}/llvm-config-%{__isa_bits} +%exclude %{_bindir}/llvm-config-%{maj_ver} +%exclude %{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} %exclude %{_bindir}/not %exclude %{_bindir}/count %exclude %{_bindir}/yaml-bench @@ -504,7 +498,6 @@ fi %exclude %{_bindir}/llvm-opt-fuzzer %{_datadir}/opt-viewer %else -%exclude %{pkg_bindir}/llvm-config %{pkg_bindir} %endif @@ -517,6 +510,7 @@ fi %{_libdir}/bfd-plugins/LLVMgold.so %endif %{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so +%{_libdir}/libLLVM-%{maj_ver}.so%{?abi_revision:.%{abi_revision}} %{_libdir}/libLTO.so* %else %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf @@ -534,18 +528,19 @@ fi %files devel %license LICENSE.TXT -%if %{without compat_build} -%ghost %{_bindir}/llvm-config -%{_bindir}/llvm-config-%{__isa_bits} + +%ghost %{_bindir}/llvm-config%{exec_suffix} +%{pkg_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} %{_mandir}/man1/llvm-config* + +%if %{without compat_build} %{_includedir}/llvm %{_includedir}/llvm-c %{_libdir}/libLLVM.so %{_libdir}/cmake/llvm +%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} +%ghost %{_bindir}/llvm-config-%{maj_ver} %else -%{_bindir}/llvm-config%{exec_suffix}-%{__isa_bits} -%{pkg_bindir}/llvm-config -%{_mandir}/man1/llvm-config%{exec_suffix}.1.gz %{install_includedir}/llvm %{install_includedir}/llvm-c %{pkg_includedir}/llvm @@ -575,22 +570,12 @@ fi %files test %license LICENSE.TXT -%{_libexecdir}/tests/llvm/ -%{llvm_libdir}/unittests/ -%{_datadir}/llvm/src/unittests -%{_datadir}/llvm/src/test.tar.gz -%{_datadir}/llvm/src/%{_arch}.site.cfg.py -%{_datadir}/llvm/src/%{_arch}.Unit.site.cfg.py -%{_datadir}/llvm/lit.fedora.cfg.py -%{_datadir}/llvm/src/docs/CommandGuide/dsymutil.rst %{_bindir}/not %{_bindir}/count %{_bindir}/yaml-bench %{_bindir}/lli-child-target %{_bindir}/llvm-isel-fuzzer %{_bindir}/llvm-opt-fuzzer -%{_libdir}/BugpointPasses.so -%{_libdir}/LLVMHello.so %files googletest %license LICENSE.TXT @@ -600,6 +585,9 @@ fi %endif %changelog +* Wed Oct 06 2021 Timm Bäder - 13.0.0-1 +- 13.0.0 Release + * Wed Aug 18 2021 DJ Delorie - 12.0.1-3 - Rebuilt for libffi 3.4.2 SONAME transition. Related: rhbz#1891914 diff --git a/sources b/sources index d7cf4bc..620c7d0 100644 --- a/sources +++ b/sources @@ -1,2 +1,3 @@ +SHA512 (llvm-13.0.0.src.tar.xz) = c307500a5fdc2bf6d768a808cf879d33914e24437f4f794361eccedb28ac6a98ebc41ca6140d09364c9bdec565fabd049e364d3f5b39f1751ecff51b687c4eff +SHA512 (llvm-13.0.0.src.tar.xz.sig) = 790af8c3cad8789bb04fdb9046c973bc41eea76b6865d76e49ccc8db487cae41365ea99b770f1642f5c7dbde036f56428d261871c40fe61c584d13d36f9d491c SHA512 (llvm-12.0.1.src.tar.xz) = ff674afb4c8eea699a4756f1bb463f15098a7fa354c733de83c024f8f0cf238cd5f19ae3ec446831c7109235e293e2bf31d8562567ede163c8ec53af7306ba0f -SHA512 (llvm-12.0.1.src.tar.xz.sig) = 4c2904e13f1a51b624eed8f74fbf132ae1289f8e17d59b46bda78cd896a904f2bb53642fda7cef543905f17c3c9e2a65d5f97cd270b0182281518036d0fe1595 diff --git a/tests/binutils-plugin-ar/main.fmf b/tests/binutils-plugin-ar/main.fmf new file mode 100644 index 0000000..a8b6ebf --- /dev/null +++ b/tests/binutils-plugin-ar/main.fmf @@ -0,0 +1,2 @@ +summary: Make sure the the LLVM plugin for binutils' ar works +test: ./test.sh diff --git a/tests/binutils-plugin-ar/runtest.sh b/tests/binutils-plugin-ar/test.sh similarity index 80% rename from tests/binutils-plugin-ar/runtest.sh rename to tests/binutils-plugin-ar/test.sh index d18ab53..5dbacec 100755 --- a/tests/binutils-plugin-ar/runtest.sh +++ b/tests/binutils-plugin-ar/test.sh @@ -1,4 +1,6 @@ -set -exo pipefail +#!/bin/sh -eux + +set pipefail echo "void lto_function(){}" | clang -flto -O2 -c -x c -o foo.o - ar crs foo.a foo.o diff --git a/tests/build-compat/main.fmf b/tests/build-compat/main.fmf new file mode 100644 index 0000000..fe61457 --- /dev/null +++ b/tests/build-compat/main.fmf @@ -0,0 +1,3 @@ +summary: Make sure rebuilding LLVM still works with the new LLVM +test: ./test.sh +enabled: false diff --git a/tests/build-compat/runtest.sh b/tests/build-compat/test.sh similarity index 93% rename from tests/build-compat/runtest.sh rename to tests/build-compat/test.sh index 9d0a02d..04a97b2 100755 --- a/tests/build-compat/runtest.sh +++ b/tests/build-compat/test.sh @@ -1,6 +1,4 @@ -#!/bin/bash - -set -ex +#!/bin/sh -eux dnf download --disablerepo=* --enablerepo=test-llvm --source llvm diff --git a/tests/default.fmf b/tests/default.fmf new file mode 100644 index 0000000..dcffcb1 --- /dev/null +++ b/tests/default.fmf @@ -0,0 +1,12 @@ +summary: All available LLVM tests +discover: + how: fmf +execute: + how: tmt +prepare: + - name: packages + how: install + package: llvm +provision: + hardware: + memory: ">= 4 GiB" diff --git a/tests/integration-test-suite/main.fmf b/tests/integration-test-suite/main.fmf new file mode 100644 index 0000000..6e8844b --- /dev/null +++ b/tests/integration-test-suite/main.fmf @@ -0,0 +1,28 @@ +summary: Run the upstream LLVM integration test suite +description: | + Run the upstream LLVM integration test suite + + NOTE: don't forget to disable libcxx tests when libcxx is not available, by adding -DENABLE_LIBCXX=OFF. +test: ./test.sh +require: + - cmake + - llvm-devel + - clang + - clang-analyzer + - clang-tools-extra + - compiler-rt + - ninja-build + - libomp-devel + - lld + - lldb + - git + - make + - libstdc++-static + - clang-devel + + # In Fedora, python-lit is valid. In RHEL, however, the actual package is python3-lit. + - python-lit + # - python3-lit + + # Required in Fedora, but not shipped with RHEL. For future reference, comment the libcxx out as needed. + - libcxx-devel diff --git a/tests/integration-test-suite/runtest.sh b/tests/integration-test-suite/test.sh similarity index 92% rename from tests/integration-test-suite/runtest.sh rename to tests/integration-test-suite/test.sh index 1af4e4a..682e4f0 100755 --- a/tests/integration-test-suite/runtest.sh +++ b/tests/integration-test-suite/test.sh @@ -1,10 +1,11 @@ -#!/bin/bash +#!/bin/sh -eux usage() { echo "usage `basename $0` [OPTIONS]" echo " --threads NUM The number of threads to use for running tests." } +threads=0 thread_args="" repo_url=https://github.com/opencollab/llvm-toolchain-integration-test-suite @@ -24,12 +25,10 @@ while [ $# -gt 0 ]; do shift done -if [ -n "$threads" ]; then +if [ "$threads" -ge 1 ]; then thread_args="-j$threads" fi -set -xe - cd $(mktemp -d -p /var/tmp) git clone $repo_url cd llvm-toolchain-integration-test-suite diff --git a/tests/libllvm-size/main.fmf b/tests/libllvm-size/main.fmf new file mode 100644 index 0000000..f03b183 --- /dev/null +++ b/tests/libllvm-size/main.fmf @@ -0,0 +1,2 @@ +summary: Check that libLLVM.so has been properly stripped +test: ./test.sh diff --git a/tests/libllvm-size/test.sh b/tests/libllvm-size/test.sh new file mode 100755 index 0000000..7ceb8cb --- /dev/null +++ b/tests/libllvm-size/test.sh @@ -0,0 +1,10 @@ +#!/bin/sh -eux + +# There is a bug in the build process when it runs out of disk space +# while stripping binaries, which causes the strip to fail, but does +# not fail the build. This results in a libLLVM.so that is over 2GB +# which breaks the nightly compose. So this test checks that libLLVM.so +# is less than 100MB to ensure it was successfully stripped. +# https://bugzilla.redhat.com/show_bug.cgi?id=1793250 + +test $(stat -L -c %s /usr/lib64/libLLVM.so) -lt 104857600 diff --git a/tests/llvm-config/main.fmf b/tests/llvm-config/main.fmf new file mode 100644 index 0000000..6c36dd6 --- /dev/null +++ b/tests/llvm-config/main.fmf @@ -0,0 +1,2 @@ +summary: Make sure llvm-config symlink is properly set up +test: ./test.sh diff --git a/tests/llvm-config/test.sh b/tests/llvm-config/test.sh new file mode 100755 index 0000000..09a0286 --- /dev/null +++ b/tests/llvm-config/test.sh @@ -0,0 +1,3 @@ +#!/bin/sh -eux + +llvm-config --version diff --git a/tests/provision.fmf b/tests/provision.fmf deleted file mode 100644 index dd69f34..0000000 --- a/tests/provision.fmf +++ /dev/null @@ -1,5 +0,0 @@ ---- - -standard-inventory-qcow2: - qemu: - m: 4G diff --git a/tests/regression-tests/runtest.sh b/tests/regression-tests/runtest.sh deleted file mode 100755 index 42aa9b5..0000000 --- a/tests/regression-tests/runtest.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash - -set -ex - -cmd='/usr/libexec/tests/llvm/run-lit-tests --threads 1' -if [ `id -u` -eq 0 ]; then - # lit tests can't be run as root, so we need to run as a different user - user='llvm-regression-tests' - if ! id -u $user; then - useradd $user - fi - su $user -c "$cmd" - cmd="su $user -c $cmd" -else - exec $cmd -fi diff --git a/tests/rust-sanity/main.fmf b/tests/rust-sanity/main.fmf new file mode 100644 index 0000000..4f86eba --- /dev/null +++ b/tests/rust-sanity/main.fmf @@ -0,0 +1,16 @@ +summary: Test basic cargo usage +test: ./test.sh +require: +# Required for rust and possibly other dependant packages +# +# NOTE #1: drop the requirement once the transitional period between releases is gone +# and llvm-compat is no longer a) needed, and b) part of the build. +# +# NOTE #2: keep it the first requirement. Depending on the order of requirements, placing it somewhere +# else in the list may lead to harness uninstalling and re-installing LLVM packages. That a) would be +# a waste of time, b) could potentially hide issues, leading to testing unexpected NVRs. +# +# - llvm-compat + + - cargo + - rust diff --git a/tests/rust-sanity/test.sh b/tests/rust-sanity/test.sh new file mode 100755 index 0000000..fa15399 --- /dev/null +++ b/tests/rust-sanity/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +cargo new hello +cd hello +cargo run diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 7271aaa..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,50 +0,0 @@ -- hosts: localhost - roles: - - role: standard-test-basic - tags: - - classic - required_packages: - - rust - - cargo - - binutils - # the requirements below are for the integration suite - - cmake - - llvm-devel - - clang - - clang-analyzer - - clang-tools-extra - - compiler-rt - - ninja-build - - libcxx-devel - - libomp-devel - - python-lit - - lld - - lldb - - git - - make - - libstdc++-static - - clang-devel - tests: - - rust-sanity: - dir: ./ - run: cargo new hello && cd hello && cargo run - # There is a bug in the build process when it runs out of disk space - # while stripping binaries, which causes the strip to fail, but does - # not fail the build. This results in a libLLVM.so that is over 2GB - # which breaks the nightly compose. So this test checks that libLLVM.so - # is less than 100MB to ensure it was successfully stripped. - # https://bugzilla.redhat.com/show_bug.cgi?id=1793250 - - libllvm-size: - dir: ./ - run: test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000 - # This test ensures that the spec file still builds correctly with - # %global compat_build 1 - # FIXME: This fails, because the CI system has a hard-coded timeout of 4 - # hours. - #- build-compat - - binutils-plugin-ar - # make sure llvm-config symlink is properly setup - - llvm-config: - dir: ./ - run: llvm-config --version - - integration-test-suite diff --git a/tests/versioned-llvm-config/main.fmf b/tests/versioned-llvm-config/main.fmf new file mode 100644 index 0000000..eddb736 --- /dev/null +++ b/tests/versioned-llvm-config/main.fmf @@ -0,0 +1,2 @@ +summary: Make sure the versioned llvm-config symlink is properly set up +test: ./test.sh diff --git a/tests/versioned-llvm-config/test.sh b/tests/versioned-llvm-config/test.sh new file mode 100755 index 0000000..cfe72cf --- /dev/null +++ b/tests/versioned-llvm-config/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh -eux + +major=$(llvm-config --version | cut -d '.' -f1) + +llvm-config-$major --version