%global commit 7cdbf1ed4b94259a3aad2a7575e928fa61b0e57e %global shortcommit %(c=%{commit}; echo ${c:0:9}) %ifarch s390 s390x # only limited set of libs available on s390(x) and the existing ones (stats, ubsan) don't provide debuginfo %global debug_package %{nil} %endif %global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src Name: compiler-rt Version: 11.0.0 Release: 0.25.git%{shortcommit}%{?dist} Summary: LLVM "compiler-rt" runtime libraries License: NCSA or MIT URL: http://llvm.org Source0: %{name}-%{shortcommit}.tar.xz #Patch0: 0001-PATCH-std-thread-copy.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: python3 # We need python3-devel for pathfix.py. BuildRequires: python3-devel BuildRequires: llvm-devel = %{version} BuildRequires: llvm-static = %{version} %description The compiler-rt project is a part of the LLVM project. It provides implementation of the low-level target-specific hooks required by code generation, sanitizer runtimes and profiling library for code instrumentation, and Blocks C language extension. %prep %autosetup -n %{name}-%{shortcommit} pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize %build mkdir -p _build cd _build %cmake .. \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \ \ %if 0%{?__isa_bits} == 64 -DLLVM_LIBDIR_SUFFIX=64 \ %else -DLLVM_LIBDIR_SUFFIX= \ %endif -DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on? make %{?_smp_mflags} %install cd _build make install DESTDIR=%{buildroot} # move blacklist/abilist files to where clang expect them mkdir -p %{buildroot}%{_libdir}/clang/%{version}/share mv -v %{buildroot}%{_datadir}/*list.txt %{buildroot}%{_libdir}/clang/%{version}/share/ # move sanitizer libs to better place %global libclang_rt_installdir lib/linux mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib mv -v %{buildroot}%{_prefix}/%{libclang_rt_installdir}/*clang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/ pushd %{buildroot}%{_libdir}/clang/%{version}/lib for i in *.a *.so do ln -s ../$i linux/$i done popd # multilib support: also create symlink from lib to lib64 # fixes rhbz#1678240 %ifarch %{ix86} %post if test "`uname -m`" = x86_64 then cd %{_libdir}/clang/%{version}/lib mkdir -p ../../../../lib64/clang/%{version}/lib for i in *.a *.so do ln -s ../../../../%{_lib}/clang/%{version}/lib/$i ../../../../lib64/clang/%{version}/lib/$i done fi %preun if test "`uname -m`" = x86_64 then cd %{_libdir}/clang/%{version}/lib for i in *.a *.so do rm ../../../../lib64/clang/%{version}/lib/$i done rmdir -p ../../../../lib64/clang/%{version}/lib 2>/dev/null 1>/dev/null || : fi %endif %check #make check-all -C _build %files %{_includedir}/* %{_libdir}/clang/%{version} %ifarch x86_64 aarch64 %{_bindir}/hwasan_symbolize %endif %changelog