ca904f1
# Components enabled if supported by target architecture:
be655c4
%ifarch %ix86 x86_64
be655c4
  %bcond_without gold
434321d
%else
be655c4
  %bcond_with gold
434321d
%endif
23fedaf
383dd27
%global llvm_bindir %{_libdir}/%{name}
a264db5
%global maj_ver 6
3d29fda
%global min_ver 0
a264db5
%global patch_ver 0
383dd27
ca904f1
Name:		llvm
3d29fda
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
539d4ba
Release:	1%{?dist}
ca904f1
Summary:	The Low Level Virtual Machine
97e156a
ca904f1
License:	NCSA
ca904f1
URL:		http://llvm.org
a264db5
Source0:	http://llvm.org/releases/%{version}/%{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
cb91f5f
8b72be4
# recognize s390 as SystemZ when configuring build
8b72be4
Patch0:		llvm-3.7.1-cmake-s390.patch
4b6a509
Patch3:		0001-CMake-Split-static-library-exports-into-their-own-ex.patch
3d29fda
# FIXME: Symbol versioning breaks some unittests when statically linking
3d29fda
# libstdc++, so we disable it for now.
3d29fda
Patch4:		0001-Revert-Add-a-linker-script-to-version-LLVM-symbols.patch
fba8c44
ca904f1
BuildRequires:	cmake
ca904f1
BuildRequires:	zlib-devel
a5a420c
BuildRequires:  libffi-devel
3019f5f
BuildRequires:	ncurses-devel
ca904f1
BuildRequires:	python3-sphinx
e6b944d
BuildRequires:	multilib-rpm-config
0b697ba
%if %{with gold}
0b697ba
BuildRequires:  binutils-devel
0b697ba
%endif
ca904f1
BuildRequires:  libstdc++-static
cca2af2
# Enable extra functionality when run the LLVM JIT under valgrind.
cca2af2
BuildRequires:  valgrind-devel
dd25586
# LLVM's LineEditor library will use libedit if it is available.
dd25586
BuildRequires:  libedit-devel
Bryan O'Sullivan d291b49
ca904f1
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
Bryan O'Sullivan d291b49
ca904f1
%description
ca904f1
LLVM is a compiler infrastructure designed for compile-time, link-time,
ca904f1
runtime, and idle-time optimization of programs from arbitrary programming
ca904f1
languages. The compiler infrastructure includes mirror sets of programming
ca904f1
tools as well as libraries with equivalent functionality.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package devel
ca904f1
Summary:	Libraries and header files for LLVM
ca904f1
Requires:	%{name}%{?_isa} = %{version}-%{release}
c5c125e
# The installed LLVM cmake files will add -ledit to the linker flags for any
c5c125e
# app that requires the libLLVMLineEditor, so we need to make sure
c5c125e
# libedit-devel is available.
c5c125e
Requires:	libedit-devel
05920e6
Requires(post): %{_sbindir}/alternatives
05920e6
Requires(postun): %{_sbindir}/alternatives
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description devel
ca904f1
This package contains library and header files needed to develop new native
ca904f1
programs that use the LLVM infrastructure.
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%package doc
ca904f1
Summary:	Documentation for LLVM
ca904f1
BuildArch:	noarch
ca904f1
Requires:	%{name} = %{version}-%{release}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%description doc
Bryan O'Sullivan d291b49
Documentation for the LLVM compiler infrastructure.
Bryan O'Sullivan d291b49
a8c599f
%package libs
ca904f1
Summary:	LLVM shared libraries
a8c599f
a8c599f
%description libs
a8c599f
Shared libraries for the LLVM compiler infrastructure.
a8c599f
7a85177
%package static
7a85177
Summary:	LLVM static libraries
7a85177
7a85177
%description static
7a85177
Static libraries for the LLVM compiler infrastructure.
7a85177
Bryan O'Sullivan d291b49
%prep
a264db5
%autosetup -n %{name}-%{version}%{?rc_ver:rc%{rc_ver}}.src -p1
09ee2ab
53af609
%ifarch armv7hl
53af609
53af609
# These tests are marked as XFAIL, but they still run and hang on ARM.
53af609
for f in `grep -Rl 'XFAIL.\+arm' test/ExecutionEngine `; do  rm $f; done
53af609
53af609
%endif
53af609
Bryan O'Sullivan d291b49
%build
ca904f1
mkdir -p _build
ca904f1
cd _build
ca904f1
c0f49ce
%ifarch s390 %{arm} %ix86
c244b9b
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
c244b9b
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
c244b9b
%endif
c244b9b
933aa47
# force off shared libs as cmake macros turns it on.
ca904f1
%cmake .. \
933aa47
	-DBUILD_SHARED_LIBS:BOOL=OFF \
