Blame SPECS/llvm-compat.spec

6e53ac
%global maj_ver 7
6e53ac
%global min_ver 0
6e53ac
%global patch_ver 1
6e53ac
6e53ac
%ifarch ppc64 ppc64le
6e53ac
%global host_target PowerPC
6e53ac
# Limit build jobs on ppc64 systems to avoid running out of memory.
6e53ac
%global _smp_mflags -j8
6e53ac
%endif
6e53ac
6e53ac
%global buildroot_install_prefix %{buildroot}%{_prefix}
6e53ac
6e53ac
Name:		llvm-compat
6e53ac
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
6e53ac
Release:	8%{?dist}
6e53ac
Summary:	The Low Level Virtual Machine
6e53ac
6e53ac
License:	NCSA
6e53ac
URL:		http://llvm.org
6e53ac
Source0:	http://llvm.org/releases/%{version}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
6e53ac
Source1:	http://llvm.org/releases/%{version}/cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
6e53ac
6e53ac
Patch3:		0001-CMake-Split-static-library-exports-into-their-own-ex.patch
6e53ac
Patch7:		0001-Filter-out-cxxflags-not-supported-by-clang.patch
6e53ac
6e53ac
Patch12:	0001-unittests-Don-t-install-TestPlugin.so.patch
6e53ac
# If python2 is available on the system, llvm will try to use it.  This patch
6e53ac
# removes the preferences for python2, so we can make sure we always use
6e53ac
# python3.
6e53ac
Patch14:	0001-CMake-Don-t-prefer-python2.7.patch
6e53ac
Patch15:	0001-Don-t-set-rpath-when-installing.patch
6e53ac
Patch16:	0001-Re-apply-r346985-ADT-Drop-llvm-Optional-clang-specif.patch
6e53ac
#rhbz#1636479
6e53ac
Patch17:	0001-Disable-threading-in-thinLTO.patch
6e53ac
#rhbz#1696190
6e53ac
Patch19:	0001-GlobalISel-Lower-dbg.declare-into-indirect-DBG_VALUE.patch
6e53ac
#rhbz#1699374
6e53ac
Patch20: 0001-Ensure-that-variant-part-discriminator-is-read-by-Me.patch
6e53ac
Patch21: 0002-test-Fix-Assembler-debug-info.ll.patch
6e53ac
6e53ac
Patch100:	0001-Driver-Add-gcc-search-path-for-RHEL-devtoolset-8.patch
6e53ac
6e53ac
6e53ac
BuildRequires:  gcc
6e53ac
BuildRequires:  gcc-c++
6e53ac
BuildRequires:	cmake
6e53ac
BuildRequires:	zlib-devel
6e53ac
BuildRequires:  libffi-devel
6e53ac
BuildRequires:	ncurses-devel
6e53ac
BuildRequires:	python3-sphinx
6e53ac
BuildRequires:	multilib-rpm-config
6e53ac
BuildRequires:	ninja-build
6e53ac
# This pulls in /usr/bin/python3
6e53ac
BuildRequires:	python3-devel
6e53ac
6e53ac
%ifarch %{valgrind_arches}
6e53ac
# Enable extra functionality when run the LLVM JIT under valgrind.
6e53ac
BuildRequires:  valgrind-devel
6e53ac
%endif
6e53ac
6e53ac
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
6e53ac
6e53ac
%description
6e53ac
LLVM is a compiler infrastructure designed for compile-time, link-time,
6e53ac
runtime, and idle-time optimization of programs from arbitrary programming
6e53ac
languages. The compiler infrastructure includes mirror sets of programming
6e53ac
tools as well as libraries with equivalent functionality.
6e53ac
6e53ac
%package libs
6e53ac
Summary:	LLVM shared libraries
6e53ac
Obsoletes:	clang-libs = %{version}
6e53ac
Obsoletes:	llvm-libs = %{version}
6e53ac
6e53ac
%description libs
6e53ac
Shared libraries for the LLVM compiler infrastructure.
6e53ac
6e53ac
%prep
6e53ac
%setup -T -q -b 1 -n cfe-%{version}.src
6e53ac
6e53ac
%patch100 -p1
6e53ac
6e53ac
%setup -q -n llvm-%{version}.src
6e53ac
6e53ac
%patch3 -p1
6e53ac
%patch7 -p1
6e53ac
%patch12 -p1
6e53ac
%patch14 -p1
6e53ac
%patch15 -p1
6e53ac
%patch16 -p1
6e53ac
%patch17 -p1
6e53ac
%patch19 -p1
6e53ac
%patch20 -p1
6e53ac
%patch21 -p1
6e53ac
6e53ac
%build
6e53ac
6e53ac
%ifarch s390 %ix86
6e53ac
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
6e53ac
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
6e53ac
%endif
6e53ac
6e53ac
cd ..
6e53ac
6e53ac
mkdir llvm-build
6e53ac
pushd llvm-build
6e53ac
6e53ac
# force off shared libs as cmake macros turns it on.
6e53ac
%cmake ../llvm-%{version}.src -G Ninja \
6e53ac
	-DBUILD_SHARED_LIBS:BOOL=OFF \
