%global svnrel r372844 %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: 10.0.0 Release: 0.1.%{svnrel}%{?dist} Summary: LLVM "compiler-rt" runtime libraries License: NCSA or MIT URL: http://llvm.org Source0: http://llvm.org/releases/%{version}/%{name}-%{svnrel}.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} BuildRequires: llvm-test = %{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}-%{svnrel} pathfix.py -i %{__python3} -pn . %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} mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib %ifarch aarch64 %global aarch64_blacklists hwasan_blacklist.txt %endif for file in %{aarch64_blacklists} asan_blacklist.txt msan_blacklist.txt dfsan_blacklist.txt cfi_blacklist.txt dfsan_abilist.txt hwasan_blacklist.txt; do mv -v %{buildroot}%{_datadir}/${file} %{buildroot}%{_libdir}/clang/%{version}/ || : done # move sanitizer libs to better place %global libclang_rt_installdir lib/linux 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} #%{_prefix}/lib/linux/clang_rt.*.o %changelog