ca904f1
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
ca904f1
	-DCMAKE_SHARED_LINKER_FLAGS="-Wl,-Bsymbolic -static-libstdc++" \
c0f49ce
%ifarch s390 %{arm} %ix86
c244b9b
	-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
c244b9b
	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
c244b9b
%endif
a95cfcf
%if 0%{?__isa_bits} == 64
ca904f1
	-DLLVM_LIBDIR_SUFFIX=64 \
be655c4
%else
ca904f1
	-DLLVM_LIBDIR_SUFFIX= \
98be43e
%endif
ca904f1
	\
894065e
	-DLLVM_TARGETS_TO_BUILD="X86;AMDGPU;PowerPC;NVPTX;SystemZ;AArch64;ARM;Mips;BPF" \
ca904f1
	-DLLVM_ENABLE_LIBCXX:BOOL=OFF \
ca904f1
	-DLLVM_ENABLE_ZLIB:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_FFI:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_RTTI:BOOL=ON \
be655c4
%if %{with gold}
ca904f1
	-DLLVM_BINUTILS_INCDIR=%{_includedir} \
ca904f1
%endif
ca904f1
	\
ca904f1
	-DLLVM_BUILD_RUNTIME:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_TOOLS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_TOOLS:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_TESTS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_TESTS:BOOL=ON \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_EXAMPLES:BOOL=ON \
ca904f1
	-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_UTILS:BOOL=ON \
383dd27
	-DLLVM_INSTALL_UTILS:BOOL=ON \
383dd27
	-DLLVM_UTILS_INSTALL_DIR:PATH=%{llvm_bindir} \
ca904f1
	\
ca904f1
	-DLLVM_INCLUDE_DOCS:BOOL=ON \
ca904f1
	-DLLVM_BUILD_DOCS:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_SPHINX:BOOL=ON \
ca904f1
	-DLLVM_ENABLE_DOXYGEN:BOOL=OFF \
ca904f1
	\
933aa47
	-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
10a1975
	-DLLVM_DYLIB_EXPORT_ALL:BOOL=ON \
f8d5334
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
ca904f1
	-DLLVM_BUILD_EXTERNAL_COMPILER_RT:BOOL=ON \
ca904f1
	-DLLVM_INSTALL_TOOLCHAIN_ONLY:BOOL=OFF \
ca904f1
	\
a5fe5a1
	-DSPHINX_WARNINGS_AS_ERRORS=OFF \
ca904f1
	-DSPHINX_EXECUTABLE=%{_bindir}/sphinx-build-3
ca904f1
ca904f1
make %{?_smp_mflags}
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%install
ca904f1
cd _build
ca904f1
make install DESTDIR=%{buildroot}
9dd4cd3
ca904f1
# fix multi-lib
ca904f1
mv -v %{buildroot}%{_bindir}/llvm-config{,-%{__isa_bits}}
e6b944d
e6b944d
%multilib_fix_c_header --file %{_includedir}/llvm/Config/llvm-config.h
Bryan O'Sullivan 03bad00
a5a420c
%check
ca904f1
cd _build
ca904f1
make check-all || :
a5a420c
999f905
%post libs -p /sbin/ldconfig
999f905
%postun libs -p /sbin/ldconfig
194b08b
ca904f1
%post devel
ca904f1
%{_sbindir}/update-alternatives --install %{_bindir}/llvm-config llvm-config %{_bindir}/llvm-config-%{__isa_bits} %{__isa_bits}
a5a420c
a5a420c
%postun devel
05920e6
if [ $1 -eq 0 ]; then
05920e6
  %{_sbindir}/update-alternatives --remove llvm-config %{_bindir}/llvm-config-%{__isa_bits}
