Blame SPECS/clang.spec

edce02
%global maj_ver 7
edce02
%global min_ver 0
edce02
%global patch_ver 1
edce02
edce02
%global clang_tools_binaries \
edce02
	%{_bindir}/clangd \
edce02
	%{_bindir}/clang-apply-replacements \
edce02
	%{_bindir}/clang-change-namespace \
edce02
	%{_bindir}/clang-include-fixer \
edce02
	%{_bindir}/clang-query \
edce02
	%{_bindir}/clang-refactor \
edce02
	%{_bindir}/clang-reorder-fields \
edce02
	%{_bindir}/clang-rename \
edce02
	%{_bindir}/clang-tidy
edce02
edce02
%global clang_binaries \
edce02
	%{_bindir}/clang \
edce02
	%{_bindir}/clang++ \
edce02
	%{_bindir}/clang-%{maj_ver} \
edce02
	%{_bindir}/clang-check \
edce02
	%{_bindir}/clang-cl \
edce02
	%{_bindir}/clang-cpp \
edce02
	%{_bindir}/clang-format \
edce02
	%{_bindir}/clang-func-mapping \
edce02
	%{_bindir}/clang-import-test \
edce02
	%{_bindir}/clang-offload-bundler \
edce02
	%{_bindir}/diagtool \
edce02
	%{_bindir}/hmaptool
edce02
edce02
%if 0%{?fedora} || 0%{?rhel} > 7
edce02
%bcond_without python3
edce02
%else
edce02
%bcond_with python3
edce02
%endif
edce02
edce02
%ifarch ppc64le
edce02
# Too many threads on 32 core ppc64 systems causes OOM errors.
edce02
%global _smp_mflags -j8
edce02
%endif
edce02
edce02
Name:		clang
edce02
Version:	%{maj_ver}.%{min_ver}.%{patch_ver}
edce02
Release:	1%{?dist}
edce02
Summary:	A C language family front-end for LLVM
edce02
edce02
License:	NCSA
edce02
URL:		http://llvm.org
edce02
Source0:	http://llvm.org/releases/%{version}/cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
edce02
Source1:	http://llvm.org/releases/%{version}/clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src.tar.xz
edce02
edce02
Patch0:		0001-lit.cfg-Add-hack-so-lit-can-find-not-and-FileCheck.patch
edce02
Patch1:		0001-GCC-compatibility-Ignore-fstack-clash-protection.patch
edce02
Patch2:		0001-Driver-Prefer-vendor-supplied-gcc-toolchain.patch
edce02
Patch4:		0001-gtest-reorg.patch
edce02
Patch5:		0001-Don-t-prefer-python2.7.patch
edce02
Patch6:		0001-Convert-clang-format-diff.py-to-python3-using-2to3.patch
edce02
Patch7:		0001-Convert-scan-view-to-python3-using-2to3.patch
edce02
edce02
# clang-tools-extra patches
edce02
Patch100: 0001-Convert-run-find-all-symbols.py-to-python3-using-2to.patch
edce02
edce02
BuildRequires:  gcc
edce02
BuildRequires:  gcc-c++
edce02
BuildRequires:	cmake
edce02
BuildRequires:	llvm-devel = %{version}
edce02
BuildRequires:	libxml2-devel
edce02
# llvm-static is required, because clang-tablegen needs libLLVMTableGen, which
edce02
# is not included in libLLVM.so.
edce02
BuildRequires:  llvm-static = %{version}
edce02
# Required for make check
edce02
BuildRequires:	llvm-googletest = %{version}
edce02
BuildRequires:	libxml2-devel
edce02
BuildRequires:  ncurses-devel
edce02
BuildRequires:	python3-lit
edce02
BuildRequires:	python3-sphinx
edce02
BuildRequires:	libatomic
edce02
BuildRequires:	%{_bindir}/pathfix.py
edce02
BuildRequires:  /usr/bin/python3
edce02
edce02
# Needed for %%multilib_fix_c_header
edce02
BuildRequires:  multilib-rpm-config
edce02
edce02
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
edce02
edce02
%description
edce02
clang: noun
edce02
    1. A loud, resonant, metallic sound.
edce02
    2. The strident call of a crane or goose.
edce02
    3. C-language family front-end toolkit.
