Browse Source

llvm make llvm non private

Signed-off-by: guibuilder_pel7x64builder0 <guibuilder@powerel.org>
master
guibuilder_pel7x64builder0 4 years ago
parent
commit
4dfb6bd516
  1. 178
      SPECS/llvm.spec

178
SPECS/llvm.spec

@ -3,45 +3,33 @@ @@ -3,45 +3,33 @@
%global patch_ver 1

# Components enabled if supported by target architecture:
%ifarch %ix86 x86_64
%ifarch x86_64 ppc64le ppc64 s390x
%bcond_without gold
%else
%bcond_with gold
%endif

%if 0%{?rhel} == 6
%define rhel6 1
%endif

# llvm works on the 64-bit versions of these, but not the 32 versions.
# consequently we build swrast on them instead of llvmpipe.
ExcludeArch: ppc s390 %{?rhel6:s390x}
%global _smp_mflags -j8

%ifarch s390x
%global host_target SystemZ
%endif
%ifarch ppc64 ppc64le
%global host_target PowerPC
# Limit build jobs on ppc64 systems to avoid running out of memory.
%global _smp_mflags -j8
%endif
%ifarch %ix86 x86_64
%ifarch x86_64
%global host_target X86
%endif
%ifarch aarch64
%global host_target AArch64
%endif
%ifarch %{arm}
%global host_target ARM
%endif

%ifnarch s390x
%global amdgpu ;AMDGPU
%endif

%global llvm_lib_suffix rhel
%global llvm_lib_suffix pel

Name: llvm-private
Name: llvm
Version: %{maj_ver}.%{min_ver}.%{patch_ver}
Release: 1%{?dist}
Summary: llvm engine for Mesa
@ -50,7 +38,6 @@ Group: System Environment/Libraries @@ -50,7 +38,6 @@ Group: System Environment/Libraries
License: NCSA
URL: http://llvm.org
Source0: http://llvm.org/releases/%{version}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
Source1: cmake-3.4.3.tar.gz
Source2: http://llvm.org/releases/%{version}/cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
Source100: llvm-config.h
Source101: clang-config.h
@ -58,7 +45,7 @@ Source101: clang-config.h @@ -58,7 +45,7 @@ Source101: clang-config.h
Patch0: 0001-Don-t-set-rpath-when-installing.patch
Patch1: 0001-Fix-CMake-include-patch.patch

BuildRequires: cmake
BuildRequires: cmake3
BuildRequires: zlib-devel
%if %{with gold}
BuildRequires: binutils-devel
@ -83,8 +70,6 @@ support in Mesa. @@ -83,8 +70,6 @@ support in Mesa.

%setup -q -n llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src

tar xf %{SOURCE1}

%patch0 -p1 -b .rpath
%patch1 -p1 -b .fixinc

@ -94,24 +79,14 @@ find ../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src -name illegal-UTF8.m -delete @@ -94,24 +79,14 @@ find ../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src -name illegal-UTF8.m -delete

%build

BUILD_DIR=`pwd`/cmake_build
cd cmake-3.4.3
cmake . -DCMAKE_INSTALL_PREFIX=$BUILD_DIR
make
make install
cd -


sed -i 's|ActiveIncludeDir = ActivePrefix + "/include|&/llvm-private|g' tools/llvm-config/llvm-config.cpp
#sed -i 's|ActiveIncludeDir = ActivePrefix + "/include|&/llvm-private|g' tools/llvm-config/llvm-config.cpp

mkdir -p _build
cd _build

export PATH=$BUILD_DIR/bin:$PATH
%global __cmake $BUILD_DIR/bin/cmake
# force off shared libs as cmake macros turns it on.
%cmake .. \
-DINCLUDE_INSTALL_DIR=%{_includedir}/llvm-private \
%cmake3 .. \
-DINCLUDE_INSTALL_DIR=%{_includedir}/llvm \
-DLLVM_VERSION_SUFFIX="-%{llvm_lib_suffix}" \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -164,10 +139,11 @@ make %{?_smp_mflags} VERBOSE=1 LLVM llvm-config FileCheck not count gtest gtest_ @@ -164,10 +139,11 @@ make %{?_smp_mflags} VERBOSE=1 LLVM llvm-config FileCheck not count gtest gtest_
cd ../../cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
mkdir -p _build
cd _build
%cmake .. \
%cmake3 .. \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DLLVM_CONFIG:FILEPATH=%{_builddir}/llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src/_build/bin/llvm-config \
-DBUILD_SHARED_LIBS:BOOL=ON \
\
-DCLANG_ENABLE_ARCMT:BOOL=ON \
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
@ -198,8 +174,8 @@ make install DESTDIR=%{buildroot} @@ -198,8 +174,8 @@ make install DESTDIR=%{buildroot}

# fix multi-lib
mv -v %{buildroot}%{_bindir}/llvm-config %{buildroot}%{_bindir}/%{name}-config-%{__isa_bits}
mv -v %{buildroot}%{_includedir}/llvm-private/llvm/Config/llvm-config{,-%{__isa_bits}}.h
install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/llvm-private/llvm/Config/llvm-config.h
mv -v %{buildroot}%{_includedir}/llvm/llvm/Config/llvm-config{,-%{__isa_bits}}.h
install -m 0644 %{SOURCE100} %{buildroot}%{_includedir}/llvm/llvm/Config/llvm-config.h
mv -v %{buildroot}%{_includedir}/clang/Config/config{,-%{__isa_bits}}.h
install -m 0644 %{SOURCE101} %{buildroot}%{_includedir}/clang/Config/config.h

