add -latomic flag to lockfree tests for riscv64

Boost does not implement atomic functions for RISC-V, and depend
that on compiler. For 16-byte atomic ops, the compiler must link
against libatomic.
This commit is contained in:
laokz 2023-07-02 17:27:24 +08:00 committed by laokz
parent 064431c6de
commit 28c9b15a36

View File

@ -2,7 +2,7 @@
Name: boost
Version: 1.78.0
Release: 16
Release: 17
Summary: The free peer-reviewed portable C++ source libraries
License: Boost Software License 1.0
URL: http://www.boost.org
@ -74,6 +74,9 @@ BuildRequires: libquadmath-devel libquadmath-static
BuildRequires: python3-numpy
# optional library for regex
BuildRequires: libicu-devel
%ifarch riscv64
BuildRequires: libatomic
%endif
Obsoletes: boost-signals < 1.69.0
@ -301,7 +304,12 @@ cd status
../b2 %{?_smp_mflags} %{opt_feature} cxxflags="$RPM_OPT_FLAGS" %{boost_macros} \
--include-tests=algorithm,graph,intrusive,dynamic_bitset,property_map,crc,lexical_cast,range \
--exclude-tests=mpi,graph_parallel
../b2 %{?_smp_mflags} %{opt_feature} cxxflags="$RPM_OPT_FLAGS" %{boost_macros} \
%ifarch riscv64
LINKFLAGS='linkflags="-Wl,-latomic"'
%else
LINKFLAGS=
%endif
../b2 %{?_smp_mflags} %{opt_feature} cxxflags="$RPM_OPT_FLAGS" $LINKFLAGS %{boost_macros} \
--include-tests=bimap,circular_buffer,container,heap,icl,lockfree,logic,multi_array,multi_index,poly_collection,property_tree,ptr_container,sort \
--exclude-tests=container_hash
@ -453,6 +461,9 @@ find libs -name example -exec cp {} boost-example --parents -r \;
%{_libdir}/*.a
%changelog
* Mon Aug 14 2023 laokz <zhangkai@iscas.ac.cn> - 1.78.0-17
- add -latomic flag to lockfree tests for riscv64
* Thu Aug 10 2023 herengui <herengui@kylinsec.com.cn> - 1.78.0-16
- add loongarch64 patch