Fix the path of the libraries

Use just the major version instead of full version.
This commit is contained in:
Tulio Magno Quites Machado Filho 2023-03-06 12:19:37 -03:00
parent d37fc52fe0
commit eb44cf3fe8

View File

@ -4,8 +4,12 @@
# https://bugzilla.redhat.com/show_bug.cgi?id=2158587 # https://bugzilla.redhat.com/show_bug.cgi?id=2158587
%undefine _include_frame_pointers %undefine _include_frame_pointers
%global compiler_rt_version 16.0.0 %global maj_ver 16
%global min_ver 0
%global patch_ver 0
%global rc_ver 3 %global rc_ver 3
%global compiler_rt_version %{maj_ver}.%{min_ver}.%{patch_ver}
%global crt_srcdir compiler-rt-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src %global crt_srcdir compiler-rt-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src
%global cmake_srcdir cmake-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src %global cmake_srcdir cmake-%{compiler_rt_version}%{?rc_ver:rc%{rc_ver}}.src
@ -17,7 +21,7 @@
Name: compiler-rt Name: compiler-rt
Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}} Version: %{compiler_rt_version}%{?rc_ver:~rc%{rc_ver}}
Release: 1%{?dist} Release: 2%{?dist}
Summary: LLVM "compiler-rt" runtime libraries Summary: LLVM "compiler-rt" runtime libraries
License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT License: Apache-2.0 WITH LLVM-exception OR NCSA OR MIT
@ -83,15 +87,15 @@ export ASMFLAGS=$CFLAGS
%cmake_install %cmake_install
# move blacklist/abilist files to where clang expect them # move blacklist/abilist files to where clang expect them
mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/share
mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/share/ mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{maj_ver}/share/
# move sanitizer libs to better place # move sanitizer libs to better place
%global libclang_rt_installdir lib/linux %global libclang_rt_installdir lib/linux
mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/lib
mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*_rt* %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*_rt* %{buildroot}%{_libdir}/clang/%{maj_ver}/lib
mkdir -p %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib/linux/ mkdir -p %{buildroot}%{_libdir}/clang/%{maj_ver}/lib/linux/
pushd %{buildroot}%{_libdir}/clang/%{compiler_rt_version}/lib pushd %{buildroot}%{_libdir}/clang/%{maj_ver}/lib
for i in *.a *.so for i in *.a *.so
do do
ln -s ../$i linux/$i ln -s ../$i linux/$i
@ -101,11 +105,11 @@ done
# the symlinks will be dangling if the 32 bits version is not installed, but that should be fine # the symlinks will be dangling if the 32 bits version is not installed, but that should be fine
%ifarch x86_64 %ifarch x86_64
mkdir -p %{buildroot}/%{_exec_prefix}/lib/clang/%{compiler_rt_version}/lib/linux mkdir -p %{buildroot}/%{_exec_prefix}/lib/clang/%{maj_ver}/lib/linux
for i in *.a *.so for i in *.a *.so
do do
target=`echo "$i" | sed -e 's/x86_64/i386/'` target=`echo "$i" | sed -e 's/x86_64/i386/'`
ln -s ../../../../../lib/clang/%{compiler_rt_version}/lib/$target ../../../../%{_lib}/clang/%{compiler_rt_version}/lib/linux/ ln -s ../../../../../lib/clang/%{maj_ver}/lib/$target ../../../../%{_lib}/clang/%{maj_ver}/lib/linux/
done done
%endif %endif
@ -119,13 +123,16 @@ popd
%files %files
%license LICENSE.TXT %license LICENSE.TXT
%{_includedir}/* %{_includedir}/*
%{_libdir}/clang/%{compiler_rt_version}/lib/* %{_libdir}/clang/%{maj_ver}/lib/*
%{_libdir}/clang/%{compiler_rt_version}/share/* %{_libdir}/clang/%{maj_ver}/share/*
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
%{_bindir}/hwasan_symbolize %{_bindir}/hwasan_symbolize
%endif %endif
%changelog %changelog
* Mon Mar 06 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-2
- Fix the path of the libraries
* Thu Feb 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-1 * Thu Feb 23 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 16.0.0~rc3-1
- Update to LLVM 16.0.0 RC3 - Update to LLVM 16.0.0 RC3