From 38c4b5e5a77c2f36ecffd604f9d4e49b904f4ae6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 17 Aug 2018 18:18:32 +0000 Subject: [PATCH] Move llvm-test-suite into a sub-package This will allow it to be run by CI systems instead of during the %check phase. --- 0001-Fix-CLAMR-build-with-newer-libstdc.patch | 28 +++++++++++++ clang.spec | 42 ++++++++++++------- tests/tests.yml | 8 ++++ 3 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 0001-Fix-CLAMR-build-with-newer-libstdc.patch diff --git a/0001-Fix-CLAMR-build-with-newer-libstdc.patch b/0001-Fix-CLAMR-build-with-newer-libstdc.patch new file mode 100644 index 0000000..72bafc4 --- /dev/null +++ b/0001-Fix-CLAMR-build-with-newer-libstdc.patch @@ -0,0 +1,28 @@ +From b997a61df6094d258db94393d378282e039ebe13 Mon Sep 17 00:00:00 2001 +From: Tom Stellard +Date: Fri, 17 Aug 2018 16:00:52 -0700 +Subject: [PATCH] Fix CLAMR build with newer libstdc++ + +--- + MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h +index 138704f..9db368d 100644 +--- a/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h ++++ b/MultiSource/Benchmarks/DOE-ProxyApps-C++/CLAMR/MallocPlus.h +@@ -99,9 +99,9 @@ struct malloc_plus_memory_entry { + + struct cmp_str + { +- bool operator()(char const *a, char const *b) ++ bool operator()(const string &a, const string &b) + { +- return strcmp(a, b) < 0; ++ return a.compare(b) < 0; + } + }; + +-- +1.8.3.1 + diff --git a/clang.spec b/clang.spec index 25130bc..4db57cf 100644 --- a/clang.spec +++ b/clang.spec @@ -59,7 +59,7 @@ Name: %pkg_name Version: %{maj_ver}.%{min_ver}.%{patch_ver} -Release: 0.2.rc%{rc_ver}%{?dist} +Release: 0.3.rc%{rc_ver}%{?dist} Summary: A C language family front-end for LLVM License: NCSA @@ -77,6 +77,7 @@ Patch1: 0001-GCC-compatibility-Ignore-fstack-clash-protection.patch Patch2: 0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch # This was merged into the release_70 branch after 7.0.0-rc1 Patch3: 0001-Merging-r338627.patch +Patch4: 0001-Fix-CLAMR-build-with-newer-libstdc.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -108,11 +109,6 @@ BuildRequires: python3-lit # /usr/bin/python2, so we must have the python2 version of lit. # FIXME: We should find a way to not depend on python2-lit. BuildRequires: python2-lit - -BuildRequires: zlib-devel -BuildRequires: tcl -BuildRequires: python2-virtualenv -BuildRequires: libstdc++-static BuildRequires: python3-sphinx BuildRequires: libatomic @@ -198,6 +194,21 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: python2 %description -n python2-clang %{summary}. + +%package -n llvm-test-suite +Summary: C/C++ Compiler Test Suite +Requires: cmake +Requires: libstdc++-static +Requires: python3-lit = 0.7.0 +# ABI-Testsuite requires python2-lit +Requires: python2-lit = 0.7.0 +Requires: llvm +Requires: tcl + +%description -n llvm-test-suite +C/C++ Compiler Test Suite that is mantained as an LLVM sub-project. This test +suite can be run with any compiler, not just clang. + %endif @@ -208,6 +219,7 @@ Requires: python2 %setup -T -q -b 1 -n %{clang_tools_srcdir} %setup -T -q -b 2 -n %{test_suite_srcdir} +%patch4 -p1 -b .build-fix %setup -q -n %{clang_srcdir} %patch0 -p1 -b .lit-search-path @@ -319,6 +331,10 @@ rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh # Add clang++-{version} sylink ln -s %{_bindir}/clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver} +# Install test suite +mkdir -p %{buildroot}%{_datadir}/llvm-test-suite/ +cp -R %{_builddir}/%{test_suite_srcdir}/* %{buildroot}%{_datadir}/llvm-test-suite + %endif %check @@ -333,14 +349,6 @@ PATH=%{_libdir}/llvm:$PATH make check-clang || \ false %endif -mkdir -p %{_builddir}/%{test_suite_srcdir}/_build -cd %{_builddir}/%{test_suite_srcdir}/_build - -# FIXME: Using the cmake macro adds -Werror=format-security to the C/CXX flags, -# which causes the test suite to fail to build. -cmake .. -DCMAKE_C_COMPILER=%{buildroot}/usr/bin/clang \ - -DCMAKE_CXX_COMPILER=%{buildroot}/usr/bin/clang++ -make %{?_smp_mflags} check || : %endif @@ -407,8 +415,14 @@ make %{?_smp_mflags} check || : %files -n python2-clang %{python2_sitelib}/clang/ +%files -n llvm-test-suite +%{_datadir}/llvm-test-suite/ + %endif %changelog +* Fri Aug 17 2018 Tom Stellard - 7.0.0-0.3.rc1 +- Move llvm-test-suite into a sub-package + * Wed Aug 15 2018 Tom Stellard - 7.0.0-0.2.rc1 - Rebuild for f30 diff --git a/tests/tests.yml b/tests/tests.yml index 6be2660..18f7c7a 100644 --- a/tests/tests.yml +++ b/tests/tests.yml @@ -5,8 +5,16 @@ - classic required_packages: - clang + - llvm-test-suite + - ninja-build - gcc-x86_64-linux-gnu tests: - rhbz#482491: dir: ./ run: echo "int main(){}" | clang -x c - + - llvm-test-suite: + dir: ./ + run: cd $(mktemp -d) && cmake -G Ninja /usr/share/llvm-test-suite/ -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang && ninja check + - llvm-abi-test-suite: + dir: ./ + run: cd /usr/share/llvm-test-suite/ABI-Testsuite/ && python2 linux-x86.py clang test -v --path /usr/lib64/llvm/