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