File llvm-roc.spec of Package llvm-roc
#
# spec file for package llvm7
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define _relver 9.2.0
%define _minor 9.2
%define _sonum ROC
%define _svnver 9svn
%define _relsonum 9
%define _socxx 1
%define _revsn 349238
%bcond_with libcxx
# LLVM currently doesn't build with Gold on ppc
%ifarch ppc
%bcond_with gold
%else
%bcond_without gold
%endif
%bcond_with ffi
%bcond_with oprofile
%bcond_with valgrind
%bcond_without pyclang
Name: llvm-roc
Version: 2.2.0
Release: 0
Summary: Low Level Virtual Machine
License: NCSA
Group: Development/Languages/Other
Url: http://www.llvm.org
Source0: https://github.com/RadeonOpenCompute/llvm/archive/roc-%{version}.tar.gz#/llvm-%{version}.tar.gz
Source1: https://github.com/RadeonOpenCompute/lld/archive/roc-%{version}.tar.gz#/lld-%{version}.tar.gz
Source2: https://github.com/RadeonOpenCompute/clang/archive/roc-%{version}.tar.gz#/clang-%{version}.tar.gz
Source99: llvm7-rpmlintrc
Source101: baselibs.conf
# PATCH-FIX-OPENSUSE set-revision.patch idoenmez@suse.de -- Allow us to set revision
Patch1: set-revision.patch
# PATCH-FIX-OPENSUSE assume-opensuse.patch idoenmez@suse.de -- Always enable openSUSE/SUSE features
Patch2: assume-opensuse.patch
# PATCH-FIX-OPENSUSE default-to-i586.patch -- Use i586 as default target for 32bit
Patch3: default-to-i586.patch
Patch4: clang-resourcedirs.patch
Patch5: llvm-remove-clang-only-flags.patch
Patch6: llvm-fix-find-gcc5-install.patch
Patch7: aarch64-disable-memorytest.patch
Patch8: clang-ignore-stack-clash-protector.patch
Patch13: llvm-normally-versioned-libllvm.patch
Patch14: llvm-do-not-install-static-libraries.patch
Patch15: opt-viewer-Do-not-require-python-2.patch
Patch16: n_clang_allow_BUILD_SHARED_LIBRARY.patch
Patch18: llvm-build-tests-with-rtti.patch
Patch20: llvm_build_tablegen_component_as_shared_library.patch
Patch21: tests-use-python3.patch
Patch22: llvm-better-detect-64bit-atomics-support.patch
Patch23: llvm-unittests-Don-t-install-TestPlugin.so.patch
Patch24: opt-viewer-Find-style-css-in-usr-share.patch
Patch25: llvm-drop-llvm-optional-clang-specific-optimization.patch
Patch26: clang-fix-powerpc-triplet.patch
Patch27: llvm-D51108.patch
Patch28: llvm-Ensure-that-variant-part-discriminator-is-read-by-Me.patch
Patch29: llvm-test-Fix-Assembler-debug-info.ll.patch
Patch30: fake-version.patch
BuildRequires: binutils-devel >= 2.21.90
%if %{with gold}
BuildRequires: binutils-gold
%endif
BuildRequires: cmake
BuildRequires: fdupes
BuildRequires: groff
BuildRequires: jsoncpp-devel
BuildRequires: libstdc++-devel
BuildRequires: libtool
BuildRequires: ncurses-devel
BuildRequires: ninja
BuildRequires: pkgconfig
BuildRequires: python3
BuildRequires: pkgconfig(libedit)
BuildRequires: pkgconfig(zlib)
# Avoid multiple provider errors
Requires: libLLVM%{_sonum}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# llvm does not work on s390
ExcludeArch: s390
BuildRequires: gcc
BuildRequires: gcc-c++
%if %{with ffi}
BuildRequires: pkgconfig(libffi)
%endif
%if %{with valgrind}
BuildRequires: pkgconfig(valgrind)
%endif
%if %{with oprofile}
BuildRequires: oprofile-devel
%endif
%description
LLVM is a compiler infrastructure designed for compile-time,
link-time, runtime, and idle-time optimization of programs from
arbitrary programming languages.
The compiler infrastructure includes mirror sets of programming
tools as well as libraries with equivalent functionality.
%package -n libLLVM%{_sonum}
Summary: Libraries for LLVM
Group: Development/Libraries/C and C++
%description -n libLLVM%{_sonum}
This package contains the shared libraries needed for LLVM.
%package devel
Summary: Header Files for LLVM
Group: Development/Languages/Other
Requires: %{name} = %{_relver}
Requires: binutils-devel >= 2.21.90
Requires: bison
Requires: flex
Requires: groff
Requires: libstdc++-devel
Requires: libtool
Requires: llvm%{_sonum}-LTO-devel
%if %{with gold}
Requires: llvm%{_sonum}-gold
%endif
Requires: llvm%{_sonum}-polly-devel
Requires: ncurses-devel
Requires: pkgconfig
Requires: pkgconfig(libedit)
Provides: llvm-devel-provider
Conflicts: llvm-devel-provider
Conflicts: cmake(LLVM)
%if %{with ffi}
Requires: pkgconfig(libffi)
%endif
%if %{with valgrind}
Requires: pkgconfig(valgrind)
%endif
%if %{with oprofile}
Requires: oprofile-devel
%endif
%description devel
This package contains library and header files needed to develop
new native programs that use the LLVM infrastructure.
%package -n clang%{_sonum}
Summary: CLANG frontend for LLVM
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: libLTO%{_svnver}
Requires: libclang%{_svnver}
Recommends: clang%{_sonum}-checker
Recommends: libc++-devel
Recommends: libomp%{_sonum}-devel
%if %{with gold}
Recommends: llvm-gold-devel
%endif
Recommends: scan-build
Recommends: scan-view
%if %{with cxx}
Requires: libc++%{_socxx}
%endif
%description -n clang%{_sonum}
This package contains the clang (C language) frontend for LLVM.
%package -n clang%{_sonum}-checker
Summary: Static code analyzer for CLANG
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: libclang%{_svnver}
# Due to a packaging error in clang3_8 we have to conflict.
Conflicts: clang3_8
Conflicts: scan-build
Conflicts: scan-view
Provides: scan-build
Provides: scan-view
%description -n clang%{_sonum}-checker
This package contains scan-build and scan-view, command line
static code analyzers for CLANG.
%package -n clang%{_sonum}-include-fixer
Summary: Automatically add missing includes
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: libclang%{_svnver} = %{_relver}
Conflicts: clang-include-fixer
Conflicts: find-all-symbols
Provides: clang-include-fixer
Provides: find-all-symbols
%description -n clang%{_sonum}-include-fixer
One of the major nuisances of C++ compared to other languages
is the manual management of include directives in any file.
clang-include-fixer addresses one aspect of this problem by
providing an automated way of adding include directives for
missing symbols in one translation unit.
While inserting missing includes, clang-include-fixer adds
missing namespace qualifiers to all instances of an
unidentified symbol if the symbol is missing some prefix
namespace qualifiers.
%package -n libclang%{_svnver}
Summary: Library files needed for clang
# Avoid multiple provider errors
Group: Development/Libraries/C and C++
Requires: libLLVM%{_sonum}
Requires: libstdc++-devel
%description -n libclang%{_svnver}
This package contains the shared libraries needed for clang.
%package -n clang%{_sonum}-devel
Summary: CLANG frontend for LLVM (devel package)
Group: Development/Languages/Other
Requires: %{name}-devel = %{_relver}
Requires: clang%{_sonum} = %{_relver}
Conflicts: cmake(Clang)
%description -n clang%{_sonum}-devel
This package contains the clang (C language) frontend for LLVM.
(development files)
%package -n libLTO%{_svnver}
Summary: Link-time optimizer for LLVM
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: libLLVM%{_sonum}
%description -n libLTO%{_svnver}
This package contains the link-time optimizer for LLVM.
%package LTO-devel
Summary: Link-time optimizer for LLVM (devel package)
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: %{name}-devel = %{_relver}
Requires: libLTO%{_svnver}
Conflicts: libLTO.so
Provides: libLTO.so
%description LTO-devel
This package contains the link-time optimizer for LLVM.
(development files)
%if %{with gold}
%package gold
Summary: Gold linker plugin for LLVM
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: %{name}-devel = %{_relver}
Requires: libLLVM%{_sonum}
Conflicts: llvm-gold-provider
Provides: llvm-gold-provider
%description gold
This package contains the Gold linker plugin for LLVM.
%endif
%package -n libomp%{_sonum}-devel
Summary: MPI plugin for LLVM
# Avoid multiple provider errors
Group: Development/Languages/Other
Requires: libLLVM%{_sonum}
Conflicts: libomp-devel
Provides: libomp-devel
%description -n libomp%{_sonum}-devel
This package contains the OpenMP MPI plugin for LLVM.
%package -n python3-clang
Summary: Python bindings for libclang
Group: Development/Languages/Python
Requires: clang%{_sonum}-devel = %{_relver}
BuildArch: noarch
Provides: %{python3_sitearch}/clang/
Conflicts: %{python3_sitearch}/clang/
%description -n python3-clang
This package contains the Python bindings to clang (C language)
frontend for LLVM.
%package -n lld%{_sonum}
Summary: Linker for Clang/LLVM
Group: Development/Tools/Building
%description -n lld%{_sonum}
LLD is a linker from the LLVM project. That is a drop-in replacement for system linkers and runs much faster than them. It also provides features that are useful for toolchain developers.
%package opt-viewer
Summary: Tools for visualising the LLVM optimization records
Group: Development/Languages/Other
BuildRequires: python3
Requires: python3
Requires: python3-PyYAML
Requires: python3-Pygments
BuildArch: noarch
Conflicts: opt-viewer
Provides: opt-viewer
%description opt-viewer
Set of tools for visualising the LLVM optimization records generated with -fsave-optimization-record. Used for compiler-assisted performance analysis
%prep
%setup -q -a 1 -a 2
%patch5 -p1
%ifarch aarch64
%patch7 -p1
%endif
%patch13 -p1
#%patch14 -p1
#%patch15 -p1
#%patch18 -p1
#%patch20 -p1
#%patch21 -p1
#%patch22 -p1
#%patch23 -p1
#%patch24 -p1
#%patch25 -p1
#%patch27 -p1
#%patch28 -p1
#%patch29 -p1
%patch30 -p1
pushd clang-roc-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
#%patch4 -p1
#%patch6 -p1
%patch8 -p1
#%patch16 -p2
#%patch26 -p1
popd
# Move into right place
mv lld-roc-%{version} tools/lld
mv clang-roc-%{version} tools/clang
%ifarch aarch64
rm unittests/Support/MemoryTest.cpp
%endif
# We hardcode openSUSE
rm tools/clang/unittests/Driver/DistroTest.cpp
# We hardcode i586
rm tools/clang/test/Driver/x86_features.c
rm tools/clang/test/Driver/nacl-direct.c
sed -i s,SVN_REVISION,\"%{_revsn}\",g tools/clang/lib/Basic/Version.cpp
sed -i s,LLVM_REVISION,\"%{_revsn}\",g tools/clang/lib/Basic/Version.cpp
%build
# Use optflags, but:
# 1) Remove the -D_FORTIFY_SOURCE=2 because llvm does not build correctly with
# hardening. The problem is in sanitizers from compiler-rt.
# 2) Remove the -g. We don't want it in stage1 and it will be added by cmake in
# the following stage.
flags=$(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=./-D_FORTIFY_SOURCE=0/;s/\B-g\b//g')
%ifarch armv6hl
flags+=" -mfloat-abi=hard -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
%endif
%ifarch armv7hl
flags+=" -mfloat-abi=hard -march=armv7-a -mtune=cortex-a15 -mfpu=vfpv3-d16"
%endif
# By default build everything
TARGETS_TO_BUILD="all"
%ifarch s390 s390x
# No graphics cards on System z
TARGETS_TO_BUILD="host;BPF"
%endif
%ifarch %arm
# TODO: Document why those.
TARGETS_TO_BUILD="host;ARM;AMDGPU;BPF;NVPTX"
%endif
%ifarch ppc ppc64 ppc64le
# TODO: Document why those.
TARGETS_TO_BUILD="host;AMDGPU;BPF;NVPTX"
%endif
# do not eat all memory
max_link_jobs="%{?jobs:%{jobs}}"
max_compile_jobs="%{?jobs:%{jobs}}"
echo "Available memory:"
cat /proc/meminfo
echo "System limits:"
ulimit -a
max_mem=$(awk '/MemTotal/ { print $2 }' /proc/meminfo)
if test -n "$max_link_jobs" -a "$max_link_jobs" -gt 1 ; then
mem_per_link_job=3000000
max_jobs="$(($max_mem / $mem_per_link_job))"
test "$max_link_jobs" -gt "$max_jobs" && max_link_jobs="$max_jobs" && echo "Warning: Reducing number of link jobs to $max_jobs because of memory limits"
test "$max_link_jobs" -le 0 && max_link_jobs=1 && echo "Warning: Not linking in parallel at all becuse of memory limits"
fi
if test -n "$max_compile_jobs" -a "$max_compile_jobs" -gt 1 ; then
mem_per_compile_job=1500000
max_jobs="$(($max_mem / $mem_per_compile_job))"
test "$max_compile_jobs" -gt "$max_jobs" && max_compile_jobs="$max_jobs" && echo "Warning: Reducing number of compile jobs to $max_jobs because of memory limits"
test "$max_compile_jobs" -le 0 && max_compile_jobs=1 && echo "Warning: Not compiling in parallel at all becuse of memory limits"
fi
%define __builder ninja
%define __builddir stage1
# -z,now is breaking now, it needs to be fixed
%cmake \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCMAKE_C_FLAGS="$flags -g0" \
-DCMAKE_CXX_FLAGS="$flags -g0" \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=OFF \
-DLLVM_LINK_LLVM_DYLIB:BOOL=OFF \
-DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \
-DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \
-DENABLE_LINKER_BUILD_ID=ON \
-DLLVM_OPTIMIZED_TABLEGEN:BOOL=ON \
-DLLVM_BUILD_TOOLS:BOOL=OFF \
-DLLVM_BUILD_UTILS:BOOL=OFF \
-DLLVM_BUILD_EXAMPLES:BOOL=OFF \
-DLLVM_BUILD_TESTS:BOOL=OFF \
-DLLVM_POLLY_BUILD:BOLL=OFF \
-DLLVM_TOOL_CLANG_TOOLS_EXTRA_BUILD:BOOL=OFF \
-DLLVM_INCLUDE_TESTS:BOOL=OFF \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_TARGETS_TO_BUILD=Native \
%if %{with gold}
-DLLVM_USE_LINKER=gold \
%endif
-DCLANG_ENABLE_ARCMT:BOOL=OFF \
-DCLANG_ENABLE_STATIC_ANALYZER:BOOL=OFF \
-DCOMPILER_RT_BUILD_SANITIZERS:BOOL=OFF \
-DCOMPILER_RT_BUILD_XRAY:BOOL=OFF \
-DLLDB_DISABLE_PYTHON=ON \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-keep-memory" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-keep-memory" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--no-keep-memory" \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3
ninja -v %{?_smp_mflags} clang
cd ..
# Remove files that won't be needed anymore.
# This reduces the total amount of disk space used during build. (bnc#1074625)
find ./stage1 -name '*.o' -delete
find ./stage1 -name '*.a' \
-and -not -name 'libclang*.a' \
-and -not -name 'libFuzzer.a' \
-and -not -name 'libc++.a' \
-and -not -name 'libc++experimental.a' \
-delete
%define __builddir build
export PATH=${PWD}/stage1/bin:$PATH
export CC=${PWD}/stage1/bin/clang
export CXX=${PWD}/stage1/bin/clang++
export LLVM_TABLEGEN=${PWD}/stage1/bin/llvm-tblgen
export CLANG_TABLEGEN=${PWD}/stage1/bin/clang-tblgen
# -z,now is breaking now, it needs to be fixed
%cmake \
-DBUILD_SHARED_LIBS:BOOL=OFF \
-DCLANG_BUILD_SHARED_LIBS:BOOL=ON \
-DLLVM_BUILD_LLVM_DYLIB:BOOL=ON \
-DLLVM_LINK_LLVM_DYLIB:BOOL=ON \
-DCMAKE_C_FLAGS="$flags" \
-DCMAKE_CXX_FLAGS="$flags" \
-DLLVM_PARALLEL_COMPILE_JOBS="$max_compile_jobs" \
-DLLVM_PARALLEL_LINK_JOBS="$max_link_jobs" \
%ifarch %arm s390 %{ix86}
-DCMAKE_C_FLAGS_RELWITHDEBINFO="$flags -g1" \
-DCMAKE_CXX_FLAGS_RELWITHDEBINFO="$flags -g1" \
%endif
-DENABLE_LINKER_BUILD_ID=ON \
-DLLVM_TABLEGEN="${LLVM_TABLEGEN}" \
-DCLANG_TABLEGEN="${CLANG_TABLEGEN}" \
-DLLVM_REQUIRES_RTTI=ON \
-DLLVM_ENABLE_TIMESTAMPS=OFF \
-DLLVM_ENABLE_ASSERTIONS=OFF \
-DLLVM_ENABLE_PIC=ON \
-DLLVM_BINUTILS_INCDIR=%{_includedir} \
-DLLVM_TARGETS_TO_BUILD=${TARGETS_TO_BUILD} \
%if %{with gold}
-DLLVM_USE_LINKER=gold \
%endif
%if "%{_lib}" == "lib64"
-DLLVM_LIBDIR_SUFFIX=64 \
%endif
%if %{with ffi}
-DLLVM_ENABLE_FFI=ON \
%endif
%if %{with oprofile}
-DLLVM_USE_OPROFILE=ON \
%endif
-DLLDB_DISABLE_PYTHON=ON \
-DCMAKE_SKIP_RPATH:BOOL=OFF \
-DCMAKE_EXE_LINKER_FLAGS="-Wl,--as-needed -Wl,--build-id=sha1" \
-DCMAKE_MODULE_LINKER_FLAGS="-Wl,--as-needed -Wl,--build-id=sha1" \
-DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,--build-id=sha1" \
-DPYTHON_EXECUTABLE:FILEPATH=/usr/bin/python3 \
-DPOLLY_BUNDLED_ISL:BOOL=ON \
-DPOLLY_BUNDLED_JSONCPP:BOOL=OFF
ninja -v %{?_smp_mflags}
cd ..
%install
%cmake_install
# install python bindings
# The python bindings use the unversioned libclang.so,
# so it doesn't make sense to have multiple versions of it
%if %{with pyclang}
install -d %{buildroot}%{python3_sitelib}/clang
pushd tools/clang/bindings/python
cp clang/*.py %{buildroot}%{python3_sitelib}/clang
install -d %{buildroot}%{_docdir}/python-clang/examples/cindex
cp -r examples %{buildroot}%{_docdir}/python-clang
install -d %{buildroot}%{_docdir}/python-clang/tests/cindex/INPUTS
cp -r tests %{buildroot}%{_docdir}/python-clang
popd
%endif
# Note that bfd-plugins is always in /usr/lib/bfd-plugins, no matter what _libdir is.
mkdir -p %{buildroot}/usr/lib/bfd-plugins
%if %{with gold}
ln -s %{_libdir}/LLVMgold.so %{buildroot}/usr/lib/bfd-plugins/
%endif
mv %{buildroot}%{_prefix}/libexec/{c++,ccc}-analyzer %{buildroot}%{_bindir}
mv %{buildroot}%{_datadir}/clang/clang-format-diff.py %{buildroot}%{_bindir}/clang-format-diff
mv %{buildroot}%{_datadir}/opt-viewer/opt-diff.py %{buildroot}%{_bindir}/opt-diff
mv %{buildroot}%{_datadir}/opt-viewer/opt-stats.py %{buildroot}%{_bindir}/opt-stats
mv %{buildroot}%{_datadir}/opt-viewer/opt-viewer.py %{buildroot}%{_bindir}/opt-viewer
mv %{buildroot}%{_datadir}/opt-viewer/optpmap.py %{buildroot}%{python3_sitelib}/optpmap.py
mv %{buildroot}%{_datadir}/opt-viewer/optrecord.py %{buildroot}%{python3_sitelib}/optrecord.py
chmod -x %{buildroot}%{_mandir}/man1/scan-build.1
rm -rf %{buildroot}%{_includedir}/lld
rm -f %{buildroot}%{_libdir}/TestPlugin.so
%if %{with libcxx}
rm %{buildroot}%{_libdir}/libc++abi.a
%endif
# We don't care about text editors
rm %{buildroot}%{_datadir}/clang/*.applescript
rm %{buildroot}%{_datadir}/clang/clang-format-sublime.py
rm %{buildroot}%{_datadir}/clang/clang-format.el
rm %{buildroot}%{_datadir}/clang/clang-format.py
rm %{buildroot}%{_datadir}/clang/clang-rename.el
rm %{buildroot}%{_datadir}/clang/clang-rename.py
rm %{buildroot}%{_datadir}/clang/bash-autocomplete.sh
# remove static libraries
rm %{buildroot}%{_libdir}/*.a
# rpm macro for version checking
mkdir -p %{buildroot}%{_rpmconfigdir}/macros.d/
cat > %{buildroot}%{_rpmconfigdir}/macros.d/macros.llvm <<EOF
#
# RPM macros for LLVM/Clang packaging
#
# Version information
_llvm_version %{_relver}
_llvm_relver %{_relver}
_llvm_minorver %{_minor}
_llvm_sonum %{_sonum}
_libcxx_sonum %{_socxx}
_llvm_revision %{_revsn}
# Build information
_llvm_with_libcxx %{with libcxx}
_llvm_with_openmp %{with openmp}
_llvm_with_ffi %{with ffi}
_llvm_with_oprofile %{with oprofile}
_llvm_with_valgrind %{with valgrind}
_llvm_with_pyclang %{with pyclang}
_llvm_with_lldb %{with lldb}
EOF
%fdupes %{_includedir}/%{name}/Host/
%post -n libLLVM%{_sonum} -p /sbin/ldconfig
%postun -n libLLVM%{_sonum} -p /sbin/ldconfig
%post -n libclang%{_svnver} -p /sbin/ldconfig
%postun -n libclang%{_svnver} -p /sbin/ldconfig
%post -n libLTO%{_svnver} -p /sbin/ldconfig
%postun -n libLTO%{_svnver} -p /sbin/ldconfig
%post -n clang%{_sonum}-devel -p /sbin/ldconfig
%postun -n clang%{_sonum}-devel -p /sbin/ldconfig
%if %{with gold}
%post gold -p /sbin/ldconfig
%postun gold -p /sbin/ldconfig
%endif
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig
%post LTO-devel -p /sbin/ldconfig
%postun LTO-devel -p /sbin/ldconfig
%files
%license CREDITS.TXT LICENSE.TXT
%{_bindir}/bugpoint
%{_bindir}/diagtool
%{_bindir}/dsymutil
%{_bindir}/hmaptool
%{_bindir}/llc
%{_bindir}/lli
%{_bindir}/llvm-ar
%{_bindir}/llvm-as
%{_bindir}/llvm-bcanalyzer
%{_bindir}/llvm-c-test
%{_bindir}/llvm-cat
%{_bindir}/llvm-cfi-verify
%{_bindir}/llvm-cov
%{_bindir}/llvm-cvtres
%{_bindir}/llvm-cxxdump
%{_bindir}/llvm-cxxfilt
%{_bindir}/llvm-cxxmap
%{_bindir}/llvm-diff
%{_bindir}/llvm-dis
%{_bindir}/llvm-dlltool
%{_bindir}/llvm-dwarfdump
%{_bindir}/llvm-dwp
%{_bindir}/llvm-elfabi
%{_bindir}/llvm-exegesis
%{_bindir}/llvm-extract
%{_bindir}/llvm-lib
%{_bindir}/llvm-link
%{_bindir}/llvm-lto
%{_bindir}/llvm-lto2
%{_bindir}/llvm-mc
%{_bindir}/llvm-mca
%{_bindir}/llvm-modextract
%{_bindir}/llvm-mt
%{_bindir}/llvm-nm
%{_bindir}/llvm-objcopy
%{_bindir}/llvm-objdump
%{_bindir}/llvm-opt-report
%{_bindir}/llvm-pdbutil
%{_bindir}/llvm-profdata
%{_bindir}/llvm-ranlib
%{_bindir}/llvm-rc
%{_bindir}/llvm-readelf
%{_bindir}/llvm-readobj
%{_bindir}/llvm-rtdyld
%{_bindir}/llvm-size
%{_bindir}/llvm-split
%{_bindir}/llvm-stress
%{_bindir}/llvm-strings
%{_bindir}/llvm-strip
%{_bindir}/llvm-symbolizer
%{_bindir}/llvm-tblgen
%{_bindir}/llvm-undname
%{_bindir}/llvm-xray
%{_bindir}/obj2yaml
%{_bindir}/opt
%{_bindir}/sancov
%{_bindir}/sanstats
%{_bindir}/verify-uselistorder
%{_bindir}/yaml2obj
%files -n clang%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%dir %{_libdir}/clang/
%{_bindir}/c-index-test
%{_bindir}/clang
%{_bindir}/clang++
%{_bindir}/clang-9
%{_bindir}/clang-check
%{_bindir}/clang-cl
%{_bindir}/clang-cpp
%{_bindir}/clang-extdef-mapping
%{_bindir}/clang-format
%{_bindir}/clang-format-diff
%{_bindir}/clang-import-test
%{_bindir}/clang-offload-bundler
%{_bindir}/clang-refactor
%{_bindir}/clang-rename
%{_bindir}/git-clang-format
%dir %{_libdir}/clang/%{_relver}/
%files -n clang%{_sonum}-checker
%license CREDITS.TXT LICENSE.TXT
%{_bindir}/c++-analyzer
%{_bindir}/ccc-analyzer
%{_bindir}/scan-build
%{_bindir}/scan-view
%{_datadir}/scan-build/
%{_datadir}/scan-view/
%{_mandir}/man1/scan-build.1%{ext_man}
%files opt-viewer
%license CREDITS.TXT LICENSE.TXT
%{_bindir}/opt-diff
%{_bindir}/opt-stats
%{_bindir}/opt-viewer
%{python3_sitelib}/optpmap.py
%{python3_sitelib}/optrecord.py
%{_datadir}/opt-viewer/
%files -n libLLVM%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libLLVM*.so.*
%{_libdir}/LLVMPromotePointerKernArgsToGlobal.so
%{_libdir}/LLVMSelectAcceleratorCode.so
%{_libdir}/libOptRemarks.so*
%files -n libclang%{_svnver}
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libclang*.so.*
%dir %{_libdir}/clang/
%dir %{_libdir}/clang/%{_relver}/
%{_libdir}/clang/%{_relver}/include
%files -n libLTO%{_svnver}
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libLTO.so.*
%if %{with gold}
%files gold
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/LLVMgold.so
# Note that bfd-plugins is always in /usr/lib/bfd-plugins, no matter what _libdir is.
%dir /usr/lib/bfd-plugins/
/usr/lib/bfd-plugins/LLVMgold.so
%else
%exclude %{_libdir}/LLVMgold.so
%endif
%files devel
%license CREDITS.TXT LICENSE.TXT
%{_bindir}/llvm-config
%{_libdir}/libLLVM.so
%{_includedir}/llvm/
%{_includedir}/llvm-c/
%{_libdir}/cmake/llvm
%{_rpmconfigdir}/macros.d/macros.llvm
%files -n clang%{_sonum}-devel
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libclang*.so
%{_includedir}/clang/
%{_includedir}/clang-c/
%{_libdir}/cmake/clang
%files LTO-devel
%license CREDITS.TXT LICENSE.TXT
%{_libdir}/libLTO.so
%if %{with pyclang}
%files -n python3-clang
%license CREDITS.TXT LICENSE.TXT
%{python3_sitelib}/clang/
%{_docdir}/python-clang/
%endif
%files -n lld%{_sonum}
%license CREDITS.TXT LICENSE.TXT
%{_bindir}/ld.lld
%{_bindir}/ld64.lld
%{_bindir}/lld
%{_bindir}/lld-link
%{_bindir}/wasm-ld
%changelog