@ -212,13 +188,13 @@ rm -f %{buildroot}%{_libdir}/libLLVM.so @@ -212,13 +188,13 @@ rm -f %{buildroot}%{_libdir}/libLLVM.so
find examples -name 'Makefile' | xargs -0r rm -f

# RHEL: strip out most binaries, most libs, and man pages
ls %{buildroot}%{_bindir}/* | grep -v bin/llvm-private | xargs rm -f
ls %{buildroot}%{_bindir}/* | grep -v bin/llvm | xargs rm -f
ls %{buildroot}%{_libdir}/* | grep -v libLLVM | grep -v libclang | xargs rm -f
rm -rf %{buildroot}%{_mandir}/man1

# RHEL: Strip out some headers Mesa doesn't need
rm -rf %{buildroot}%{_includedir}/llvm-private/llvm/{Assembly}
rm -rf %{buildroot}%{_includedir}/llvm-private/llvm/TableGen
rm -rf %{buildroot}%{_includedir}/llvm/llvm/{Assembly}
rm -rf %{buildroot}%{_includedir}/llvm/llvm/TableGen
rm -rf %{buildroot}%{_includedir}/llvm-c/lto.h

# RHEL: Strip out cmake build foo
@ -231,12 +207,12 @@ rm -rf %{buildroot}%{_datadir}/* @@ -231,12 +207,12 @@ rm -rf %{buildroot}%{_datadir}/*
rm -rf %{buildroot}%{_libexecdir}/*

# clang seems to ignore INCLUDE_INSTALL_DIR
mv %{buildroot}%{_includedir}/{,llvm-private}/clang
mv %{buildroot}%{_includedir}/{,llvm-private}/clang-c
#mv %{buildroot}%{_includedir}/{,llvm}/clang
#mv %{buildroot}%{_includedir}/{,llvm}/clang-c

# Move clang libraries:
mkdir %{buildroot}%{_libdir}/clang-private
for f in `find %{buildroot}%{_libdir} -iname 'libclang*' `; do mv $f %{buildroot}%{_libdir}/clang-private; done
#mkdir %{buildroot}%{_libdir}/clang
#for f in `find %{buildroot}%{_libdir} -iname 'libclang*' `; do mv $f %{buildroot}%{_libdir}/clang; done

%check
cd _build
@ -251,116 +227,16 @@ make %{?_smp_mflags} check-all @@ -251,116 +227,16 @@ make %{?_smp_mflags} check-all
%files
%doc LICENSE.TXT
%{_libdir}/libLLVM-%{maj_ver}*-%{llvm_lib_suffix}.so
%{_libdir}/clang-private/libclang*.so*
%{_libdir}/libclang*.so*

%files devel
%{_bindir}/llvm-private*
%{_includedir}/llvm-private/llvm
%{_includedir}/llvm-private/llvm-c
%{_bindir}/llvm*
%{_includedir}/llvm/llvm
%{_includedir}/llvm/llvm-c
%{_libdir}/cmake/llvm/
%{_includedir}/llvm-private/clang
%{_includedir}/llvm-private/clang-c
%{_includedir}/clang
%{_includedir}/clang-c
%{_libdir}/clang/%{version}/include

%changelog
* Mon Jan 14 2019 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
- 7.0.1 Release

* Thu Jul 19 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
- Fix crash on power9
- Resolves: rhbz#1595996

* Mon Jul 09 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
- 6.0.1 Release

* Thu Jun 07 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.4.rc2
- 6.0.1-rc2 Release

* Wed Jun 06 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.3.rc1
- Fixup cmake files so bcc can use them

* Thu May 31 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.2.rc1
- Keep cmake files in package, because bcc needs them

* Wed Apr 04 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-0.1.rc1
- Rebase to LLVM 6.0.1-rc1

* Thu Dec 14 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-3
- Backport r312612 from upstream llvm: [PowerPC] Don't use xscvdpspn on the P7

* Thu Oct 19 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-2
- Enable BPF target

* Thu Oct 12 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
- Update to 5.0.0

* Thu Jun 01 2017 Tilmann Scheller <tschelle@redhat.com> - 3.9.1-9
- Fix two Clang test failures and enable Clang regression tests during build.

* Mon May 08 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-8
- Fix clang headers with multilib.

* Fri Apr 07 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-7
- Add clang libs

* Mon Mar 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-6
- Ignore test failures due APFloat unit test failure on AArch64.

* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-5
- Add rust patches

* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-4
- Don't ignore make check failures

* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-3
- Remove old patches

* Mon Feb 27 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-2
- Rename mesa-private-llvm -> llvm-private

* Tue Jan 10 2017 Jeff Law <law@redhat.com> - 3.9.1-1
- Update to 3.9.1

* Wed Jul 13 2016 Adam Jackson <ajax@redhat.com> - 3.8.1-1
- Update to 3.8.1
- Sync some x86 getHostCPUName updates from trunk

* Tue Jun 14 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-2
- drop private cmake build

* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
- llvm 3.8.0 final release

* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
- llvm 3.8.0 rc3 release

* Fri Feb 19 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.1
- llvm 3.8.0 rc2 release

* Tue Feb 16 2016 Dan Horák <dan[at][danny.cz> 3.7.1-7
- recognize s390 as SystemZ when configuring build

* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-6
- export C++ API for mesa.

* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-5
- reintroduce llvm-static, clang needs it currently.

* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
- jump back to single llvm library, the split libs aren't working very well.

* Fri Feb 05 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
- add missing obsoletes (#1303497)

* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Thu Jan 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.1-1
- new upstream release
- enable gold linker

* Wed Nov 04 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
- fix Requires for subpackages on the main package

* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
- initial version using cmake build system
%changelog

Loading…
Cancel
Save