add '-Wl, --as-needed' for re2 to link dynamic library

This commit is contained in:
eaglegai 2024-01-23 07:58:00 +00:00
parent f868d35f36
commit 0b7dca94f2

View File

@ -1,6 +1,6 @@
Name: re2
Version: 20230901
Release: 1
Release: 2
Summary: Provide backtracking RE engine
License: BSD
URL: http://github.com/google/re2/
@ -24,6 +24,7 @@ If you want to develop programs using re2, you need to install re2-devel.
%autosetup -n %{name}-2023-09-01 -p1
%build
sed -i 's/RE2_LDFLAGS?=-pthread/RE2_LDFLAGS?=-pthread -Wl,--as-needed/g' Makefile
%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++17" \
LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \
includedir=%{_includedir} libdir=%{_libdir}
@ -51,6 +52,9 @@ export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH
%exclude %{_libdir}/libre2.a
%changelog
* Tue Jan 23 2024 gaihuiying <eaglegai@163.com> - 20230901-2
- add '-Wl, --as-needed' for re2 to link dynamic library
* Wed Oct 18 2023 wulei <wu_lei@hoperun.com> - 20230901-1
- Update to 20230901