%global commit aab71d44431eabfb65fbbc8a2930cb6d34b7e2be %global shortcommit %(c=%{commit}; echo ${c:0:9}) %global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src # see https://sourceware.org/bugzilla/show_bug.cgi?id=25271 %global optflags %(echo %{optflags} -D_DEFAULT_SOURCE) # see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93615 %global optflags %(echo %{optflags} -Dasm=__asm__) Name: compiler-rt Version: 12.0.0 Release: 0.21.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: ninja-build BuildRequires: python3 # We need python3-devel for pathfix.py. BuildRequires: python3-devel BuildRequires: llvm-devel = %{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} -p1 pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize %build %cmake -B "%{_vpath_builddir}" \ -GNinja \ -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? %ninja_build -C "%{_vpath_builddir}" %install %ninja_install -C "%{_vpath_builddir}" # 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 # multilib support: also create symlink from lib to lib64, fixes rhbz#1678240 # the symlinks will be dangling if the 32 bits version is not installed, but that should be fine %ifarch x86_64 mkdir -p %{buildroot}/%{_exec_prefix}/lib/clang/%{version}/lib/linux for i in *.a *.so do target=`echo "$i" | sed -e 's/x86_64/i386/'` ln -s ../../../../../lib/clang/%{version}/lib/$target ../../../../%{_lib}/clang/%{version}/lib/linux/ done %endif popd %check #%%cmake_build --target check-compiler-rt %files %license LICENSE.TXT %{_includedir}/* %{_libdir}/clang/%{version} %ifarch x86_64 aarch64 %{_bindir}/hwasan_symbolize %endif %changelog