Blame SPECS/llvm.spec

50739f
%global maj_ver 7
74e884
%global min_ver 0
9c4e62
%global patch_ver 1
74e884
198b24
# Components enabled if supported by target architecture:
198b24
%ifarch %ix86 x86_64
198b24
  %bcond_without gold
198b24
%else
198b24
  %bcond_with gold
198b24
%endif
198b24
198b24
%if 0%{?rhel} == 6
198b24
%define rhel6 1
198b24
%endif
198b24
198b24
# llvm works on the 64-bit versions of these, but not the 32 versions.
198b24
# consequently we build swrast on them instead of llvmpipe.
198b24
ExcludeArch: ppc s390 %{?rhel6:s390x}
198b24
198b24
%ifarch s390x
198b24
%global host_target SystemZ
198b24
%endif
198b24
%ifarch ppc64 ppc64le
198b24
%global host_target PowerPC
9c4e62
# Limit build jobs on ppc64 systems to avoid running out of memory.
9c4e62
%global _smp_mflags -j8
198b24
%endif
198b24
%ifarch %ix86 x86_64
198b24
%global host_target X86
198b24
%endif
198b24
%ifarch aarch64
198b24
%global host_target AArch64
198b24
%endif
198b24
%ifarch %{arm}
198b24
%global host_target ARM
198b24
%endif
198b24
198b24
%ifnarch s390x
198b24
%global amdgpu ;AMDGPU
198b24
%endif
198b24
198b24
%global llvm_lib_suffix rhel
198b24
198b24
Name:		llvm-private
74e884
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
50739f
Release:	1%{?dist}
198b24
Summary:	llvm engine for Mesa
198b24
198b24
Group:          System Environment/Libraries
198b24
License:	NCSA
198b24
URL:		http://llvm.org
9c4e62
Source0:	http://llvm.org/releases/%{version}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
198b24
Source1:        cmake-3.4.3.tar.gz
9c4e62
Source2:	http://llvm.org/releases/%{version}/cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
198b24
Source100:	llvm-config.h
198b24
Source101:	clang-config.h
198b24
50739f
Patch0:	0001-Don-t-set-rpath-when-installing.patch
74e884
Patch1: 0001-Fix-CMake-include-patch.patch
198b24
198b24
BuildRequires:	cmake
198b24
BuildRequires:	zlib-devel
198b24
%if %{with gold}
198b24
BuildRequires:  binutils-devel
198b24
%endif
198b24
BuildRequires:  python
198b24
198b24
%description
198b24
This package contains the LLVM-based runtime support for Mesa.  It is not a
198b24
fully-featured build of LLVM, and use by any package other than Mesa is not
198b24
supported.
198b24
198b24
%package devel
198b24
Summary:	Libraries and header files for LLVM
198b24
Requires:	%{name}%{?_isa} = %{version}-%{release}
198b24
198b24
%description devel
198b24
This package contains library and header files needed to build the LLVM
198b24
support in Mesa.
198b24
198b24
%prep
9c4e62
%setup -T -q -b 2 -n cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
198b24
9c4e62
%setup -q -n llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src
198b24
198b24
tar xf %{SOURCE1}
198b24
50739f
%patch0 -p1 -b .rpath
198b24
%patch1 -p1 -b .fixinc
198b24
198b24
%build
198b24
198b24
BUILD_DIR=`pwd`/cmake_build
198b24
cd cmake-3.4.3
198b24
cmake . -DCMAKE_INSTALL_PREFIX=$BUILD_DIR
198b24
make
198b24
make install
198b24
cd -
198b24
198b24
198b24
sed -i 's|ActiveIncludeDir = ActivePrefix + "/include|&/llvm-private|g' tools/llvm-config/llvm-config.cpp
198b24
198b24
mkdir -p _build
198b24
cd _build
198b24
198b24
export PATH=$BUILD_DIR/bin:$PATH
198b24
%global __cmake $BUILD_DIR/bin/cmake
198b24
# force off shared libs as cmake macros turns it on.
198b24
%cmake .. \
198b24
	-DINCLUDE_INSTALL_DIR=%{_includedir}/llvm-private \
