import llvm-15.0.0-3.module+el8.8.0+17274+5f3a8c6c

This commit is contained in:
CentOS Sources 2022-11-19 04:20:28 +00:00 committed by Stepan Oksanichenko
parent 0a9f2b0c38
commit 953f0a47c9
1 changed files with 32 additions and 26 deletions

View File

@ -64,9 +64,17 @@
%global experimental_targets_to_build "" %global experimental_targets_to_build ""
%global _smp_mflags -j8 %global _smp_mflags -j8
%if 0%{?rhel} == 8
%undefine __cmake_in_source_build
# libedit-devel is a buildroot-only package in RHEL8, so we can't have a # libedit-devel is a buildroot-only package in RHEL8, so we can't have a
# any run-time depencies on it. # any run-time depencies on it.
%global use_libedit 0 %global use_libedit 0
%endif
%if 0%{?rhel} > 8
%global use_libedit 1
%endif
%else %else
########## ##########
@ -80,9 +88,10 @@
# Spec File # Spec File
################################################################################ ################################################################################
Name: %{pkg_name} Name: %{pkg_name}
Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}} Version: %{maj_ver}.%{min_ver}.%{patch_ver}%{?rc_ver:~rc%{rc_ver}}
Release: 2%{?dist} Release: 3%{?dist}
Summary: The Low Level Virtual Machine Summary: The Low Level Virtual Machine
License: NCSA License: NCSA
@ -127,11 +136,13 @@ BuildRequires: libedit-devel
%endif %endif
# Need pandoc to cover markdown to rst, because RHEL does not have recommonmark, # Need pandoc to cover markdown to rst, because RHEL does not have recommonmark,
# so we can't build the documentation as is. # so we can't build the documentation as is.
%if 0%{?rhel} %if !0%{?rhel}
BuildRequires: pandoc
%else
BuildRequires: python3-recommonmark BuildRequires: python3-recommonmark
%endif %endif
%if 0%{?rhel} == 8
# RHEL8 has pandoc which we can use instead of python3-recommonmark for some things.
BuildRequires: pandoc
%endif
# We need python3-devel for pathfix.py and %%py3_shebang_fix. # We need python3-devel for pathfix.py and %%py3_shebang_fix.
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: python3-setuptools BuildRequires: python3-setuptools
@ -221,20 +232,20 @@ Summary: LLVM's modified googletest sources
%description googletest %description googletest
LLVM's modified googletest sources. LLVM's modified googletest sources.
%endif
%if 0%{?rhel} %if 0%{?rhel}
%package toolset %package toolset
Summary: Package that installs llvm-toolset Summary: Package that installs llvm-toolset
Requires: clang = %{version} Requires: clang = %{version}
Requires: llvm = %{version}
Requires: llvm = %{version}
%ifnarch s390x %ifnarch s390x
Requires: lld = %{version} Requires: lld = %{version}
%endif %endif
%description toolset %description toolset
This is the main package for llvm-toolset This is the main package for llvm-toolset.
%endif
%endif %endif
%prep %prep
@ -252,7 +263,7 @@ mv %{cmake_srcdir} cmake
tools/opt-viewer/*.py \ tools/opt-viewer/*.py \
utils/update_cc_test_checks.py utils/update_cc_test_checks.py
%if 0%{?rhel} %if 0%{?rhel} == 8
# Convert markdown files to rst to cope with the absence of compatible md parser in rhel. # Convert markdown files to rst to cope with the absence of compatible md parser in rhel.
# The sed expression takes care of a slight difference between pandoc markdown and sphinx markdown. # The sed expression takes care of a slight difference between pandoc markdown and sphinx markdown.
find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst ; done find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pandoc -f markdown -o ${md%.md}.rst ; done
@ -267,18 +278,13 @@ find -name '*.md' | while read md; do sed -r -e 's/^( )*\* /\n\1\* /' ${md} | pa
%global _lto_cflags -flto=thin %global _lto_cflags -flto=thin
%endif %endif
%ifarch s390 s390x %{arm} %ix86 ppc64le %ifarch s390 s390x %{arm} %ix86
# Decrease debuginfo verbosity to reduce memory consumption during final library linking # Decrease debuginfo verbosity to reduce memory consumption during final library linking
# On ppc64le, this is done to reduce disk usage.
%global optflags %(echo %{optflags} | sed 's/-g /-g1 /') %global optflags %(echo %{optflags} | sed 's/-g /-g1 /')
%endif %endif
# Need to explicitly call set_build_flags if we want to update LDFLAGS
%set_build_flags
export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5"
# force off shared libs as cmake macros turns it on. # force off shared libs as cmake macros turns it on.
%cmake -G Ninja -S . -B %{_vpath_builddir} \ %cmake -G Ninja \
-DBUILD_SHARED_LIBS:BOOL=OFF \ -DBUILD_SHARED_LIBS:BOOL=OFF \
-DLLVM_PARALLEL_LINK_JOBS=1 \ -DLLVM_PARALLEL_LINK_JOBS=1 \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \
@ -350,11 +356,11 @@ export LDFLAGS="${LDFLAGS} -Wl,--build-id=md5"
# Build libLLVM.so first. This ensures that when libLLVM.so is linking, there # Build libLLVM.so first. This ensures that when libLLVM.so is linking, there
# are no other compile jobs running. This will help reduce OOM errors on the # are no other compile jobs running. This will help reduce OOM errors on the
# builders without having to artificially limit the number of concurrent jobs. # builders without having to artificially limit the number of concurrent jobs.
%ninja_build -C %{_vpath_builddir} LLVM %cmake_build --target LLVM
%ninja_build -C %{_vpath_builddir} %cmake_build
%install %install
%ninja_install -C %{_vpath_builddir} %cmake_install
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
@ -407,7 +413,7 @@ ln -s -t %{buildroot}%{_libdir}/bfd-plugins/ ../LLVMgold.so
# Add version suffix to binaries # Add version suffix to binaries
for f in %{buildroot}/%{install_bindir}/*; do for f in %{buildroot}/%{install_bindir}/*; do
filename=`basename $f` filename=`basename $f`
ln -s ../../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix} ln -s ../../%{install_bindir}/$filename %{buildroot}/%{_bindir}/$filename%{exec_suffix}
done done
# Move header files # Move header files
@ -535,7 +541,6 @@ fi
%{_libdir}/bfd-plugins/LLVMgold.so %{_libdir}/bfd-plugins/LLVMgold.so
%endif %endif
%{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so %{_libdir}/libLLVM-%{maj_ver}.%{min_ver}*.so
%{_libdir}/libLLVM-%{maj_ver}.so
%{_libdir}/libLTO.so* %{_libdir}/libLTO.so*
%else %else
%config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf %config(noreplace) %{_sysconfdir}/ld.so.conf.d/%{name}-%{_arch}.conf
@ -601,10 +606,11 @@ fi
%{_datadir}/llvm/src/utils %{_datadir}/llvm/src/utils
%{_libdir}/libLLVMTestingSupport.a %{_libdir}/libLLVMTestingSupport.a
%endif
%if 0%{?rhel} %if 0%{?rhel}
%files toolset %files toolset
%license LICENSE.TXT
%endif
%endif %endif
%changelog %changelog