edce02
edce02
The goal of the Clang project is to create a new C, C++, Objective C
edce02
and Objective C++ front-end for the LLVM compiler. Its tools are built
edce02
as libraries and designed to be loosely-coupled and extensible.
edce02
edce02
%package libs
edce02
Summary: Runtime library for clang
edce02
Recommends: compiler-rt%{?_isa} >= %{version}
edce02
edce02
# libomp does not support s390x.
edce02
%ifnarch s390x
edce02
Recommends: libomp%{?_isa} >= %{version}
edce02
%endif
edce02
edce02
# clang requires gcc, clang++ requires libstdc++-devel
edce02
# - https://bugzilla.redhat.com/show_bug.cgi?id=1021645
edce02
# - https://bugzilla.redhat.com/show_bug.cgi?id=1158594
edce02
edce02
# Making these BuildRequires because they are needed by tests
edce02
BuildRequires:	libstdc++-devel
edce02
BuildRequires:	gcc-c++
edce02
Requires:	libstdc++-devel
edce02
Requires:	gcc-c++
edce02
edce02
edce02
%description libs
edce02
Runtime library for clang.
edce02
edce02
%package devel
edce02
Summary: Development header files for clang.
edce02
Requires: %{name}%{?_isa} = %{version}-%{release}
edce02
# The clang CMake files reference tools from clang-tools-extra.
edce02
Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release}
edce02
Requires: llvm-libs%{?_isa} = %{version}
edce02
edce02
edce02
%description devel
edce02
Development header files for clang.
edce02
edce02
%package analyzer
edce02
Summary:	A source code analysis framework
edce02
License:	NCSA and MIT
edce02
BuildArch:	noarch
edce02
Requires:	%{name} = %{version}-%{release}
edce02
# not picked up automatically since files are currently not installed in
edce02
# standard Python hierarchies yet
edce02
Requires:	platform-python
edce02
edce02
%description analyzer
edce02
The Clang Static Analyzer consists of both a source code analysis
edce02
framework and a standalone tool that finds bugs in C and Objective-C
edce02
programs. The standalone tool is invoked from the command-line, and is
edce02
intended to run in tandem with a build of a project or code base.
edce02
edce02
%package tools-extra
edce02
Summary: Extra tools for clang
edce02
Requires: llvm-libs%{?_isa} = %{version}
edce02
Requires: clang-libs%{?_isa} = %{version}-%{release}
edce02
edce02
%description tools-extra
edce02
A set of extra tools built using Clang's tooling API.
edce02
edce02
# Put git-clang-format in its own package, because it Requires git and python2
edce02
# and we don't want to force users to install all those dependenices if they
edce02
# just want clang.
edce02
%package -n git-clang-format
edce02
Summary: clang-format integration for git
edce02
Requires: %{name}%{?_isa} = %{version}-%{release}
edce02
Requires: git
edce02
edce02
%description -n git-clang-format
edce02
clang-format integration for git.
edce02
edce02
%prep
edce02
edce02
%setup -T -q -b 1 -n clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src
edce02
edce02
%patch100 -p1 -b .find-all-symbols-py3
edce02
edce02
pathfix.py -i %{__python3} -pn \
edce02
	clang-tidy/tool/*.py \
edce02
	include-fixer/find-all-symbols/tool/run-find-all-symbols.py
edce02
edce02
%setup -q -n cfe-%{version}%{?rc_ver:rc%{rc_ver}}.src
edce02
%patch0 -p1 -b .lit-search-path
edce02
%patch1 -p1 -b .fstack-clash-protection
edce02
%patch2 -p1 -b .vendor-gcc
edce02
%patch4 -p1 -b .gtest
edce02
%patch5 -p1 -b .no-python2
edce02
%patch6 -p1 -b .clang-format-diff-py3
edce02
%patch7 -p1 -b .scan-view-py3
edce02
edce02
mv ../clang-tools-extra-%{version}%{?rc_ver:rc%{rc_ver}}.src tools/extra
edce02
edce02
%if 0%{?__isa_bits} == 64
edce02
sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py
edce02
%else
edce02
sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
edce02
%endif
edce02
edce02
pathfix.py -i %{__python3} -pn \
edce02
	tools/clang-format/*.py \
edce02
	tools/clang-format/git-clang-format \
edce02
	utils/hmaptool/hmaptool \
edce02
	tools/scan-view/bin/scan-view
edce02
edce02
edce02
edce02
%build
edce02
edce02
mkdir -p _build
edce02
cd _build
edce02
edce02
%cmake .. \
edce02
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
edce02
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
edce02
	-DLLVM_CONFIG:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \
edce02
	-DCLANG_INCLUDE_TESTS:BOOL=ON \
edce02
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
edce02
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
edce02
	\
edce02
	-DCLANG_ENABLE_ARCMT:BOOL=ON \
edce02
	-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
edce02
	-DCLANG_INCLUDE_DOCS:BOOL=ON \
edce02
	-DCLANG_PLUGIN_SUPPORT:BOOL=ON \
edce02
	-DENABLE_LINKER_BUILD_ID:BOOL=ON \
edce02
	-DLLVM_ENABLE_EH=ON \
edce02
	-DLLVM_ENABLE_RTTI=ON \
edce02
	-DLLVM_BUILD_DOCS=ON \
edce02
	-DLLVM_ENABLE_SPHINX=ON \
edce02
	-DSPHINX_WARNINGS_AS_ERRORS=OFF \
edce02
	\
edce02
	-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
edce02
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
edce02
%if 0%{?__isa_bits} == 64
edce02
        -DLLVM_LIBDIR_SUFFIX=64 \
edce02
%else
edce02
        -DLLVM_LIBDIR_SUFFIX= \
edce02
%endif
edce02
	-DLIB_SUFFIX=
edce02
edce02
make %{?_smp_mflags}
edce02
edce02
%install
edce02
make install DESTDIR=%{buildroot} -C _build
edce02
edce02
# multilib fix
edce02
%multilib_fix_c_header --file %{_includedir}/clang/Config/config.h
edce02
edce02
# remove editor integrations (bbedit, sublime, emacs, vim)
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-format.el
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-format.py*
edce02
rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
edce02
# clang-tools-extra
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-include-fixer.py
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-tidy-diff.py
edce02
rm -vf %{buildroot}%{_datadir}/clang/run-clang-tidy.py
edce02
rm -vf %{buildroot}%{_datadir}/clang/run-find-all-symbols.py
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-include-fixer.el
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-rename.el
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-rename.py
edce02
# remove diff reformatter
edce02
rm -vf %{buildroot}%{_datadir}/clang/clang-format-diff.py*
edce02
edce02
# Remove html docs
edce02
rm -vRf %{buildroot}%{_docdir}/clang/html
edce02
edce02
%check
edce02
cd _build
edce02
PATH=%{_libdir}/llvm:$PATH make %{?_smp_mflags} check-all
edce02
edce02
%files libs
edce02
%{_libdir}/*.so.*
edce02
%{_libdir}/*.so
edce02
edce02
%files
edce02
%{_libdir}/clang/
edce02
%{clang_binaries}
edce02
%{_bindir}/c-index-test
edce02
%{_mandir}/man1/clang.1.gz
edce02
%{_mandir}/man1/diagtool.1.gz
edce02
edce02
edce02
%files devel
edce02
%{_includedir}/clang/
edce02
%{_includedir}/clang-c/
edce02
%{_libdir}/cmake/
edce02
%dir %{_datadir}/clang/
edce02
edce02
%files analyzer
edce02
%{_bindir}/scan-view
edce02
%{_bindir}/scan-build
edce02
%{_libexecdir}/ccc-analyzer
edce02
%{_libexecdir}/c++-analyzer
edce02
%{_datadir}/scan-view/
edce02
%{_datadir}/scan-build/
edce02
%{_mandir}/man1/scan-build.1.*
edce02
edce02
%files tools-extra
edce02
%{clang_tools_binaries}
edce02
%{_bindir}/find-all-symbols
edce02
%{_bindir}/modularize
edce02
edce02
%files -n git-clang-format
edce02
%{_bindir}/git-clang-format
edce02
edce02
%changelog
edce02
* Fri Dec 14 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
edce02
- 7.0.1-1 Release
edce02
edce02
* Mon Dec 10 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.1.rc3
edce02
- 7.0.1-rc3 Release
edce02
edce02
* Mon Nov 05 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-12
edce02
- User helper macro to fixup config.h for multilib
edce02
edce02
* Sat Oct 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-11
edce02
- Enable make check
edce02
edce02
* Mon Oct 15 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-10
edce02
- Remove Provides: llvm-toolset-6.0-clang-libs
edce02
edce02
* Fri Oct 12 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-9
edce02
- Add Provides: llvm-toolset-6.0-clang-libs
edce02
edce02
* Tue Oct 02 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-8
edce02
- Don't use python2 for the build
edce02
edce02
* Mon Oct 01 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-7
edce02
- Drop scl macros
edce02
edce02
* Tue Sep 25 2018 Tomas Orsava <torsava@redhat.com> - 6.0.1-6
edce02
- Change Requires from python3 to platform-python
edce02
- The python3 package was renamed to platform-python
edce02
- Related: rhbz#1619153
edce02
edce02
* Fri Sep 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-5
edce02
- Use python3 for git-clang-format
edce02
edce02
* Thu Sep 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-4
edce02
- Fix python dependencies
edce02
edce02
* Tue Aug 07 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-3
edce02
- Install ld.so.conf file in the root filesystem
edce02
edce02
* Thu Aug 02 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
edce02
- Remove annobin work-around
edce02
edce02
* Wed Jul 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
edce02
- 6.0.1 Release
edce02
edce02
* Wed Apr 11 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-7
edce02
- Add conditionals to enable building only the clang-libs package
edce02
edce02
* Fri Apr 06 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-6
edce02
- Use cmake from base RHEL
edce02
edce02
* Mon Mar 19 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-5
edce02
- Backport r310435 from clang trunk. rhbz#1558223
edce02
edce02
* Mon Mar 19 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-4
edce02
- Use system gcc instead of dts.
edce02
edce02
* Tue Feb 06 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-3
edce02
- Backport retpoline support
edce02
edce02
* Sat Jan 20 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-2
edce02
- Limit number of build threads on ppc64le to avoid OOM errors
edce02
edce02
* Tue Jan 09 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
edce02
- 5.0.1 Release
edce02
edce02
* Wed Jun 21 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
edce02
- 4.0.1 Release.
edce02
edce02
* Wed Jun 21 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-15
edce02
- Fix Requires for clang-tools-extra
edce02
edce02
* Wed Jun 21 2017 Tom Stellard 
edce02
- Fix Requires for clang-tools-extra
edce02
edce02
* Tue Jun 20 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-13
edce02
- Drop libomp dependency on s390x
edce02
edce02
* Thu Jun 15 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-12
edce02
- Use libstdc++ from devtoolset-7
edce02
edce02
* Wed Jun 07 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-11
edce02
- Fix libomp requires
edce02
edce02
* Wed Jun 07 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-10
edce02
- Build for llvm-toolset-7 rename
edce02
edce02
* Tue May 30 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-9
edce02
- Use ld from devtoolset in clang toolchain
edce02
edce02
* Mon May 29 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-8
edce02
- Add dependency on libopenmp
edce02
edce02
* Thu May 25 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-7
edce02
- Fix check for gcc install
edce02
edce02
* Wed May 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-6
edce02
- Add devtoolset-6 dependency for newer libstdc++
edce02
edce02
* Fri May 12 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-5
edce02
- Add dependency on compiler-rt
edce02
edce02
* Tue May 02 2017 Tom Stellard <tstellar@redhat.com>
edce02
- Fix dependencies with scl
edce02
edce02
* Mon May 01 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
edce02
- Build with llvm-toolset-4
edce02
edce02
* Mon Mar 27 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
edce02
- Enable eh/rtti, which are required by lldb.
edce02
edce02
* Fri Mar 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-2
edce02
- Fix clang-tools-extra build
edce02
- Fix install
edce02
edce02
* Thu Mar 23 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
edce02
- clang 4.0.0 final release
edce02
edce02
* Mon Mar 20 2017 David Goerger <david.goerger@yale.edu> - 3.9.1-3
edce02
- add clang-tools-extra rhbz#1328091
edce02
edce02
* Thu Mar 16 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-2
edce02
- Enable build-id by default rhbz#1432403
edce02
edce02
* Thu Mar 02 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-1
edce02
- clang 3.9.1 final release
edce02
edce02
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-4
edce02
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
edce02
edce02
* Mon Nov 14 2016 Nathaniel McCallum <npmccallum@redhat.com> - 3.9.0-3
edce02
- Add Requires: compiler-rt to clang-libs.
edce02
- Without this, compiling with certain CFLAGS breaks.
edce02
edce02
* Tue Nov  1 2016 Peter Robinson <pbrobinson@fedoraproject.org> 3.9.0-2
edce02
- Rebuild for new arches
edce02
edce02
* Fri Oct 14 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-1
edce02
- clang 3.9.0 final release
edce02
edce02
* Fri Jul 01 2016 Stephan Bergmann <sbergman@redhat.com> - 3.8.0-2
edce02
- Resolves: rhbz#1282645 add GCC abi_tag support
edce02
edce02
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
edce02
- clang 3.8.0 final release
edce02
edce02
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.4
edce02
- clang 3.8.0rc3
edce02
edce02
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.3
edce02
- package all libs into clang-libs.
edce02
edce02
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
edce02
- enable dynamic linking of clang against llvm
edce02
edce02
* Thu Feb 18 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.1
edce02
- clang 3.8.0rc2
edce02
edce02
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
edce02
- rebuild against latest llvm packages
edce02
- add BuildRequires llvm-static
edce02
edce02
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-3
edce02
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
edce02
edce02
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-2
edce02
- just accept clang includes moving to /usr/lib64, upstream don't let much else happen
edce02
edce02
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-1
edce02
- initial build in Fedora.
edce02
edce02
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
edce02
- initial version using cmake build system