Blame SPECS/clang.spec

afdec7
%bcond_with compat_build
afdec7
%bcond_without check
f28a49
d4a856
%global maj_ver 14
fd1acb
%global min_ver 0
d4a856
%global patch_ver 6
afdec7
#global rc_ver 4
afdec7
%global clang_version %{maj_ver}.%{min_ver}.%{patch_ver}
fd1acb
afdec7
%if %{with compat_build}
300695
%global pkg_name clang%{maj_ver}
f28a49
# Install clang to same prefix as llvm, so that apps that use llvm-config
f28a49
# will also be able to find clang libs.
300695
%global install_prefix %{_libdir}/llvm%{maj_ver}
f28a49
%global install_bindir %{install_prefix}/bin
f28a49
%global install_includedir %{install_prefix}/include
f28a49
%global install_libdir %{install_prefix}/lib
f28a49
f28a49
%global pkg_bindir %{install_bindir}
300695
%global pkg_includedir %{install_includedir}
f28a49
%global pkg_libdir %{install_libdir}
f28a49
%else
fd1acb
%global pkg_name clang
fd1acb
%global install_prefix /usr
300695
%global pkg_libdir %{_libdir}
f28a49
%endif
fd1acb
afdec7
%global build_install_prefix %{buildroot}%{install_prefix}
afdec7
afdec7
%ifarch ppc64le aarch64
afdec7
# Too many threads on some systems causes OOM errors.
afdec7
%global _smp_mflags -j8
afdec7
%endif
afdec7
afdec7
%global clang_srcdir clang-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
afdec7
%global clang_tools_srcdir clang-tools-extra-%{clang_version}%{?rc_ver:rc%{rc_ver}}.src
afdec7
afdec7
%if !%{maj_ver} && 0%{?rc_ver}
afdec7
%global abi_revision 2
afdec7
%endif
afdec7
fd1acb
Name:		%pkg_name
d4a856
Version:	%{clang_version}%{?rc_ver:~rc%{rc_ver}}
300695
Release:	1%{?dist}
fd1acb
Summary:	A C language family front-end for LLVM
fd1acb
fd1acb
License:	NCSA
fd1acb
URL:		http://llvm.org
afdec7
Source0:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz
afdec7
Source3:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_srcdir}.tar.xz.sig
afdec7
%if %{without compat_build}
afdec7
Source1:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz
afdec7
Source2:	https://github.com/llvm/llvm-project/releases/download/llvmorg-%{clang_version}%{?rc_ver:-rc%{rc_ver}}/%{clang_tools_srcdir}.tar.xz.sig
c558f2
%endif
300695
Source4:	tstellar-gpg-key.asc
afdec7
%if !0%{?compat_build}
afdec7
Source5:	macros.%{name}
afdec7
%endif
fd1acb
300695
# Patches for clang
300695
Patch0:     0001-PATCH-clang-Reorganize-gtest-integration.patch
300695
Patch1:     0002-PATCH-clang-Make-funwind-tables-the-default-on-all-a.patch
300695
Patch2:     0003-PATCH-clang-Don-t-install-static-libraries.patch
afdec7
Patch3:     0001-Driver-Add-a-gcc-equivalent-triple-to-the-list-of-tr.patch
afdec7
Patch4:     0001-cmake-Allow-shared-libraries-to-customize-the-soname.patch
d4a856
# This patch can be dropped once gcc-12.0.1-0.5.fc36 is in the repo.
d4a856
Patch5:     0001-Work-around-gcc-miscompile.patch
d4a856
Patch7:     0010-PATCH-clang-Produce-DWARF4-by-default.patch
d4a856
Patch8:     disable-recommonmark.patch
afdec7
c558f2
300695
# Patches for clang-tools-extra
d4a856
%if %{without compat_build}
d4a856
Patch201:   clangd-tests.patch
d4a856
Patch202:   llvm-hello.patch
d4a856
Patch203:   remove-test.patch
300695
%endif
fd1acb
fd1acb
BuildRequires:	gcc
fd1acb
BuildRequires:	gcc-c++
fd1acb
BuildRequires:	cmake
fd1acb
BuildRequires:	ninja-build
afdec7
%if %{with compat_build}
300695
BuildRequires:	llvm%{maj_ver}-devel = %{version}
300695
BuildRequires:	llvm%{maj_ver}-static = %{version}
f28a49
%else
fd1acb
BuildRequires:	llvm-devel = %{version}
fd1acb
BuildRequires:	llvm-test = %{version}
f28a49
# llvm-static is required, because clang-tablegen needs libLLVMTableGen, which
f28a49
# is not included in libLLVM.so.
f28a49
BuildRequires:	llvm-static = %{version}
300695
BuildRequires:	llvm-googletest = %{version}
f28a49
%endif
f28a49
fd1acb
BuildRequires:	libxml2-devel
fd1acb
BuildRequires:	perl-generators
fd1acb
BuildRequires:	ncurses-devel
fd1acb
# According to https://fedoraproject.org/wiki/Packaging:Emacs a package
fd1acb
# should BuildRequires: emacs if it packages emacs integration files.
fd1acb
BuildRequires:	emacs
fd1acb
fd1acb
# The testsuite uses /usr/bin/lit which is part of the python3-lit package.
fd1acb
BuildRequires:	python3-lit
fd1acb
fd1acb
BuildRequires:	python3-sphinx
d4a856
BuildRequires:	pandoc
fd1acb
BuildRequires:	libatomic
fd1acb
d4a856
# We need python3-devel for %%py3_shebang_fix
fd1acb
BuildRequires:	python3-devel
fd1acb
300695
%if ! 0%{?rhel}
300695
# For reproducible pyc file generation
300695
# See https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
300695
BuildRequires: /usr/bin/marshalparser
300695
%global py_reproducible_pyc_path %{buildroot}%{python3_sitelib}
300695
%endif
300695
fd1acb
# Needed for %%multilib_fix_c_header
fd1acb
BuildRequires:	multilib-rpm-config
1ca1ea
d4a856
# For origin certification
d4a856
BuildRequires:	gnupg2
d4a856
1ca1ea
# scan-build uses these perl modules so they need to be installed in order
1ca1ea
# to run the tests.
1ca1ea
BuildRequires: perl(Digest::MD5)
1ca1ea
BuildRequires: perl(File::Copy)
1ca1ea
BuildRequires: perl(File::Find)
1ca1ea
BuildRequires: perl(File::Path)
1ca1ea
BuildRequires: perl(File::Temp)
1ca1ea
BuildRequires: perl(FindBin)
1ca1ea
BuildRequires: perl(Hash::Util)
1ca1ea
BuildRequires: perl(lib)
1ca1ea
BuildRequires: perl(Term::ANSIColor)
1ca1ea
BuildRequires: perl(Text::ParseWords)
1ca1ea
BuildRequires: perl(Sys::Hostname)
fd1acb
fd1acb
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
fd1acb
fd1acb
# clang requires gcc, clang++ requires libstdc++-devel
fd1acb
# - https://bugzilla.redhat.com/show_bug.cgi?id=1021645
fd1acb
# - https://bugzilla.redhat.com/show_bug.cgi?id=1158594
fd1acb
Requires:	libstdc++-devel
fd1acb
Requires:	gcc-c++
fd1acb
fd1acb
Provides:	clang(major) = %{maj_ver}
fd1acb
d4a856
Conflicts:	compiler-rt < 11.0.0
c558f2
fd1acb
%description
fd1acb
clang: noun
fd1acb
    1. A loud, resonant, metallic sound.