6e53ac
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
6e53ac
%ifarch s390 %ix86
6e53ac
	-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
6e53ac
	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
6e53ac
%endif
6e53ac
%if 0%{?__isa_bits} == 64
6e53ac
	-DLLVM_LIBDIR_SUFFIX=64 \
6e53ac
%else
6e53ac
	-DLLVM_LIBDIR_SUFFIX= \
6e53ac
%endif
6e53ac
	\
6e53ac
	-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF" \
6e53ac
	-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
6e53ac
	-DLLVM_ENABLE_ZLIB:BOOL=ON \
6e53ac
	-DLLVM_ENABLE_FFI:BOOL=ON \
6e53ac
	-DLLVM_ENABLE_RTTI:BOOL=ON \
6e53ac
	-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
6e53ac
	-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
6e53ac
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
6e53ac
	-DLLVM_INCLUDE_TESTS=OFF \
6e53ac
	-DCMAKE_INSTALL_PREFIX=%{buildroot_install_prefix}
6e53ac
6e53ac
6e53ac
ninja -v %{?_smp_mflags} LLVM llvm-config
6e53ac
6e53ac
popd
6e53ac
6e53ac
mkdir clang-build
6e53ac
pushd clang-build
6e53ac
6e53ac
%cmake -G Ninja ../cfe-%{version}.src \
6e53ac
	-DLLVM_CONFIG=../llvm-build/bin/llvm-config \
6e53ac
        -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
6e53ac
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
6e53ac
        -DCLANG_ENABLE_ARCMT:BOOL=ON \
6e53ac
        -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
6e53ac
        -DCLANG_PLUGIN_SUPPORT:BOOL=ON \
6e53ac
        -DENABLE_LINKER_BUILD_ID:BOOL=ON \
6e53ac
        -DLLVM_ENABLE_EH=ON \
6e53ac
        -DLLVM_ENABLE_RTTI=ON \
6e53ac
	-DLLVM_INCLUDE_TESTS=OFF \
6e53ac
	-DCMAKE_SKIP_RPATH:BOOL=ON \
6e53ac
%if 0%{?__isa_bits} == 64
6e53ac
        -DLLVM_LIBDIR_SUFFIX=64 \
6e53ac
%else
6e53ac
        -DLLVM_LIBDIR_SUFFIX= \
6e53ac
%endif
6e53ac
        -DLIB_SUFFIX=