198b24
	-DLLVM_VERSION_SUFFIX="-%{llvm_lib_suffix}" \
198b24
	-DBUILD_SHARED_LIBS:BOOL=OFF \
198b24
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
198b24
%if 0%{?__isa_bits} == 64
198b24
	-DLLVM_LIBDIR_SUFFIX=64 \
198b24
%else
198b24
	-DLLVM_LIBDIR_SUFFIX= \
198b24
%endif
198b24
	\
74e884
	-DLLVM_TARGETS_TO_BUILD="%{host_target}%{?amdgpu};BPF" \
198b24
	-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
198b24
	-DLLVM_ENABLE_ZLIB:BOOL=ON \
198b24
	-DLLVM_ENABLE_FFI:BOOL=OFF \
198b24
	-DLLVM_ENABLE_RTTI:BOOL=OFF \
198b24
%if %{with gold}
198b24
	-DLLVM_BINUTILS_INCDIR=%{_includedir} \
198b24
%endif
198b24
	\
198b24
	-DLLVM_BUILD_RUNTIME:BOOL=ON \
198b24
	\
198b24
	-DLLVM_INCLUDE_TOOLS:BOOL=ON \
198b24
	-DLLVM_BUILD_TOOLS:BOOL=ON \
198b24
	\
198b24
	-DLLVM_INCLUDE_TESTS:BOOL=ON \
198b24
	-DLLVM_BUILD_TESTS:BOOL=ON \
198b24
	\
198b24
	-DLLVM_INCLUDE_EXAMPLES:BOOL=OFF \
198b24
	-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
198b24
	\
198b24
	-DLLVM_INCLUDE_UTILS:BOOL=ON \
198b24
	-DLLVM_INSTALL_UTILS:BOOL=OFF \
198b24
	\
198b24
	-DLLVM_INCLUDE_DOCS:BOOL=OFF \
198b24
	-DLLVM_BUILD_DOCS:BOOL=OFF \
198b24
	-DLLVM_ENABLE_SPHINX:BOOL=OFF \
198b24
	-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
198b24
	\
198b24
	-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
198b24
	-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
198b24
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
198b24
	-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
198b24
	-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF
198b24
9c4e62
make %{?_smp_mflags} VERBOSE=1 LLVM llvm-config FileCheck not count gtest gtest_main
198b24
198b24
# Build clang separately, because we need to build with
198b24
# -DBUILD_SHARED_LIBS:BOOL=ON for clang, but we don't want
198b24
# this for LLVM.
198b24
9c4e62
cd ../../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
198b24
mkdir -p _build
198b24
cd _build
9c4e62
%cmake ..  \
198b24
        -DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
198b24
        -DCMAKE_BUILD_TYPE=RelWithDebInfo \
9c4e62
        -DLLVM_CONFIG:FILEPATH=%{_builddir}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src/_build/bin/llvm-config \
198b24
        \
198b24
        -DCLANG_ENABLE_ARCMT:BOOL=ON \
198b24
        -DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
9c4e62
        -DCLANG_INCLUDE_DOCS:BOOL=OFF \
198b24
        -DCLANG_INCLUDE_TESTS:BOOL=ON \
198b24
        -DCLANG_PLUGIN_SUPPORT:BOOL=ON \
198b24
        -DENABLE_LINKER_BUILD_ID:BOOL=ON \
198b24
        \
198b24
        -DCLANG_BUILD_EXAMPLES:BOOL=OFF \
198b24
%if 0%{?__isa_bits} == 64
198b24
        -DLLVM_LIBDIR_SUFFIX=64 \
198b24
%else
198b24
        -DLLVM_LIBDIR_SUFFIX= \
