Sync with llvm8.0 spec file

Original commit:

77699b4333

Signed-off-by: David Abdurachmanov <david.abdurachmanov@sifive.com>
This commit is contained in:
David Abdurachmanov 2019-08-22 20:05:52 -07:00
parent d359c22b89
commit 3109a5bb6e
Signed by: davidlt
GPG Key ID: 8B7F1DA0E2C9FDBB
3 changed files with 48 additions and 21 deletions

View File

@ -6,7 +6,7 @@
%bcond_with gold %bcond_with gold
%endif %endif
%global compat_build 0 %bcond_with compat_build
%global build_llvm_bindir %{buildroot}%{_bindir} %global build_llvm_bindir %{buildroot}%{_bindir}
%global llvm_libdir %{_libdir}/%{name} %global llvm_libdir %{_libdir}/%{name}
@ -15,8 +15,9 @@
%global min_ver 0 %global min_ver 0
%global patch_ver 0 %global patch_ver 0
#%%global rc_ver 4 #%%global rc_ver 4
%global baserelease 9
%if 0%{?compat_build} %if %{with compat_build}
%global pkg_name llvm%{maj_ver}.%{min_ver} %global pkg_name llvm%{maj_ver}.%{min_ver}
%global exec_suffix -%{maj_ver}.%{min_ver} %global exec_suffix -%{maj_ver}.%{min_ver}
%global install_prefix %{_libdir}/%{name} %global install_prefix %{_libdir}/%{name}
@ -39,14 +40,16 @@
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver} Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 8%{?rc_ver:.rc%{rc_ver}}.0.riscv64%{?dist}.1 Release: %{baserelease}%{?rc_ver:.rc%{rc_ver}}%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
URL: http://llvm.org URL: http://llvm.org
Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz Source0: http://%{?rc_ver:pre}releases.llvm.org/%{version}/%{?rc_ver:rc%{rc_ver}}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
%if %{without compat_build}
Source1: run-lit-tests Source1: run-lit-tests
Source2: lit.fedora.cfg.py Source2: lit.fedora.cfg.py
%endif
Patch5: 0001-PATCH-llvm-config.patch Patch5: 0001-PATCH-llvm-config.patch
Patch7: 0001-PATCH-Filter-out-cxxflags-not-supported-by-clang.patch Patch7: 0001-PATCH-Filter-out-cxxflags-not-supported-by-clang.patch
@ -122,7 +125,7 @@ Conflicts: %{name}-devel < 8
%description static %description static
Static libraries for the LLVM compiler infrastructure. Static libraries for the LLVM compiler infrastructure.
%if !0%{?compat_build} %if %{without compat_build}
%package test %package test
Summary: LLVM regression tests Summary: LLVM regression tests
@ -185,7 +188,7 @@ export LDFLAGS="${LDFLAGS} -latomic %{__global_ldflags}"
-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \ -DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
%endif %endif
%if !0%{?compat_build} %if %{without compat_build}
%if 0%{?__isa_bits} == 64 %if 0%{?__isa_bits} == 64
-DLLVM_LIBDIR_SUFFIX=64 \ -DLLVM_LIBDIR_SUFFIX=64 \
%else %else
@ -214,7 +217,7 @@ export LDFLAGS="${LDFLAGS} -latomic %{__global_ldflags}"
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \ -DLLVM_BUILD_EXAMPLES:BOOL=OFF \
\ \
-DLLVM_INCLUDE_UTILS:BOOL=ON \ -DLLVM_INCLUDE_UTILS:BOOL=ON \
%if 0%{?compat_build} %if %{with compat_build}
-DLLVM_INSTALL_UTILS:BOOL=OFF \ -DLLVM_INSTALL_UTILS:BOOL=OFF \
%else %else
-DLLVM_INSTALL_UTILS:BOOL=ON \ -DLLVM_INSTALL_UTILS:BOOL=ON \
@ -244,7 +247,7 @@ ninja -v
ninja -C _build -v install ninja -C _build -v install
%if !0%{?compat_build} %if %{without compat_build}
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
mv %{buildroot}/%{_bindir}/llvm-config %{buildroot}/%{_bindir}/llvm-config-%{__isa_bits} mv %{buildroot}/%{_bindir}/llvm-config %{buildroot}/%{_bindir}/llvm-config-%{__isa_bits}
@ -321,9 +324,9 @@ cp -R unittests/DebugInfo/PDB/Inputs %{buildroot}%{_datadir}/llvm/src/unittests/
# Add version suffix to binaries # Add version suffix to binaries
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
for binary in %{build_llvm_bindir}/* for f in %{buildroot}/%{install_bindir}/*; do
do filename=`basename $f`
mv ${binary} ${binary}%{exec_suffix} ln -s %{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix}
done done
# Move header files # Move header files
@ -332,6 +335,7 @@ ln -s ../../../%{install_includedir}/llvm %{buildroot}/%{pkg_includedir}/llvm
ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c ln -s ../../../%{install_includedir}/llvm-c %{buildroot}/%{pkg_includedir}/llvm-c
# Fix multi-lib # 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 %multilib_fix_c_header --file %{install_includedir}/llvm/Config/llvm-config.h
# Create ld.so.conf.d entry # Create ld.so.conf.d entry
@ -364,7 +368,7 @@ ninja check-all -C _build || \
%ldconfig_scriptlets libs %ldconfig_scriptlets libs
%if !0%{?compat_build} %if %{without compat_build}
%post devel %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 llvm-config %{_bindir}/llvm-config-%{__isa_bits} %{__isa_bits}
@ -377,7 +381,11 @@ fi
%endif %endif
%files %files
%if !0%{?compat_build} %exclude %{_mandir}/man1/llvm-config*
%{_mandir}/man1/*
%{_bindir}/*
%if %{without compat_build}
%exclude %{_bindir}/llvm-config-%{__isa_bits} %exclude %{_bindir}/llvm-config-%{__isa_bits}
%exclude %{_bindir}/not %exclude %{_bindir}/not
%exclude %{_bindir}/count %exclude %{_bindir}/count
@ -385,11 +393,6 @@ fi
%exclude %{_bindir}/lli-child-target %exclude %{_bindir}/lli-child-target
%exclude %{_bindir}/llvm-isel-fuzzer %exclude %{_bindir}/llvm-isel-fuzzer
%exclude %{_bindir}/llvm-opt-fuzzer %exclude %{_bindir}/llvm-opt-fuzzer
%{_bindir}/*
%exclude %{_mandir}/man1/llvm-config*
%{_mandir}/man1/*
%{_datadir}/opt-viewer %{_datadir}/opt-viewer
%else %else
%exclude %{pkg_bindir}/llvm-config %exclude %{pkg_bindir}/llvm-config
@ -398,7 +401,7 @@ fi
%files libs %files libs
%{pkg_libdir}/libLLVM-%{maj_ver}.so %{pkg_libdir}/libLLVM-%{maj_ver}.so
%if !0%{?compat_build} %if %{without compat_build}
%if %{with gold} %if %{with gold}
%{_libdir}/LLVMgold.so %{_libdir}/LLVMgold.so
%endif %endif
@ -416,7 +419,7 @@ fi
%{pkg_libdir}/libOptRemarks.so* %{pkg_libdir}/libOptRemarks.so*
%files devel %files devel
%if !0%{?compat_build} %if %{without compat_build}
%{_bindir}/llvm-config-%{__isa_bits} %{_bindir}/llvm-config-%{__isa_bits}
%{_mandir}/man1/llvm-config* %{_mandir}/man1/llvm-config*
%{_includedir}/llvm %{_includedir}/llvm
@ -441,7 +444,7 @@ fi
%doc %{_pkgdocdir}/html %doc %{_pkgdocdir}/html
%files static %files static
%if !0%{?compat_build} %if %{without compat_build}
%{_libdir}/*.a %{_libdir}/*.a
%exclude %{_libdir}/libLLVMTestingSupport.a %exclude %{_libdir}/libLLVMTestingSupport.a
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
@ -449,7 +452,7 @@ fi
%{_libdir}/%{name}/lib/*.a %{_libdir}/%{name}/lib/*.a
%endif %endif
%if !0%{?compat_build} %if %{without compat_build}
%files test %files test
%{_libexecdir}/tests/llvm/ %{_libexecdir}/tests/llvm/
@ -473,6 +476,9 @@ fi
%endif %endif
%changelog %changelog
* Tue Jul 30 2019 Tom Stellard <tstellar@redhat.com> - 8.0.0-9
- Sync with llvm8.0 spec file
* Thu Aug 22 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 8.0.0-8.1.0.riscv64 * Thu Aug 22 2019 David Abdurachmanov <david.abdurachmanov@sifive.com> - 8.0.0-8.1.0.riscv64
- Add support for RISC-V (riscv64) - Add support for RISC-V (riscv64)

16
tests/build-compat/runtest.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
set -ex
dnf download --disablerepo=* --enablerepo=test-llvm --source llvm
# The src.rpm is available in the directory the test run from.
set +e
mock --resultdir=. --old-chroot --with compat_build --rebuild *.src.rpm
if [ $? -ne 0 ]; then
cat root.log
cat build.log
exit 1
fi
exit 0

View File

@ -14,3 +14,8 @@
- rust-sanity: - rust-sanity:
dir: ./ dir: ./
run: cargo new hello && cd hello && cargo run run: cargo new hello && cd hello && cargo run
# 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