add libpthread_nonshared.a in glibc-compat-2.17 for old applications

Signed-off-by: Yang Yanchao <yangyanchao6@huawei.com>
This commit is contained in:
Yang Yanchao 2022-07-07 15:21:09 +08:00
parent ed9921c92d
commit 3a50155ca7

View File

@ -31,6 +31,9 @@
%bcond_with bootstrap
%bcond_without werror
%bcond_without docs
%ifarch x86_64 aarch64
%bcond_without compat_2_17
%endif
%ifarch %{valgrind_arches}
%bcond_without valgrind
@ -59,7 +62,7 @@
##############################################################################
Name: glibc
Version: 2.28
Release: 89
Release: 90
Summary: The GNU libc libraries
License: %{all_license}
URL: http://www.gnu.org/software/glibc/
@ -433,6 +436,17 @@ Requires: man info
%description help
This package provides al doc and man files of %{name}
##############################################################################
# glibc compat-2.17 sub-package
##############################################################################
%if %{with compat_2_17}
%package compat-2.17
Summary: provides pthread library with glibc-2.17
%description compat-2.17
To keep older applications compatible, glibc-compat-2.17 provides libpthread_nonshared.a
%endif
##############################################################################
# Prepare for the build.
##############################################################################
@ -605,6 +619,12 @@ install -p -m 644 %{SOURCE3} $RPM_BUILD_ROOT/etc/nsswitch.conf
mkdir -p $RPM_BUILD_ROOT/etc/default
install -p -m 644 nis/nss $RPM_BUILD_ROOT/etc/default/nss
%if %{with compat_2_17}
# Build an empty libpthread_nonshared.a for compatiliby with applications
# that have old linker scripts that reference this file.
ar cr $RPM_BUILD_ROOT/%{_prefix}/%{_lib}/libpthread_nonshared.a
%endif
# This is for ncsd - in glibc 2.2
install -m 644 nscd/nscd.conf $RPM_BUILD_ROOT/etc
mkdir -p $RPM_BUILD_ROOT%{_tmpfilesdir}
@ -739,6 +759,9 @@ touch libnsl.filelist
touch debugutils.filelist
touch benchtests.filelist
touch debuginfo.filelist
%if %{with compat_2_17}
touch compat-2.17.filelist
%endif
{
find $RPM_BUILD_ROOT \( -type f -o -type l \) \
@ -765,6 +788,9 @@ touch debuginfo.filelist
-e '\,.*/share/i18n/charmaps/.*,d' \
-e '\,.*/etc/\(localtime\|nsswitch.conf\|ld\.so\.conf\|ld\.so\.cache\|default\|rpc\|gai\.conf\),d' \
-e '\,.*/%{_libdir}/lib\(pcprofile\|memusage\)\.so,d' \
%if %{with compat_2_17}
-e '\,.*%{_libdir}/libpthread_nonshared.a,d' \
%endif
-e '\,.*/bin/\(memusage\|mtrace\|xtrace\|pcprofiledump\),d'
} | sort > master.filelist
@ -938,6 +964,14 @@ for d in $(echo $remove_dir | sed 's/ /\n/g'); do
sed -i "\|^%%dir $d/\?$|d" debuginfo.filelist
done
%endif # %{with benchtests}
%if %{with compat_2_17}
##############################################################################
# glibc compat-2.17 sub-package
##############################################################################
echo "%{_libdir}/libpthread_nonshared.a" >> compat-2.17.filelist
%endif
##############################################################################
# Run the glibc testsuite
# If any tests fail to build we exit %check with an error, otherwise
@ -1174,7 +1208,14 @@ fi
#Doc of nss_modules sub-package
%doc hesiod/README.hesiod
%if %{with compat_2_17}
%files -f compat-2.17.filelist compat-2.17
%endif
%changelog
* Thu Jul 7 2022 Yang Yanchao <yangyanchao6@huawei.com> - 2.28-90
- add libpthread_nonshared.a in glibc-compat-2.17 for old applications
* Tue May 10 2022 xujing <xujing125@huawei.com> - 2.28-89
- elf: Fix initial-exec TLS access on audit modules (BZ #28096)