6e53ac
6e53ac
6e53ac
ninja help | grep 'libclang[a-zA-Z0-9]*.so'
6e53ac
ninja help | grep 'libclang[a-zA-Z0-9]*.so' | cut -d ':' -f 1 | xargs ninja -v %{?_smp_mflags}
6e53ac
popd
6e53ac
6e53ac
%install
6e53ac
cd ..
6e53ac
6e53ac
ninja-build -v %{?_smp_mflags} install-LLVM -C llvm-build
6e53ac
6e53ac
install clang-build/%{_lib}/*.so.%{maj_ver} %{buildroot}%{_libdir}
6e53ac
6e53ac
%check
6e53ac
6e53ac
%post libs -p /sbin/ldconfig
6e53ac
%postun libs -p /sbin/ldconfig
6e53ac
6e53ac
%files
6e53ac
6e53ac
%files libs
6e53ac
%{_libdir}/libLLVM-%{maj_ver}.so
6e53ac
%{_libdir}/libclang*.so.%{maj_ver}
6e53ac
6e53ac
%changelog
6e53ac
* Tue May 14 2019 sguelton@redhat.com - 7.0.1-8
6e53ac
- Mark llvm-libs and clang-libs = 7 as obsoletes
6e53ac
6e53ac
* Mon May 13 2019 sguelton@redhat.com - 7.0.1-7
6e53ac
- Mark llvm-libs and clang-libs < 8 as conflics instead of obsoletes
6e53ac
6e53ac
* Mon May 13 2019 sguelton@redhat.com - 7.0.1-6
6e53ac
- Declare obsoletes llvm-libs-7
6e53ac
6e53ac
* Mon May 13 2019 sguelton@redhat.com - 7.0.1-5
6e53ac
- Declare obsoletes clang-libs-7
6e53ac
6e53ac
* Wed May 1 2019 sguelton@redhat.com - 7.0.1-4
6e53ac
- Ship libclang.so
6e53ac
6e53ac
* Fri Apr 19 2019 Tom Stellard <tstellar@redhat.com> - 7.0.1-3
6e53ac
- Backport r342725 from trunk
6e53ac
6e53ac
* Sat Apr 13 2019 Tom Stellard <tstellar@redhat.com> - 7.0.1-2
6e53ac
- Backport r341969 from LLVM trunk
6e53ac
6e53ac
* Fri Dec 14 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
6e53ac
- 7.0.1 Release
6e53ac
6e53ac
* Thu Dec 13 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.5.rc3
6e53ac
- Drop compat libs
6e53ac
6e53ac
* Wed Dec 12 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.4.rc3
6e53ac
- Fix ambiguous python shebangs
6e53ac
6e53ac
* Tue Dec 11 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.3.rc3
6e53ac
- Disable threading in thinLTO
6e53ac
6e53ac
* Tue Dec 11 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.2.rc3
6e53ac
- Update cmake options for compat build
6e53ac
6e53ac
* Mon Dec 10 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.1.rc3
6e53ac
- 7.0.1-rc3 Release
6e53ac
6e53ac
* Fri Dec 07 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-14
6e53ac
- Don't build llvm-test on i686
6e53ac
6e53ac
* Thu Dec 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-13
6e53ac
- Fix build when python2 is not present on system
6e53ac
6e53ac
* Tue Nov 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-12
6e53ac
- Fix multi-lib installation of llvm-devel
6e53ac
6e53ac
* Tue Oct 23 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-11
6e53ac
- Add sub-packages for testing
6e53ac
6e53ac
* Mon Oct 01 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-10
6e53ac
- Drop scl macros
6e53ac
6e53ac
* Tue Aug 28 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-9
6e53ac
- Drop libedit dependency
6e53ac
6e53ac
* Tue Aug 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-8
6e53ac
- Only enabled valgrind functionality on arches that support it
6e53ac
6e53ac
* Mon Aug 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-7
6e53ac
- BuildRequires: python3-devel
6e53ac
6e53ac
* Mon Aug 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-6
6e53ac
- Backport fixes for rhbz#1610053, rhbz#1562196, rhbz#1595996
6e53ac
6e53ac
* Mon Aug 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-5
6e53ac
- Fix ld.so.conf.d path in files list
6e53ac
6e53ac
* Sat Aug 04 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-4
6e53ac
- Fix ld.so.conf.d path
6e53ac
6e53ac
* Fri Aug 03 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-3
6e53ac
- Install ld.so.conf so llvm libs are in the library search path
6e53ac
6e53ac
* Wed Jul 25 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
6e53ac
- Re-enable doc package now that BREW-2381 is fixed
6e53ac
6e53ac
* Tue Jul 10 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
6e53ac
- 6.0.1 Release
6e53ac
6e53ac
* Mon Jun 04 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-13
6e53ac
- Limit build jobs on ppc64 to avoid OOM errors
6e53ac
6e53ac
* Sat Jun 02 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-12
6e53ac
- Switch to python3-sphinx
6e53ac
6e53ac
* Thu May 31 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-11
6e53ac
- Remove conditionals to enable building only the llvm-libs package, we don't
6e53ac
  needs these for module builds.
6e53ac
6e53ac
* Wed May 23 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-10
6e53ac
- Add BuildRequires: libstdc++-static
6e53ac
- Resolves: #1580785
6e53ac
6e53ac
* Wed Apr 04 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-9
6e53ac
- Add conditionals to enable building only the llvm-libs package
6e53ac
6e53ac
* Tue Apr 03 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-8
6e53ac
- Drop BuildRequires: libstdc++-static this package does not exist in RHEL8
6e53ac
6e53ac
* Tue Mar 20 2018 Tilmann Scheller <tschelle@redhat.com> - 5.0.1-7
6e53ac
- Backport fix for rhbz#1558226 from trunk
6e53ac
6e53ac
* Tue Mar 06 2018 Tilmann Scheller <tschelle@redhat.com> - 5.0.1-6
6e53ac
- Backport fix for rhbz#1550469 from trunk
6e53ac
6e53ac
* Thu Feb 22 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-5
6e53ac
- Backport some retpoline fixes
6e53ac
6e53ac
* Tue Feb 06 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-4
6e53ac
- Backport retpoline support
6e53ac
6e53ac
* Mon Jan 29 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-3
6e53ac
- Backport r315279 to fix an issue with rust
6e53ac
6e53ac
* Mon Jan 15 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-2
6e53ac
- Drop ExculdeArch: ppc64
6e53ac
6e53ac
* Mon Jan 08 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
6e53ac
- 5.0.1 Release
6e53ac
6e53ac
* Thu Jun 22 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-3
6e53ac
- Fix Requires for devel package again.
6e53ac
6e53ac
* Thu Jun 22 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-2
6e53ac
- Fix Requires for llvm-devel
6e53ac
6e53ac
* Tue Jun 20 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
6e53ac
- 4.0.1 Release
6e53ac
6e53ac
* Mon Jun 05 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-5
6e53ac
- Build for llvm-toolset-7 rename
6e53ac
6e53ac
* Mon May 01 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
6e53ac
- Remove multi-lib workarounds
6e53ac
6e53ac
* Fri Apr 28 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
6e53ac
- Fix build with llvm-toolset-4 scl
6e53ac
6e53ac
* Mon Apr 03 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-2
6e53ac
- Simplify spec with rpm macros.
6e53ac
6e53ac
* Thu Mar 23 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
6e53ac
- LLVM 4.0.0 Final Release
6e53ac
6e53ac
* Wed Mar 22 2017 tstellar@redhat.com - 3.9.1-6
6e53ac
- Fix %%postun sep for -devel package.
6e53ac
6e53ac
* Mon Mar 13 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-5
6e53ac
- Disable failing tests on ARM.
6e53ac
6e53ac
* Sun Mar 12 2017 Peter Robinson <pbrobinson@fedoraproject.org> 3.9.1-4
6e53ac
- Fix missing mask on relocation for aarch64 (rhbz 1429050)
6e53ac
6e53ac
* Wed Mar 01 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-3
6e53ac
- revert upstream radeonsi breaking change.
6e53ac
6e53ac
* Thu Feb 23 2017 Josh Stone <jistone@redhat.com> - 3.9.1-2
6e53ac
- disable sphinx warnings-as-errors
6e53ac
6e53ac
* Fri Feb 10 2017 Orion Poplawski <orion@cora.nwra.com> - 3.9.1-1
6e53ac
- llvm 3.9.1
6e53ac
6e53ac
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-8
6e53ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
6e53ac
6e53ac
* Tue Nov 29 2016 Josh Stone <jistone@redhat.com> - 3.9.0-7
6e53ac
- Apply backports from rust-lang/llvm#55, #57
6e53ac
6e53ac
* Tue Nov 01 2016 Dave Airlie 
6e53ac
- rebuild for new arches
6e53ac
6e53ac
* Wed Oct 26 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-5
6e53ac
- apply the patch from -4
6e53ac
6e53ac
* Wed Oct 26 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-4
6e53ac
- add fix for lldb out-of-tree build
6e53ac
6e53ac
* Mon Oct 17 2016 Josh Stone <jistone@redhat.com> - 3.9.0-3
6e53ac
- Apply backports from rust-lang/llvm#47, #48, #53, #54
6e53ac
6e53ac
* Sat Oct 15 2016 Josh Stone <jistone@redhat.com> - 3.9.0-2
6e53ac
- Apply an InstCombine backport via rust-lang/llvm#51
6e53ac
6e53ac
* Wed Sep 07 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-1
6e53ac
- llvm 3.9.0
6e53ac
- upstream moved where cmake files are packaged.
6e53ac
- upstream dropped CppBackend
6e53ac
6e53ac
* Wed Jul 13 2016 Adam Jackson <ajax@redhat.com> - 3.8.1-1
6e53ac
- llvm 3.8.1
6e53ac
- Add mips target
6e53ac
- Fix some shared library mispackaging
6e53ac
6e53ac
* Tue Jun 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 3.8.0-2
6e53ac
- fix color support detection on terminal
6e53ac
6e53ac
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
6e53ac
- llvm 3.8.0 release
6e53ac
6e53ac
* Wed Mar 09 2016 Dan Horák <dan[at][danny.cz> 3.8.0-0.3
6e53ac
- install back memory consumption workaround for s390
6e53ac
6e53ac
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
6e53ac
- llvm 3.8.0 rc3 release
6e53ac
6e53ac
* Fri Feb 19 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.1
6e53ac
- llvm 3.8.0 rc2 release
6e53ac
6e53ac
* Tue Feb 16 2016 Dan Horák <dan[at][danny.cz> 3.7.1-7
6e53ac
- recognize s390 as SystemZ when configuring build
6e53ac
6e53ac
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-6
6e53ac
- export C++ API for mesa.
6e53ac
6e53ac
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-5
6e53ac
- reintroduce llvm-static, clang needs it currently.
6e53ac
6e53ac
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
6e53ac
- jump back to single llvm library, the split libs aren't working very well.
6e53ac
6e53ac
* Fri Feb 05 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
6e53ac
- add missing obsoletes (#1303497)
6e53ac
6e53ac
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
6e53ac
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
6e53ac
6e53ac
* Thu Jan 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.1-1
6e53ac
- new upstream release
6e53ac
- enable gold linker
6e53ac
6e53ac
* Wed Nov 04 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
6e53ac
- fix Requires for subpackages on the main package
6e53ac
6e53ac
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
6e53ac
- initial version using cmake build system