05920e6
fi
a5a420c
Bryan O'Sullivan d291b49
%files
ca904f1
%{_bindir}/*
383dd27
%{llvm_bindir}
ca904f1
%{_mandir}/man1/*.1.*
a5a420c
%exclude %{_bindir}/llvm-config-%{__isa_bits}
ca904f1
%exclude %{_mandir}/man1/llvm-config.1.*
3d29fda
%{_datadir}/opt-viewer
ca904f1
ca904f1
%files libs
2a3c791
%{_libdir}/BugpointPasses.so
2a3c791
%{_libdir}/LLVMHello.so
2a3c791
%if %{with gold}
2a3c791
%{_libdir}/LLVMgold.so
2a3c791
%endif
3d29fda
%{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so
1bbe5ad
%{_libdir}/libLTO.so*
Bryan O'Sullivan d291b49
Bryan O'Sullivan d291b49
%files devel
a5a420c
%{_bindir}/llvm-config-%{__isa_bits}
ca904f1
%{_mandir}/man1/llvm-config.1.*
ca904f1
%{_includedir}/llvm
ca904f1
%{_includedir}/llvm-c
2a3c791
%{_libdir}/libLLVM.so
894065e
%{_libdir}/cmake/llvm
4b6a509
%exclude %{_libdir}/cmake/llvm/LLVMStaticExports.cmake
c6833e1
c6833e1
%files doc
ca904f1
%doc %{_pkgdocdir}/html
Bryan O'Sullivan d291b49
7a85177
%files static
7a85177
%{_libdir}/*.a
4b6a509
%{_libdir}/cmake/llvm/LLVMStaticExports.cmake
7a85177
Bryan O'Sullivan d291b49
%changelog
539d4ba
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-1
539d4ba
- 6.0.0 Release
539d4ba
c0f49ce
* Thu Mar 08 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.5.rc2
c0f49ce
- Reduce debuginfo size on i686 to avoid OOM errors during linking
c0f49ce
3df6c8a
* Fri Feb 09 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.4.rc2
3df6c8a
- 6.0.1 rc2
3df6c8a
f4cd5f6
* Fri Feb 09 2018 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 6.0.0-0.3.rc1
f4cd5f6
- Escape macros in %%changelog
f4cd5f6
e5951f4
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.0.0-0.2.rc1
e5951f4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
e5951f4
a264db5
* Fri Jan 19 2018 Tom Stellard <tstellar@redhat.com> - 6.0.0-0.1.rc1
a264db5
- 6.0.1 rc1
a264db5
70bb4c2
* Tue Dec 19 2017 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
70bb4c2
- 5.0.1 Release
70bb4c2
f3d30bd
* Mon Nov 20 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-5
f3d30bd
- Backport debuginfo fix for rust
f3d30bd
ca4631e
* Fri Nov 03 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-4
ca4631e
- Reduce debuginfo size for ARM
ca4631e
8f4eab1
* Tue Oct 10 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-2
8f4eab1
- Reduce memory usage on ARM by disabling debuginfo and some non-ARM targets.
8f4eab1
3d29fda
* Mon Sep 25 2017 Tom Stellard <tstellar@redhat.com> - 5.0.0-1
3d29fda
- 5.0.0 Release
3d29fda
c5c125e
* Mon Sep 18 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-6
c5c125e
- Add Requires: libedit-devel for llvm-devel
c5c125e
dd25586
* Fri Sep 08 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-5
dd25586
- Enable libedit backend for LineEditor API
dd25586
cca2af2
* Fri Aug 25 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-4
cca2af2
- Enable extra functionality when run the LLVM JIT under valgrind.
cca2af2
c263265
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-3
c263265
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
c263265
c28afb5
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 4.0.1-2
c28afb5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
c28afb5
d95c34e
* Wed Jun 21 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
d95c34e
- 4.0.1 Release
d95c34e
383dd27
* Thu Jun 15 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-6
383dd27
- Install llvm utils
383dd27
7a52d8c
* Thu Jun 08 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-5
7a52d8c
- Fix docs-llvm-man target
7a52d8c
4b6a509
* Mon May 01 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
4b6a509
- Make cmake files no longer depend on static libs (rhbz 1388200)
4b6a509
4d11f51
* Tue Apr 18 2017 Josh Stone <jistone@redhat.com> - 4.0.0-3
4d11f51
- Fix computeKnownBits for ARMISD::CMOV (rust-lang/llvm#67)
4d11f51
e6b944d
* Mon Apr 03 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-2
e6b944d
- Simplify spec with rpm macros.
e6b944d
1bbe5ad
* Thu Mar 23 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
1bbe5ad
- LLVM 4.0.0 Final Release
1bbe5ad
05920e6
* Wed Mar 22 2017 tstellar@redhat.com - 3.9.1-6
f4cd5f6
- Fix %%postun sep for -devel package.
05920e6
53af609
* Mon Mar 13 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-5
53af609
- Disable failing tests on ARM.
53af609
146ec0c
* Sun Mar 12 2017 Peter Robinson <pbrobinson@fedoraproject.org> 3.9.1-4
146ec0c
- Fix missing mask on relocation for aarch64 (rhbz 1429050)
146ec0c
9747464
* Wed Mar 01 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-3
9747464
- revert upstream radeonsi breaking change.
9747464
a5fe5a1
* Thu Feb 23 2017 Josh Stone <jistone@redhat.com> - 3.9.1-2
a5fe5a1
- disable sphinx warnings-as-errors
a5fe5a1
Orion Poplawski 6448f2f
* Fri Feb 10 2017 Orion Poplawski <orion@cora.nwra.com> - 3.9.1-1
Orion Poplawski 6448f2f
- llvm 3.9.1
Orion Poplawski 6448f2f
ce8c385
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-8
ce8c385
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
ce8c385
0c3be08
* Tue Nov 29 2016 Josh Stone <jistone@redhat.com> - 3.9.0-7
0c3be08
- Apply backports from rust-lang/llvm#55, #57
0c3be08
ba4dd40
* Tue Nov 01 2016 Dave Airlie 
ba4dd40
- rebuild for new arches
ba4dd40
88bc7e0
* Wed Oct 26 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-5
88bc7e0
- apply the patch from -4
88bc7e0
f943e7f
* Wed Oct 26 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-4
f943e7f
- add fix for lldb out-of-tree build
f943e7f
4488663
* Mon Oct 17 2016 Josh Stone <jistone@redhat.com> - 3.9.0-3
4488663
- Apply backports from rust-lang/llvm#47, #48, #53, #54
4488663
307be8a
* Sat Oct 15 2016 Josh Stone <jistone@redhat.com> - 3.9.0-2
307be8a
- Apply an InstCombine backport via rust-lang/llvm#51
307be8a
894065e
* Wed Sep 07 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-1
894065e
- llvm 3.9.0
894065e
- upstream moved where cmake files are packaged.
894065e
- upstream dropped CppBackend
894065e
2a3c791
* Wed Jul 13 2016 Adam Jackson <ajax@redhat.com> - 3.8.1-1
2a3c791
- llvm 3.8.1
2a3c791
- Add mips target
2a3c791
- Fix some shared library mispackaging
2a3c791
3019f5f
* Tue Jun 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> - 3.8.0-2
3019f5f
- fix color support detection on terminal
3019f5f
8e75711
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
8e75711
- llvm 3.8.0 release
8e75711
c244b9b
* Wed Mar 09 2016 Dan Horák <dan[at][danny.cz> 3.8.0-0.3
c244b9b
- install back memory consumption workaround for s390
c244b9b
861af01
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
861af01
- llvm 3.8.0 rc3 release
861af01
f8d5334
* Fri Feb 19 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.1
f8d5334
- llvm 3.8.0 rc2 release
f8d5334
8b72be4
* Tue Feb 16 2016 Dan Horák <dan[at][danny.cz> 3.7.1-7
8b72be4
- recognize s390 as SystemZ when configuring build
8b72be4
10a1975
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-6
10a1975
- export C++ API for mesa.
10a1975
7a85177
* Sat Feb 13 2016 Dave Airlie <airlied@redhat.com> 3.7.1-5
7a85177
- reintroduce llvm-static, clang needs it currently.
7a85177
933aa47
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
933aa47
- jump back to single llvm library, the split libs aren't working very well.
933aa47
d0a77df
* Fri Feb 05 2016 Dave Airlie <airlied@redhat.com> 3.7.1-3
d0a77df
- add missing obsoletes (#1303497)
d0a77df
4fb79db
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-2
4fb79db
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
4fb79db
ca904f1
* Thu Jan 07 2016 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.1-1
ca904f1
- new upstream release
ca904f1
- enable gold linker
7889508
ca904f1
* Wed Nov 04 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
ca904f1
- fix Requires for subpackages on the main package
Bryan O'Sullivan d291b49
ca904f1
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
ca904f1
- initial version using cmake build system