fd1acb
    2. The strident call of a crane or goose.
fd1acb
    3. C-language family front-end toolkit.
fd1acb
fd1acb
The goal of the Clang project is to create a new C, C++, Objective C
fd1acb
and Objective C++ front-end for the LLVM compiler. Its tools are built
fd1acb
as libraries and designed to be loosely-coupled and extensible.
fd1acb
300695
Install compiler-rt if you want the Blocks C language extension or to
300695
enable sanitization and profiling options when building, and
300695
libomp-devel to enable -fopenmp.
300695
fd1acb
%package libs
fd1acb
Summary: Runtime library for clang
300695
Requires: %{name}-resource-filesystem%{?_isa} = %{version}
d4a856
# RHEL specific: Use libstdc++ from gcc12 by default. rhbz#2064507
d4a856
Requires: gcc-toolset-12-gcc-c++
fd1acb
Recommends: compiler-rt%{?_isa} = %{version}
c558f2
# libomp-devel is required, so clang can find the omp.h header when compiling
c558f2
# with -fopenmp.
c558f2
Recommends: libomp-devel%{_isa} = %{version}
fd1acb
Recommends: libomp%{_isa} = %{version}
fd1acb
d4a856
# Use lld as the default linker on ARM due to rhbz#1918924
d4a856
%ifarch %{arm}
d4a856
Requires: lld
d4a856
%endif
d4a856
fd1acb
%description libs
fd1acb
Runtime library for clang.
fd1acb
fd1acb
%package devel
fd1acb
Summary: Development header files for clang
afdec7
%if %{without compat_build}
fd1acb
Requires: %{name}%{?_isa} = %{version}-%{release}
fd1acb
# The clang CMake files reference tools from clang-tools-extra.
fd1acb
Requires: %{name}-tools-extra%{?_isa} = %{version}-%{release}
f28a49
Requires: %{name}-libs = %{version}-%{release}
c558f2
%endif
fd1acb
fd1acb
%description devel
fd1acb
Development header files for clang.
fd1acb
300695
%package resource-filesystem
300695
Summary: Filesystem package that owns the clang resource directory
300695
Provides: %{name}-resource-filesystem(major) = %{maj_ver}
300695
300695
%description resource-filesystem
300695
This package owns the clang resouce directory: $libdir/clang/$version/
300695
afdec7
%if %{without compat_build}
fd1acb
%package analyzer
fd1acb
Summary:	A source code analysis framework
fd1acb
License:	NCSA and MIT
fd1acb
BuildArch:	noarch
fd1acb
Requires:	%{name} = %{version}-%{release}
fd1acb
fd1acb
%description analyzer
fd1acb
The Clang Static Analyzer consists of both a source code analysis
fd1acb
framework and a standalone tool that finds bugs in C and Objective-C
fd1acb
programs. The standalone tool is invoked from the command-line, and is
fd1acb
intended to run in tandem with a build of a project or code base.
fd1acb
fd1acb
%package tools-extra
fd1acb
Summary:	Extra tools for clang
fd1acb
Requires:	%{name}-libs%{?_isa} = %{version}-%{release}
fd1acb
Requires:	emacs-filesystem
fd1acb
fd1acb
%description tools-extra
fd1acb
A set of extra tools built using Clang's tooling API.
fd1acb
fd1acb
# Put git-clang-format in its own package, because it Requires git
fd1acb
# and we don't want to force users to install all those dependenices if they
fd1acb
# just want clang.
fd1acb
%package -n git-clang-format
fd1acb
Summary:	Integration of clang-format for git
c558f2
Requires:	%{name}-tools-extra = %{version}-%{release}
fd1acb
Requires:	git
fd1acb
Requires:	python3
fd1acb
fd1acb
%description -n git-clang-format
fd1acb
clang-format integration for git.
fd1acb
c558f2
fd1acb
%package -n python3-clang
fd1acb
Summary:       Python3 bindings for clang
fd1acb
Requires:      %{name}-libs%{?_isa} = %{version}-%{release}
fd1acb
Requires:      python3
fd1acb
%description -n python3-clang
fd1acb
%{summary}.
fd1acb
fd1acb
f28a49
%endif
fd1acb
fd1acb
fd1acb
%prep
d4a856
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE3}' --data='%{SOURCE0}'
d4a856
afdec7
%if %{with compat_build}
300695
%autosetup -n %{clang_srcdir} -p2
f28a49
%else
d4a856
d4a856
%{gpgverify} --keyring='%{SOURCE4}' --signature='%{SOURCE2}' --data='%{SOURCE1}'
f28a49
%setup -T -q -b 1 -n %{clang_tools_srcdir}
300695
%autopatch -m200 -p2
f28a49
d4a856
d4a856
# This test is broken upstream. It is a clang-tidy unittest
d4a856
# that includes a file from clang, breaking standalone builds.
d4a856
# https://github.com/llvm/llvm-project/issues/54116
d4a856
rm unittests/clang-tidy/ReadabilityModuleTest.cpp
d4a856
300695
# failing test case
300695
rm test/clang-tidy/checkers/altera-struct-pack-align.cpp
fd1acb
d4a856
%py3_shebang_fix \
d4a856
	clang-tidy/tool/run-clang-tidy.py \
