Compare commits
10 Commits
551332ce84
...
9151ebdbf7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9151ebdbf7 | ||
|
|
f6486dd616 | ||
|
|
8f3527b948 | ||
|
|
282fb72eb8 | ||
|
|
aa472a629b | ||
|
|
4fbef26fed | ||
|
|
7238641f8d | ||
|
|
ccd684dda1 | ||
|
|
89da796c44 | ||
|
|
77e4c3beb7 |
@ -0,0 +1,43 @@
|
|||||||
|
From 8247295860b69fd379e282c3e6315df9f700e4d8 Mon Sep 17 00:00:00 2001
|
||||||
|
From: serge-sans-paille <sguelton@redhat.com>
|
||||||
|
Date: Thu, 25 Feb 2021 14:12:57 +0100
|
||||||
|
Subject: [PATCH][compiler-rt] Workaround libstdc++ limitation wrt. thread copy
|
||||||
|
|
||||||
|
---
|
||||||
|
compiler-rt/lib/fuzzer/FuzzerDefs.h | 6 ++++++
|
||||||
|
compiler-rt/lib/fuzzer/FuzzerDriver.cpp | 2 +-
|
||||||
|
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/compiler-rt/lib/fuzzer/FuzzerDefs.h b/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||||
|
index 1a2752a..abfbb8d 100644
|
||||||
|
--- a/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||||
|
+++ b/compiler-rt/lib/fuzzer/FuzzerDefs.h
|
||||||
|
@@ -50,6 +50,12 @@ template<typename T>
|
||||||
|
|
||||||
|
template<class Other>
|
||||||
|
struct rebind { typedef fuzzer_allocator<Other> other; };
|
||||||
|
+
|
||||||
|
+ template< class U, class... Args >
|
||||||
|
+ void construct( U* p, Args&&... args ) {
|
||||||
|
+ std::allocator<T>::construct(p, std::forward<Args>(args)...);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
diff --git a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
||||||
|
index 447cafc..2fce139 100644
|
||||||
|
--- a/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
||||||
|
+++ b/compiler-rt/lib/fuzzer/FuzzerDriver.cpp
|
||||||
|
@@ -294,7 +294,7 @@ static int RunInMultipleProcesses(const Vector<std::string> &Args,
|
||||||
|
std::thread Pulse(PulseThread);
|
||||||
|
Pulse.detach();
|
||||||
|
for (unsigned i = 0; i < NumWorkers; i++)
|
||||||
|
- V.push_back(std::thread(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors));
|
||||||
|
+ V.emplace_back(WorkerThread, std::ref(Cmd), &Counter, NumJobs, &HasErrors);
|
||||||
|
for (auto &T : V)
|
||||||
|
T.join();
|
||||||
|
return HasErrors ? 1 : 0;
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
@ -1,12 +0,0 @@
|
|||||||
diff -ruNa compiler-rt-7.0.0.src.old/CMakeLists.txt compiler-rt-7.0.0.src/CMakeLists.txt
|
|
||||||
--- compiler-rt-7.0.0.src.old/CMakeLists.txt 2020-03-20 18:23:28.512249162 +0800
|
|
||||||
+++ compiler-rt-7.0.0.src/CMakeLists.txt 2020-03-20 17:37:26.462851376 +0800
|
|
||||||
@@ -205,7 +205,7 @@
|
|
||||||
append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS)
|
|
||||||
endif()
|
|
||||||
append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS)
|
|
||||||
-append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS)
|
|
||||||
+#append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS)
|
|
||||||
append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS)
|
|
||||||
append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS)
|
|
||||||
if(NOT COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG)
|
|
||||||
BIN
compiler-rt-12.0.1.src.tar.xz
Normal file
BIN
compiler-rt-12.0.1.src.tar.xz
Normal file
Binary file not shown.
Binary file not shown.
139
compiler-rt.spec
139
compiler-rt.spec
@ -1,38 +1,55 @@
|
|||||||
%global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
%global crt_srcdir compiler-rt-%{version}%{?rc_ver:rc%{rc_ver}}.src
|
||||||
|
%global optflags %(echo %{optflags} -D_DEFAULT_SOURCE)
|
||||||
|
%global optflags %(echo %{optflags} -Dasm=__asm__)
|
||||||
|
|
||||||
Name: compiler-rt
|
Name: compiler-rt
|
||||||
Version: 7.0.0
|
Version: 12.0.1
|
||||||
Release: 2
|
Release: 2
|
||||||
Summary: LLVM "compiler-rt" runtime libraries
|
Summary: LLVM "compiler-rt" runtime libraries
|
||||||
License: NCSA or MIT
|
|
||||||
URL: http://llvm.org
|
License: NCSA or MIT
|
||||||
Source0: http://llvm.org/releases/%{version}/%{crt_srcdir}.tar.xz
|
URL: http://llvm.org
|
||||||
BuildRequires: gcc gcc-c++ cmake python3 python3-devel
|
Source0: https://github.com/llvm/llvm-project/releases/download/llvmorg-%{version}/%{crt_srcdir}.tar.xz
|
||||||
BuildRequires: llvm-devel = %{version} llvm-static = %{version}
|
Source2: tstellar-gpg-key.asc
|
||||||
|
Patch0: 0001-PATCH-compiler-rt-Workaround-libstdc-limitation-wrt..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}
|
||||||
|
# For gpg source verification
|
||||||
|
BuildRequires: gnupg2
|
||||||
|
BuildRequires: chrpath
|
||||||
|
|
||||||
|
Requires: clang-resource-filesystem%{?isa} = %{version}
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The compiler-rt project provides highly tuned implementations of the
|
The compiler-rt project is a part of the LLVM project. It provides
|
||||||
low-level code generator support routines like "__fixunsdfdi" and other
|
implementation of the low-level target-specific hooks required by
|
||||||
calls generated when a target doesn't have a short sequence of native
|
code generation, sanitizer runtimes and profiling library for code
|
||||||
instructions to implement a core IR operation.
|
instrumentation, and Blocks C language extension.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n %{crt_srcdir} -p1
|
%autosetup -n %{crt_srcdir} -p2
|
||||||
pathfix.py -i %{__python3} -pn .
|
pathfix.py -i %{__python3} -pn lib/hwasan/scripts/hwasan_symbolize
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir -p _build
|
mkdir -p _build
|
||||||
cd _build
|
cd _build
|
||||||
%cmake .. \
|
%cmake .. \
|
||||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
-DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \
|
-DLLVM_CONFIG_PATH:FILEPATH=%{_bindir}/llvm-config-%{__isa_bits} \
|
||||||
\
|
\
|
||||||
%if 0%{?__isa_bits} == 64
|
%if 0%{?__isa_bits} == 64
|
||||||
-DLLVM_LIBDIR_SUFFIX=64 \
|
-DLLVM_LIBDIR_SUFFIX=64 \
|
||||||
%else
|
%else
|
||||||
-DLLVM_LIBDIR_SUFFIX= \
|
-DLLVM_LIBDIR_SUFFIX= \
|
||||||
%endif
|
%endif
|
||||||
-DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF
|
-DCOMPILER_RT_INCLUDE_TESTS:BOOL=OFF # could be on?
|
||||||
|
|
||||||
%make_build
|
%make_build
|
||||||
|
|
||||||
@ -40,33 +57,83 @@ cd _build
|
|||||||
cd _build
|
cd _build
|
||||||
%make_install
|
%make_install
|
||||||
|
|
||||||
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib
|
# delete run path in DSO
|
||||||
|
for file in `find %{buildroot}%{_prefix} -name "lib*.so*"`; do
|
||||||
%ifarch aarch64
|
chrpath -d $file
|
||||||
%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
|
done
|
||||||
|
|
||||||
mv -v %{buildroot}%{_prefix}/lib/linux/libclang_rt* %{buildroot}%{_libdir}/clang/%{version}/lib
|
# 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/
|
mkdir -p %{buildroot}%{_libdir}/clang/%{version}/lib/linux/
|
||||||
pushd %{buildroot}%{_libdir}/clang/%{version}/lib
|
pushd %{buildroot}%{_libdir}/clang/%{version}/lib
|
||||||
for i in *.a *.syms *.so; do
|
for i in *.a *.so
|
||||||
ln -s ../$i linux/$i
|
do
|
||||||
|
ln -s ../$i linux/$i
|
||||||
done
|
done
|
||||||
|
popd
|
||||||
|
|
||||||
|
# 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 %{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
|
%check
|
||||||
cd _build
|
|
||||||
|
#%%cmake_build --target check-compiler-rt
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
|
||||||
%license LICENSE.TXT
|
%license LICENSE.TXT
|
||||||
%{_includedir}/*
|
%{_includedir}/*
|
||||||
%{_libdir}/clang/%{version}
|
%{_libdir}/clang/%{version}/lib/*
|
||||||
|
%{_libdir}/clang/%{version}/share/*
|
||||||
|
%ifarch x86_64 aarch64
|
||||||
|
%{_bindir}/hwasan_symbolize
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Dec 20 2022 eastb233 <xiezhiheng@huawei.com> - 12.0.1-2
|
||||||
|
- Delete run path in DSO
|
||||||
|
|
||||||
|
* Mon Dec 27 2021 Chen Chen <chen_aka_jan@163.com> - 12.0.1-1
|
||||||
|
- Update to 12.0.1
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
|
* 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
|
||||||
|
|
||||||
|
* Thu Jul 30 2020 Guoshuai Sun <sunguoshuai@huawei.com> - 10.0.1-1
|
||||||
|
- Update to 10.0.1
|
||||||
|
|
||||||
* Thu Dec 5 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.0.0-2
|
* Thu Dec 5 2019 openEuler Buildteam <buildteam@openeuler.org> - 7.0.0-2
|
||||||
- Package init
|
- Package init
|
||||||
|
|||||||
BIN
tstellar-gpg-key.asc
Normal file
BIN
tstellar-gpg-key.asc
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user