198b24
%endif
198b24
        -DLIB_SUFFIX=
198b24
198b24
make %{?_smp_mflags}
198b24
198b24
%install
198b24
198b24
# Install LLVM
198b24
cd _build
9c4e62
make install-LLVM install-llvm-config install-llvm-headers install-cmake-exports DESTDIR=%{buildroot}
198b24
9c4e62
cd ../../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src/_build
198b24
make install DESTDIR=%{buildroot}
198b24
198b24
198b24
# fix multi-lib
198b24
mv -v %{buildroot}%{_bindir}/llvm-config %{buildroot}%{_bindir}/%{name}-config-%{__isa_bits}
198b24
mv -v %{buildroot}%{_includedir}/llvm-private/llvm/Config/llvm-config{,-%{__isa_bits}}.h
198b24
install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/llvm-private/llvm/Config/llvm-config.h
198b24
mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
198b24
install -m 0644 %{SOURCE101} %{buildroot}%{_includedir}/clang/Config/config.h
198b24
198b24
rm -f %{buildroot}%{_libdir}/*.a
198b24
198b24
rm -f %{buildroot}%{_libdir}/libLLVM.so
198b24
198b24
# remove documentation makefiles:
198b24
# they require the build directory to work
198b24
find examples -name 'Makefile' | xargs -0r rm -f
198b24
198b24
# RHEL: strip out most binaries, most libs, and man pages
198b24
ls %{buildroot}%{_bindir}/* | grep -v bin/llvm-private | xargs rm -f
198b24
ls %{buildroot}%{_libdir}/* | grep -v libLLVM | grep -v libclang | xargs rm -f
198b24
rm -rf %{buildroot}%{_mandir}/man1
198b24
198b24
# RHEL: Strip out some headers Mesa doesn't need
198b24
rm -rf %{buildroot}%{_includedir}/llvm-private/llvm/{Assembly}
198b24
rm -rf %{buildroot}%{_includedir}/llvm-private/llvm/TableGen
198b24
rm -rf %{buildroot}%{_includedir}/llvm-c/lto.h
198b24
198b24
# RHEL: Strip out cmake build foo
198b24
rm -rf %{buildroot}%{_datadir}/llvm/cmake
9c4e62
rm -rf %{buildroot}%{_libdir}/cmake/llvm/LLVMExports-*
198b24
rm -rf %{buildroot}%{_libdir}/cmake/clang
198b24
198b24
# RHEL: Strip out eveything in _datadir and _libexedir
198b24
rm -rf %{buildroot}%{_datadir}/*
198b24
rm -rf %{buildroot}%{_libexecdir}/*
198b24
198b24
# clang seems to ignore INCLUDE_INSTALL_DIR
198b24
mv %{buildroot}%{_includedir}/{,llvm-private}/clang
198b24
mv %{buildroot}%{_includedir}/{,llvm-private}/clang-c
198b24
198b24
# Move clang libraries:
198b24
mkdir %{buildroot}%{_libdir}/clang-private
198b24
for f in `find %{buildroot}%{_libdir} -iname 'libclang*' `; do mv $f %{buildroot}%{_libdir}/clang-private; done
198b24
198b24
%check
198b24
cd _build
9c4e62
make %{?_smp_mflags} check-all || :
198b24
9c4e62
cd ../../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src/_build
9c4e62
make %{?_smp_mflags} check-all
198b24
198b24
%post -p /sbin/ldconfig
198b24
%postun -p /sbin/ldconfig
198b24
198b24
%files
198b24
%doc LICENSE.TXT
50739f
%{_libdir}/libLLVM-%{maj_ver}*-%{llvm_lib_suffix}.so
198b24
%{_libdir}/clang-private/libclang*.so*
198b24
198b24
%files devel
198b24
%{_bindir}/llvm-private*
198b24
%{_includedir}/llvm-private/llvm
198b24
%{_includedir}/llvm-private/llvm-c
9c4e62
%{_libdir}/cmake/llvm/
198b24
%{_includedir}/llvm-private/clang
198b24
%{_includedir}/llvm-private/clang-c
198b24
%{_libdir}/clang/%{version}/include
198b24
198b24
%changelog
50739f
* Mon Jan 14 2019 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
50739f
- 7.0.1 Release
50739f
9c4e62
* Thu Jul 19 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
9c4e62
- Fix crash on power9
9c4e62
- Resolves: rhbz#1595996
9c4e62
9c4e62
* Mon Jul 09 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
9c4e62
- 6.0.1 Release
9c4e62
9c4e62
* Thu Jun 07 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.4.rc2
9c4e62
- 6.0.1-rc2 Release
9c4e62
9c4e62
* Wed Jun 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.3.rc1
9c4e62
- Fixup cmake files so bcc can use them
9c4e62
9c4e62
* Thu May 31 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.2.rc1
9c4e62
- Keep cmake files in package, because bcc needs them
9c4e62
9c4e62
* Wed Apr 04 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
9c4e62
- Rebase to LLVM 6.0.1-rc1
9c4e62
74e884
* Thu Dec 14 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-3
74e884
- Backport r312612 from upstream llvm: [PowerPC] Don't use xscvdpspn on the P7
74e884
74e884
* Thu Oct 19 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-2
74e884
- Enable BPF target
74e884
74e884
* Thu Oct 12 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
74e884
- Update to 5.0.0
74e884
198b24
* Thu Jun 01 2017 Tilmann Scheller <tschelle@redhat.com> - 3.9.1-9
198b24
- Fix two Clang test failures and enable Clang regression tests during build.
198b24
198b24
* Mon May 08 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-8
198b24
- Fix clang headers with multilib.
198b24
198b24
* Fri Apr 07 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-7
198b24
- Add clang libs
198b24
198b24
* Mon Mar 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-6
198b24
- Ignore test failures due APFloat unit test failure on AArch64.
198b24
198b24
* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-5
198b24
- Add rust patches
198b24
198b24
* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-4
198b24
- Don't ignore make check failures
198b24
198b24
* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-3
198b24
- Remove old patches
198b24
198b24
* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-2
198b24
- Rename mesa-private-llvm -> llvm-private
198b24
198b24
* Tue Jan 10 2017 Jeff Law  <law@redhat.com> - 3.9.1-1
198b24
- Update to 3.9.1
198b24
198b24
* Wed Jul 13 2016 Adam Jackson <ajax@redhat.com> - 3.8.1-1
198b24
- Update to 3.8.1
198b24
- Sync some x86 getHostCPUName updates from trunk
198b24
198b24
* Tue Jun 14 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-2
198b24
- drop private cmake build
198b24
198b24
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
198b24
- llvm 3.8.0 final release
198b24
198b24
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
198b24
- llvm 3.8.0 rc3 release
198b24
198b24
* Fri Feb 19 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.1
198b24
- llvm 3.8.0 rc2 release
198b24
198b24
* Tue Feb 16 2016 Dan HorĂ¡k <dan[at][danny.cz> 3.7.1-7
198b24
- recognize s390 as SystemZ when configuring build
198b24
198b24
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-6
198b24
- export C++ API for mesa.
198b24
198b24
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-5
198b24
- reintroduce llvm-static, clang needs it currently.
198b24
198b24
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
198b24
- jump back to single llvm library, the split libs aren't working very well.
198b24
198b24
* Fri Feb 05 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
198b24
- add missing obsoletes (#1303497)
198b24
198b24
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
198b24
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
198b24
198b24
* Thu Jan 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.1-1
198b24
- new upstream release
198b24
- enable gold linker
198b24
198b24
* Wed Nov 04 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
198b24
- fix Requires for subpackages on the main package
198b24
198b24
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
198b24
- initial version using cmake build system