d4a856
	clang-tidy/tool/clang-tidy-diff.py \
f28a49
	clang-include-fixer/find-all-symbols/tool/run-find-all-symbols.py
fd1acb
d4a856
f28a49
%setup -q -n %{clang_srcdir}
300695
%autopatch -M200 -p2
fd1acb
300695
# failing test case
300695
rm test/CodeGen/profile-filter.c
fd1acb
d4a856
%py3_shebang_fix \
d4a856
	tools/clang-format/ \
fd1acb
	tools/clang-format/git-clang-format \
fd1acb
	utils/hmaptool/hmaptool \
afdec7
	tools/scan-view/bin/scan-view \
d4a856
	tools/scan-view/share/Reporter.py \
d4a856
	tools/scan-view/share/startfile.py \
afdec7
	tools/scan-build-py/bin/* \
afdec7
	tools/scan-build-py/libexec/*
d4a856
d4a856
# Convert markdown files to rst to cope with the absence of compatible md parser in rhel.
d4a856
# The sed expression takes care of a slight difference between pandoc markdown and sphinx markdown.
d4a856
find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst  ; done
d4a856
f28a49
%endif
fd1acb
fd1acb
%build
300695
# We run the builders out of memory on armv7 and i686 when LTO is enabled
300695
%ifarch %{arm} i686
300695
%define _lto_cflags %{nil}
300695
%else
300695
# This package does not ship any object files or static libraries, so we
300695
# don't need -ffat-lto-objects.
300695
%global _lto_cflags %(echo %{_lto_cflags} | sed 's/-ffat-lto-objects//')
300695
%endif
300695
300695
# lto builds with gcc 11 fail while running the lit tests.
300695
%define _lto_cflags %{nil}
300695
f28a49
%if 0%{?__isa_bits} == 64
f28a49
sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@/64/g' test/lit.cfg.py
f28a49
%else
f28a49
sed -i 's/\@FEDORA_LLVM_LIB_SUFFIX\@//g' test/lit.cfg.py
f28a49
%endif
f28a49
300695
mkdir -p %{_vpath_builddir}
300695
cd %{_vpath_builddir}
fd1acb
d4a856
%ifarch s390 s390x %{arm} %ix86 ppc64le aarch64
fd1acb
# Decrease debuginfo verbosity to reduce memory consumption during final library linking
fd1acb
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
fd1acb
%endif
fd1acb
d4a856
d4a856
%set_build_flags
d4a856
CXXFLAGS="$CXXFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized"
d4a856
CFLAGS="$CFLAGS -Wno-address -Wno-nonnull -Wno-maybe-uninitialized"
d4a856
d4a856
# -DLLVM_ENABLE_NEW_PASS_MANAGER=ON can be removed once this patch is committed:
d4a856
# https://reviews.llvm.org/D107628
fd1acb
%cmake .. -G Ninja \
fd1acb
	-DLLVM_PARALLEL_LINK_JOBS=1 \
fd1acb
	-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
fd1acb
	-DCMAKE_BUILD_TYPE=RelWithDebInfo \
fd1acb
	-DPYTHON_EXECUTABLE=%{__python3} \
d4a856
	-DCMAKE_SKIP_RPATH:BOOL=ON \
d4a856
%ifarch s390 s390x %{arm} %ix86 ppc64le aarch64
c558f2
	-DCMAKE_C_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
c558f2
	-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="%{optflags} -DNDEBUG" \
f28a49
%endif
afdec7
%if %{with compat_build}
300695
	-DCLANG_BUILD_TOOLS:BOOL=OFF \
d4a856
	-DLLVM_CONFIG:FILEPATH=%{pkg_bindir}/llvm-config-%{maj_ver}-%{__isa_bits} \
f28a49
	-DCMAKE_INSTALL_PREFIX=%{install_prefix} \
f28a49
	-DCLANG_INCLUDE_TESTS:BOOL=OFF \
f28a49
%else
fd1acb
	-DCLANG_INCLUDE_TESTS:BOOL=ON \
300695
	-DLLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=../../%{clang_tools_srcdir} \
fd1acb
	-DLLVM_EXTERNAL_LIT=%{_bindir}/lit \
fd1acb
	-DLLVM_MAIN_SRC_DIR=%{_datadir}/llvm/src \
fd1acb
%if 0%{?__isa_bits} == 64
fd1acb
	-DLLVM_LIBDIR_SUFFIX=64 \
fd1acb
%else
fd1acb
	-DLLVM_LIBDIR_SUFFIX= \
fd1acb
%endif
f28a49
%endif
fd1acb
	\
afdec7
%if %{with compat_build}
300695
	-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen-%{maj_ver} \
f28a49
%else
300695
	-DLLVM_TABLEGEN_EXE:FILEPATH=%{_bindir}/llvm-tblgen \
f28a49
%endif
fd1acb
	-DCLANG_ENABLE_ARCMT:BOOL=ON \
fd1acb
	-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=ON \
fd1acb
	-DCLANG_INCLUDE_DOCS:BOOL=ON \
fd1acb
	-DCLANG_PLUGIN_SUPPORT:BOOL=ON \
fd1acb
	-DENABLE_LINKER_BUILD_ID:BOOL=ON \
fd1acb
	-DLLVM_ENABLE_EH=ON \
fd1acb
	-DLLVM_ENABLE_RTTI=ON \
fd1acb
	-DLLVM_BUILD_DOCS=ON \
afdec7
	-DLLVM_ENABLE_NEW_PASS_MANAGER=ON \
fd1acb
	-DLLVM_ENABLE_SPHINX=ON \
c558f2
	-DCLANG_LINK_CLANG_DYLIB=ON \
afdec7
	%{?abi_revision:-DLLVM_ABI_REVISION=%{abi_revision}} \
fd1acb
	-DSPHINX_WARNINGS_AS_ERRORS=OFF \
fd1acb
	\
fd1acb
	-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
c558f2
	-DBUILD_SHARED_LIBS=OFF \
300695
	-DCLANG_REPOSITORY_STRING="%{?fedora:Fedora}%{?rhel:Red Hat} %{version}-%{release}" \
d4a856
%ifarch %{arm}
d4a856
	-DCLANG_DEFAULT_LINKER=lld \
d4a856
%endif
d4a856
	-DCLANG_DEFAULT_UNWINDLIB=libgcc \
d4a856
	-DGCC_INSTALL_PREFIX=/opt/rh/gcc-toolset-12/root/usr
fd1acb
300695
%cmake_build
fd1acb
fd1acb
%install
300695
300695
pushd %{_vpath_builddir}
300695
%cmake_install
300695
popd
fd1acb
afdec7
%if %{with compat_build}
f28a49
f28a49
# Remove binaries/other files
f28a49
rm -Rf %{buildroot}%{install_bindir}
f28a49
rm -Rf %{buildroot}%{install_prefix}/share
f28a49
rm -Rf %{buildroot}%{install_prefix}/libexec
d4a856
# Remove scanview-py helper libs
d4a856
rm -Rf %{buildroot}%{install_prefix}/lib/{libear,libscanbuild}
f28a49
f28a49
%else
fd1acb
afdec7
# File in the macros file for other packages to use.  We are not doing this
afdec7
# in the compat package, because the version macros would # conflict with
afdec7
# eachother if both clang and the clang compat package were installed together.
afdec7
install -p -m0644 -D %{SOURCE5} %{buildroot}%{_rpmmacrodir}/macros.%{name}
afdec7
sed -i -e "s|@@CLANG_MAJOR_VERSION@@|%{maj_ver}|" \
afdec7
       -e "s|@@CLANG_MINOR_VERSION@@|%{min_ver}|" \
afdec7
       -e "s|@@CLANG_PATCH_VERSION@@|%{patch_ver}|" \
afdec7
       %{buildroot}%{_rpmmacrodir}/macros.%{name}
afdec7
fd1acb
# install clang python bindings
fd1acb
mkdir -p %{buildroot}%{python3_sitelib}/clang/
fd1acb
install -p -m644 bindings/python/clang/* %{buildroot}%{python3_sitelib}/clang/
fd1acb
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/clang
fd1acb
afdec7
# install scanbuild-py to python sitelib.
afdec7
mv %{buildroot}%{_prefix}/lib/{libear,libscanbuild} %{buildroot}%{python3_sitelib}
afdec7
%py_byte_compile %{__python3} %{buildroot}%{python3_sitelib}/{libear,libscanbuild}
afdec7
d4a856
# Fix permissions of scan-view scripts
d4a856
chmod a+x %{buildroot}%{_datadir}/scan-view/{Reporter.py,startfile.py}
d4a856
fd1acb
# multilib fix
fd1acb
%multilib_fix_c_header --file %{_includedir}/clang/Config/config.h
fd1acb
fd1acb
# Move emacs integration files to the correct directory
fd1acb
mkdir -p %{buildroot}%{_emacs_sitestartdir}
fd1acb
for f in clang-format.el clang-rename.el clang-include-fixer.el; do
fd1acb
mv %{buildroot}{%{_datadir}/clang,%{_emacs_sitestartdir}}/$f
fd1acb
done
fd1acb
fd1acb
# remove editor integrations (bbedit, sublime, emacs, vim)
fd1acb
rm -vf %{buildroot}%{_datadir}/clang/clang-format-bbedit.applescript
fd1acb
rm -vf %{buildroot}%{_datadir}/clang/clang-format-sublime.py*
fd1acb
fd1acb
# TODO: Package html docs
d4a856
rm -Rvf %{buildroot}%{_docdir}/Clang/clang/html
300695
rm -Rvf %{buildroot}%{_datadir}/clang/clang-doc-default-stylesheet.css
300695
rm -Rvf %{buildroot}%{_datadir}/clang/index.js
fd1acb
fd1acb
# TODO: What are the Fedora guidelines for packaging bash autocomplete files?
fd1acb
rm -vf %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
fd1acb
fd1acb
# Create Manpage symlinks
fd1acb
ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++.1.gz
fd1acb
ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang-%{maj_ver}.1.gz
fd1acb
ln -s clang.1.gz %{buildroot}%{_mandir}/man1/clang++-%{maj_ver}.1.gz
fd1acb
f28a49
# Add clang++-{version} symlink
fd1acb
ln -s clang++ %{buildroot}%{_bindir}/clang++-%{maj_ver}
fd1acb
fd1acb
fd1acb
# Fix permission
fd1acb
chmod u-x %{buildroot}%{_mandir}/man1/scan-build.1*
fd1acb
1ca1ea
# create a link to clang's resource directory that is "constant" across minor
1ca1ea
# version bumps
1ca1ea
# this is required for packages like ccls that hardcode the link to clang's
1ca1ea
# resource directory to not require rebuilds on minor version bumps
1ca1ea
# Fix for bugs like rhbz#1807574
1ca1ea
pushd %{buildroot}%{_libdir}/clang/
1ca1ea
ln -s %{version} %{maj_ver}
1ca1ea
popd
1ca1ea
afdec7
%endif
afdec7
300695
# Create sub-directories in the clang resource directory that will be
300695
# populated by other packages
afdec7
mkdir -p %{buildroot}%{pkg_libdir}/clang/%{version}/{include,lib,share}/
300695
fd1acb
1ca1ea
# Remove clang-tidy headers.  We don't ship the libraries for these.
1ca1ea
rm -Rvf %{buildroot}%{_includedir}/clang-tidy/
1ca1ea
afdec7
%if %{without compat_build}
300695
# Add a symlink in /usr/bin to clang-format-diff
300695
ln -s %{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff
afdec7
%endif
300695
fd1acb
%check
afdec7
%if %{without compat_build}
afdec7
%if %{with check}
fd1acb
# requires lit.py from LLVM utilities
300695
# FIXME: Fix failing ARM tests
d4a856
LD_LIBRARY_PATH=%{buildroot}/%{_libdir} %{__ninja} check-all -C %{_vpath_builddir} || \
300695
%ifarch %{arm}
f28a49
:
f28a49
%else
300695
false
fd1acb
%endif
d4a856
%endif
f28a49
%endif
fd1acb
fd1acb
afdec7
%if %{without compat_build}
fd1acb
%files
1ca1ea
%license LICENSE.TXT
d4a856
%{_bindir}/clang
d4a856
%{_bindir}/clang++
d4a856
%{_bindir}/clang-%{maj_ver}
d4a856
%{_bindir}/clang++-%{maj_ver}
d4a856
%{_bindir}/clang-cl
d4a856
%{_bindir}/clang-cpp
fd1acb
%{_mandir}/man1/clang.1.gz
fd1acb
%{_mandir}/man1/clang++.1.gz
fd1acb
%{_mandir}/man1/clang-%{maj_ver}.1.gz
fd1acb
%{_mandir}/man1/clang++-%{maj_ver}.1.gz
f28a49
%endif
fd1acb
fd1acb
%files libs
afdec7
%if %{without compat_build}
fd1acb
%{_libdir}/clang/
fd1acb
%{_libdir}/*.so.*
f28a49
%else
f28a49
%{pkg_libdir}/*.so.*
f28a49
%{pkg_libdir}/clang/%{version}
f28a49
%endif
fd1acb
fd1acb
%files devel
afdec7
%if %{without compat_build}
fd1acb
%{_libdir}/*.so
fd1acb
%{_includedir}/clang/
fd1acb
%{_includedir}/clang-c/
fd1acb
%{_libdir}/cmake/*
fd1acb
%dir %{_datadir}/clang/
afdec7
%{_rpmmacrodir}/macros.%{name}
f28a49
%else
f28a49
%{pkg_libdir}/*.so
f28a49
%{pkg_includedir}/clang/
f28a49
%{pkg_includedir}/clang-c/
f28a49
%{pkg_libdir}/cmake/
f28a49
%endif
fd1acb
300695
%files resource-filesystem
300695
%dir %{pkg_libdir}/clang/%{version}/
300695
%dir %{pkg_libdir}/clang/%{version}/include/
300695
%dir %{pkg_libdir}/clang/%{version}/lib/
300695
%dir %{pkg_libdir}/clang/%{version}/share/
afdec7
%if %{without compat_build}
300695
%{pkg_libdir}/clang/%{maj_ver}
300695
%endif
300695
afdec7
%if %{without compat_build}
fd1acb
%files analyzer
fd1acb
%{_bindir}/scan-view
fd1acb
%{_bindir}/scan-build
afdec7
%{_bindir}/analyze-build
afdec7
%{_bindir}/intercept-build
afdec7
%{_bindir}/scan-build-py
fd1acb
%{_libexecdir}/ccc-analyzer
fd1acb
%{_libexecdir}/c++-analyzer
afdec7
%{_libexecdir}/analyze-c++
afdec7
%{_libexecdir}/analyze-cc
afdec7
%{_libexecdir}/intercept-c++
afdec7
%{_libexecdir}/intercept-cc
fd1acb
%{_datadir}/scan-view/
fd1acb
%{_datadir}/scan-build/
fd1acb
%{_mandir}/man1/scan-build.1.*
afdec7
%{python3_sitelib}/libear
afdec7
%{python3_sitelib}/libscanbuild
fd1acb
d4a856
fd1acb
%files tools-extra
d4a856
%{_bindir}/clang-apply-replacements
d4a856
%{_bindir}/clang-change-namespace
d4a856
%{_bindir}/clang-check
d4a856
%{_bindir}/clang-doc
d4a856
%{_bindir}/clang-extdef-mapping
d4a856
%{_bindir}/clang-format
d4a856
%{_bindir}/clang-include-fixer
d4a856
%{_bindir}/clang-move
d4a856
%{_bindir}/clang-offload-bundler
d4a856
%{_bindir}/clang-offload-wrapper
d4a856
%{_bindir}/clang-linker-wrapper
d4a856
%{_bindir}/clang-nvlink-wrapper
d4a856
%{_bindir}/clang-query
d4a856
%{_bindir}/clang-refactor
d4a856
%{_bindir}/clang-rename
d4a856
%{_bindir}/clang-reorder-fields
d4a856
%{_bindir}/clang-repl
d4a856
%{_bindir}/clang-scan-deps
d4a856
%{_bindir}/clang-tidy
d4a856
%{_bindir}/clangd
d4a856
%{_bindir}/diagtool
d4a856
%{_bindir}/hmaptool
d4a856
%{_bindir}/pp-trace
c558f2
%{_bindir}/c-index-test
fd1acb
%{_bindir}/find-all-symbols
fd1acb
%{_bindir}/modularize
300695
%{_bindir}/clang-format-diff
c558f2
%{_mandir}/man1/diagtool.1.gz
c558f2
%{_emacs_sitestartdir}/clang-format.el
fd1acb
%{_emacs_sitestartdir}/clang-rename.el
fd1acb
%{_emacs_sitestartdir}/clang-include-fixer.el
c558f2
%{_datadir}/clang/clang-format.py*
c558f2
%{_datadir}/clang/clang-format-diff.py*
fd1acb
%{_datadir}/clang/clang-include-fixer.py*
fd1acb
%{_datadir}/clang/clang-tidy-diff.py*
afdec7
%{_bindir}/run-clang-tidy
fd1acb
%{_datadir}/clang/run-find-all-symbols.py*
fd1acb
%{_datadir}/clang/clang-rename.py*
fd1acb
fd1acb
%files -n git-clang-format
fd1acb
%{_bindir}/git-clang-format
fd1acb
fd1acb
%files -n python3-clang
fd1acb
%{python3_sitelib}/clang/
fd1acb
1ca1ea
f28a49
%endif
fd1acb
%changelog
d4a856
* Tue Jun 28 2022 Tom Stellard <tstellar@redhat.com> - 14.0.6-1
d4a856
- 14.0.6 Release
d4a856
d4a856
* Wed Jun 01 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-2
d4a856
- Increate gcc-toolset dependency to 12
d4a856
- Set GCC_INSTALL_PREFIX variable
d4a856
d4a856
* Thu Apr 07 2022 Timm Bäder <tbaeder@redhat.com> - 14.0.0-1
d4a856
- Update to 14.0.0
d4a856
afdec7
* Thu Feb 03 2022 Tom Stellard <tstellar@redhat.com> - 13.0.1-1
afdec7
- 13.0.1 Release
afdec7
afdec7
* Fri Jan 21 2022 Serge Guelton - 13.0.0-3
afdec7
- Backport bidi patches
afdec7
afdec7
* Fri Oct 22 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-2
afdec7
- Don't emit unwind tables for bpf
afdec7
afdec7
* Fri Oct 15 2021 Tom Stellard <tstellar@redhat.com> - 13.0.0-1
afdec7
- 13.0.0 Release
afdec7
300695
* Fri Jul 16 2021 sguelton@redhat.com - 12.0.1-1
300695
- 12.0.1 release
300695
300695
* Thu May 6 2021 sguelton@redhat.com - 12.0.0-1
300695
- 12.0.0 release
300695
1ca1ea
* Thu Oct 29 2020 sguelton@redhat.com - 11.0.0-1
1ca1ea
- 11.0.0 final release
1ca1ea
1ca1ea
* Thu Sep 17 2020 sguelton@redhat.com - 11.0.0-0.1.rc2
1ca1ea
- 11.0.0-rc2 Release
1ca1ea
1ca1ea
* Fri Jul 24 2020 sguelton@redhat.com - 10.0.1-1
1ca1ea
- 10.0.1 release
1ca1ea
c558f2
* Thu Apr 9 2020 sguelton@redhat.com - 10.0.0-1
c558f2
- 10.0.0 final
c558f2
c558f2
* Fri Jan 10 2020 Tom Stellard <tstellar@redhat.com> - 9.0.1-2
c558f2
- Fix crash with kernel bpf self-tests
c558f2
c558f2
* Thu Dec 19 2019 Tom Stellard <tstellar@redhat.com> - 9.0.1-1
c558f2
- 9.0.1 Release
c558f2
f28a49
* Fri Nov 15 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-5
f28a49
- Fix typo from previous patch: move clang-libs dep to correct sub-package
f28a49
f28a49
* Thu Nov 14 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-4
f28a49
- Add explicit requires for clang-libs to fix rpmdiff errors
f28a49
f28a49
* Wed Oct 02 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
f28a49
- Limit build to 8 threads to avoid OOM on x86_64
f28a49
f28a49
* Wed Oct 02 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-2
f28a49
- Disable CLANG_LINK_CLANG_DYLIB
f28a49
f28a49
* Fri Sep 27 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-1
f28a49
- 9.0.0 Release
f28a49
f28a49
* Thu Aug 1 2019 sguelton@redhat.com - 8.0.1-1
f28a49
- 8.0.1 Release
f28a49
f28a49
* Thu Jun 13 2019 sguelton@redhat.com - 8.0.1-0.1.rc2
f28a49
- 8.0.1rc2 Release
f28a49
fd1acb
* Thu Apr 11 2019 sguelton@redhat.com - 8.0.0-1
fd1acb
- 8.0.0 Release
fd1acb
fd1acb
* Fri Dec 14 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-1
fd1acb
- 7.0.1-1 Release
fd1acb
fd1acb
* Mon Dec 10 2018 Tom Stellard <tstellar@redhat.com> - 7.0.1-0.1.rc3
fd1acb
- 7.0.1-rc3 Release
fd1acb
fd1acb
* Mon Nov 05 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-12
fd1acb
- User helper macro to fixup config.h for multilib
fd1acb
fd1acb
* Sat Oct 27 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-11
fd1acb
- Enable make check
fd1acb
fd1acb
* Mon Oct 15 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-10
fd1acb
- Remove Provides: llvm-toolset-6.0-clang-libs
fd1acb
fd1acb
* Fri Oct 12 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-9
fd1acb
- Add Provides: llvm-toolset-6.0-clang-libs
fd1acb
fd1acb
* Tue Oct 02 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-8
fd1acb
- Don't use python2 for the build
fd1acb
fd1acb
* Mon Oct 01 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-7
fd1acb
- Drop scl macros
fd1acb
fd1acb
* Tue Sep 25 2018 Tomas Orsava <torsava@redhat.com> - 6.0.1-6
fd1acb
- Change Requires from python3 to platform-python
fd1acb
- The python3 package was renamed to platform-python
fd1acb
- Related: rhbz#1619153
fd1acb
fd1acb
* Fri Sep 14 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-5
fd1acb
- Use python3 for git-clang-format
fd1acb
fd1acb
* Thu Sep 13 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-4
fd1acb
- Fix python dependencies
fd1acb
fd1acb
* Tue Aug 07 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-3
fd1acb
- Install ld.so.conf file in the root filesystem
fd1acb
fd1acb
* Thu Aug 02 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-2
fd1acb
- Remove annobin work-around
fd1acb
fd1acb
* Wed Jul 11 2018 Tom Stellard <tstellar@redhat.com> - 6.0.1-1
fd1acb
- 6.0.1 Release
fd1acb
fd1acb
* Wed Apr 11 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-7
fd1acb
- Add conditionals to enable building only the clang-libs package
fd1acb
fd1acb
* Fri Apr 06 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-6
fd1acb
- Use cmake from base RHEL
fd1acb
fd1acb
* Mon Mar 19 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-5
fd1acb
- Backport r310435 from clang trunk. rhbz#1558223
fd1acb
fd1acb
* Mon Mar 19 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-4
fd1acb
- Use system gcc instead of dts.
fd1acb
fd1acb
* Tue Feb 06 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-3
fd1acb
- Backport retpoline support
fd1acb
fd1acb
* Sat Jan 20 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-2
fd1acb
- Limit number of build threads on ppc64le to avoid OOM errors
fd1acb
fd1acb
* Tue Jan 09 2018 Tom Stellard <tstellar@redhat.com> - 5.0.1-1
fd1acb
- 5.0.1 Release
fd1acb
fd1acb
* Wed Jun 21 2017 Tom Stellard <tstellar@redhat.com> - 4.0.1-1
fd1acb
- 4.0.1 Release.
fd1acb
fd1acb
* Wed Jun 21 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-15
fd1acb
- Fix Requires for clang-tools-extra
fd1acb
fd1acb
* Wed Jun 21 2017 Tom Stellard 
fd1acb
- Fix Requires for clang-tools-extra
fd1acb
fd1acb
* Tue Jun 20 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-13
fd1acb
- Drop libomp dependency on s390x
fd1acb
fd1acb
* Thu Jun 15 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-12
fd1acb
- Use libstdc++ from devtoolset-7
fd1acb
fd1acb
* Wed Jun 07 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-11
fd1acb
- Fix libomp requires
fd1acb
fd1acb
* Wed Jun 07 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-10
fd1acb
- Build for llvm-toolset-7 rename
fd1acb
fd1acb
* Tue May 30 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-9
fd1acb
- Use ld from devtoolset in clang toolchain
fd1acb
fd1acb
* Mon May 29 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-8
fd1acb
- Add dependency on libopenmp
fd1acb
fd1acb
* Thu May 25 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-7
fd1acb
- Fix check for gcc install
fd1acb
fd1acb
* Wed May 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-6
fd1acb
- Add devtoolset-6 dependency for newer libstdc++
fd1acb
fd1acb
* Fri May 12 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-5
fd1acb
- Add dependency on compiler-rt
fd1acb
fd1acb
* Tue May 02 2017 Tom Stellard <tstellar@redhat.com>
fd1acb
- Fix dependencies with scl
fd1acb
fd1acb
* Mon May 01 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-4
fd1acb
- Build with llvm-toolset-4
fd1acb
fd1acb
* Mon Mar 27 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-3
fd1acb
- Enable eh/rtti, which are required by lldb.
fd1acb
fd1acb
* Fri Mar 24 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-2
fd1acb
- Fix clang-tools-extra build
fd1acb
- Fix install
fd1acb
fd1acb
* Thu Mar 23 2017 Tom Stellard <tstellar@redhat.com> - 4.0.0-1
fd1acb
- clang 4.0.0 final release
fd1acb
fd1acb
* Mon Mar 20 2017 David Goerger <david.goerger@yale.edu> - 3.9.1-3
fd1acb
- add clang-tools-extra rhbz#1328091
fd1acb
fd1acb
* Thu Mar 16 2017 Tom Stellard <tstellar@redhat.com> - 3.9.1-2
fd1acb
- Enable build-id by default rhbz#1432403
fd1acb
fd1acb
* Thu Mar 02 2017 Dave Airlie <airlied@redhat.com> - 3.9.1-1
fd1acb
- clang 3.9.1 final release
fd1acb
fd1acb
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 3.9.0-4
fd1acb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
fd1acb
fd1acb
* Mon Nov 14 2016 Nathaniel McCallum <npmccallum@redhat.com> - 3.9.0-3
fd1acb
- Add Requires: compiler-rt to clang-libs.
fd1acb
- Without this, compiling with certain CFLAGS breaks.
fd1acb
fd1acb
* Tue Nov  1 2016 Peter Robinson <pbrobinson@fedoraproject.org> 3.9.0-2
fd1acb
- Rebuild for new arches
fd1acb
fd1acb
* Fri Oct 14 2016 Dave Airlie <airlied@redhat.com> - 3.9.0-1
fd1acb
- clang 3.9.0 final release
fd1acb
fd1acb
* Fri Jul 01 2016 Stephan Bergmann <sbergman@redhat.com> - 3.8.0-2
fd1acb
- Resolves: rhbz#1282645 add GCC abi_tag support
fd1acb
fd1acb
* Thu Mar 10 2016 Dave Airlie <airlied@redhat.com> 3.8.0-1
fd1acb
- clang 3.8.0 final release
fd1acb
fd1acb
* Thu Mar 03 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.4
fd1acb
- clang 3.8.0rc3
fd1acb
fd1acb
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.3
fd1acb
- package all libs into clang-libs.
fd1acb
fd1acb
* Wed Feb 24 2016 Dave Airlie <airlied@redhat.com> 3.8.0-0.2
fd1acb
- enable dynamic linking of clang against llvm
fd1acb
fd1acb
* Thu Feb 18 2016 Dave Airlie <airlied@redhat.com> - 3.8.0-0.1
fd1acb
- clang 3.8.0rc2
fd1acb
fd1acb
* Fri Feb 12 2016 Dave Airlie <airlied@redhat.com> 3.7.1-4
fd1acb
- rebuild against latest llvm packages
fd1acb
- add BuildRequires llvm-static
fd1acb
fd1acb
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 3.7.1-3
fd1acb
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
fd1acb
fd1acb
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-2
fd1acb
- just accept clang includes moving to /usr/lib64, upstream don't let much else happen
fd1acb
fd1acb
* Thu Jan 28 2016 Dave Airlie <airlied@redhat.com> 3.7.1-1
fd1acb
- initial build in Fedora.
fd1acb
fd1acb
* Tue Oct 06 2015 Jan Vcelak <jvcelak@fedoraproject.org> 3.7.0-100
fd1acb
- initial version using cmake build system