Add an option to replace unsafe functions in the compat lib with a stub

This commit is contained in:
Björn Esser 2019-01-24 21:11:54 +01:00
parent 904ed6a794
commit 4125fd1e20
No known key found for this signature in database
GPG Key ID: F52E98007594C21D

View File

@ -12,6 +12,13 @@
%bcond_with compat_pkg
%endif
# Replace obsolete functions with a stub?
%if (0%{?fedora} >= 999 || 0%{?rhel} >= 99) && %{with compat_pkg}
%bcond_without enosys_stubs
%else
%bcond_with enosys_stubs
%endif
# Run memcheck?
# Valgrind does not work well on %%{power64} arches.
%ifnarch %{power64}
@ -57,6 +64,12 @@
%global compat_api glibc
%endif
%if %{with enosys_stubs}
%global enosys_stubs yes
%else
%global enosys_stubs no
%endif
# Needed for the distribution README file.
%if 0%{?fedora}
@ -262,20 +275,26 @@ EOF
%build
# Build the default system library.
pushd %{_vpath_builddir}
%configure \
%{common_configure_options} \
--enable-hashes=%{hash_methods} \
--enable-obsolete-api=%{obsolete_api}
%configure \
%{common_configure_options} \
--enable-hashes=%{hash_methods} \
--enable-obsolete-api=%{obsolete_api} \
%if %{with new_api}
--enable-obsolete-api-enosys=%{obsolete_api}
%else
--enable-obsolete-api-enosys=%{enosys_stubs}
%endif
%make_build
popd
%if %{with compat_pkg}
# Build the compatibility library.
pushd %{_vpath_builddir}-compat
%configure \
%{common_configure_options} \
--enable-hashes=%{compat_methods} \
--enable-obsolete-api=%{compat_api}
%configure \
%{common_configure_options} \
--enable-hashes=%{compat_methods} \
--enable-obsolete-api=%{compat_api} \
--enable-obsolete-api-enosys=%{enosys_stubs}
%make_build
popd
%endif
@ -381,6 +400,7 @@ done
%changelog
* Thu Jan 24 2019 Björn Esser <besser82@fedoraproject.org> - 4.4.3-2
- Fix and simplify the conditionals for the compat package
- Add an option to replace unsafe functions in the compat lib with a stub
* Thu Jan 24 2019 Björn Esser <besser82@fedoraproject.org> - 4.4.3-1
- New upstream release