2020-07-07 16:15:52 +08:00
|
|
|
%global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
2020-07-30 19:53:18 +08:00
|
|
|
%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE)
|
|
|
|
|
%global optflags %(echo %{optflags} -Dasm=__asm__)
|
2020-07-07 16:15:52 +08:00
|
|
|
|
2020-07-30 19:53:18 +08:00
|
|
|
Name: compiler-rt
|
2021-12-26 08:47:14 +08:00
|
|
|
Version: 12.0.1
|
|
|
|
|
Release: 1
|
2020-07-30 19:53:18 +08:00
|
|
|
Summary: LLVM "compiler-rt" runtime libraries
|
2021-12-26 08:47:14 +08:00
|
|
|
|
2020-07-30 19:53:18 +08:00
|
|
|
License: NCSA or MIT
|
|
|
|
|
URL: http://llvm.org
|
|
|
|
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{crt_srcdir}.tar.xz
|
2021-12-26 08:47:14 +08:00
|
|
|
Source2: tstellar-gpg-key.asc
|
|
|
|
|
Patch0: 0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..patch
|
2020-07-30 19:53:18 +08:00
|
|
|
|
|
|
|
|
BuildRequires: gcc
|
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
|
BuildRequires: cmake
|
2021-12-26 08:47:14 +08:00
|
|
|
BuildRequires: ninja-build
|
2020-07-30 19:53:18 +08:00
|
|
|
BuildRequires: python3
|
|
|
|
|
# We need python3-devel for pathfix.py.
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: llvm-devel = %{version}
|
2021-12-26 08:47:14 +08:00
|
|
|
# For gpg source verification
|
|
|
|
|
BuildRequires: gnupg2
|
|
|
|
|
|
|
|
|
|
Requires: clang-resource-filesystem%{?isa} = %{version}
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%description
|
2020-07-30 19:53:18 +08:00
|
|
|
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.
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%prep
|
2021-12-26 08:47:14 +08:00
|
|
|
%autosetup -n %{crt_srcdir} -p2
|
|
|
|
|
pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize
|
2020-07-30 19:53:18 +08:00
|
|
|
|
2020-02-21 17:30:31 +08:00
|
|
|
%build
|
|
|
|
|
mkdir -p _build
|
|
|
|
|
cd _build
|
|
|
|
|
%cmake .. \
|
2020-07-30 19:53:18 +08:00
|
|
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
|
|
|
|
-DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \
|
|
|
|
|
\
|
2020-02-21 17:30:31 +08:00
|
|
|
%if 0%{?__isa_bits} == 64
|
2020-07-30 19:53:18 +08:00
|
|
|
-DLLVM_LIBDIR_SUFFIX=64 \
|
2020-02-21 17:30:31 +08:00
|
|
|
%else
|
2020-07-30 19:53:18 +08:00
|
|
|
-DLLVM_LIBDIR_SUFFIX= \
|
2020-02-21 17:30:31 +08:00
|
|
|
%endif
|
2020-07-30 19:53:18 +08:00
|
|
|
-DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on?
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
cd _build
|
|
|
|
|
%make_install
|
|
|
|
|
|
2020-07-30 19:53:18 +08:00
|
|
|
# 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/
|
2020-02-21 17:30:31 +08:00
|
|
|
|
2020-07-30 19:53:18 +08:00
|
|
|
# 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
|
2020-02-21 17:30:31 +08:00
|
|
|
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/
|
|
|
|
|
pushd %{buildroot}%{_libdir}/clang/%{version}/lib
|
2020-07-30 19:53:18 +08:00
|
|
|
for i in *.a *.so
|
|
|
|
|
do
|
|
|
|
|
ln -s ../$i linux/$i
|
2020-02-21 17:30:31 +08:00
|
|
|
done
|
2020-07-30 19:53:18 +08:00
|
|
|
popd
|
2021-12-26 08:47:14 +08:00
|
|
|
# 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
|
2020-07-30 19:53:18 +08:00
|
|
|
%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
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%check
|
2021-12-26 08:47:14 +08:00
|
|
|
|
|
|
|
|
#%%cmake_build --target check-compiler-rt
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%files
|
2021-12-26 08:47:14 +08:00
|
|
|
%license LICENSE.TXT
|
2020-02-21 17:30:31 +08:00
|
|
|
%{_includedir}/*
|
2021-12-26 08:47:14 +08:00
|
|
|
%{_libdir}/clang/%{version}/lib/*
|
|
|
|
|
%{_libdir}/clang/%{version}/share/*
|
2020-07-30 19:53:18 +08:00
|
|
|
%ifarch x86_64 aarch64
|
|
|
|
|
%{_bindir}/hwasan_symbolize
|
|
|
|
|
%endif
|
2020-02-21 17:30:31 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2021-12-26 08:47:14 +08:00
|
|
|
* Mon Dec 27 2021 Chen Chen <chen_aka_jan@163.com> - 12.0.1-1
|
|
|
|
|
- Update to 12.0.1
|
|
|
|
|
|
2020-09-25 17:16:14 +08:00
|
|
|
* Fri Sep 25 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 10.0.1-3
|
|
|
|
|
- hwasan_symbolize should run in python2 and python3, and python3 is default now
|
|
|
|
|
|
2020-09-19 14:57:33 +08:00
|
|
|
* Sat Sep 19 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 10.0.1-2
|
|
|
|
|
- Keep "/usr/bin/env python" instead of /usr/bin/python3 in hwasan_symbolize
|
|
|
|
|
|
2020-07-30 19:53:18 +08:00
|
|
|
* Thu Jul 30 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 10.0.1-1
|
|
|
|
|
- Update to 10.0.1
|
|
|
|
|
|
2020-02-21 17:30:31 +08:00
|
|
|
* Thu Dec 5 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.0.0-2
|
|
|
|
|
- Package init
|