diff --git a/glibc.spec b/glibc.spec index 42e3c807dcd43382ff9c96c51edcdaa6482bd1e3..585e731482d78272c897fdc98f67cc4bb97ef299 100644 --- a/glibc.spec +++ b/glibc.spec @@ -48,6 +48,8 @@ %undefine with_valgrind %endif +%global ENABLE_RELOC 1 + # Only some architectures have static PIE support %define pie_arches %{ix86} x86_64 aarch64 @@ -65,7 +67,7 @@ ############################################################################## Name: glibc Version: 2.38 -Release: 3 +Release: 4 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -106,6 +108,10 @@ Patch9017: 0001-Optimizing-__random-for-single-threaded-scenarios.patch Patch9018: fix-Segmentation-fault-in-nss-module.patch Patch9019: fix_nss_database_check_reload_and_get_memleak.patch +%if %{ENABLE_RELOC} +Patch9020: reserve-relocation-information-for-sysboost.patch +%endif + Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) BuildRequires: audit-libs-devel >= 1.1.3, sed >= 3.95, libcap-devel, gettext @@ -376,6 +382,19 @@ Currently, provide pthread_condition function. To keep older applications compatible, glibc-compat-2.17 provides libpthread_nonshared.a %endif +%if %{ENABLE_RELOC} +############################################################################## +# glibc reloc sub-package +############################################################################## +%package relocation +Summary: Relocations for %{name} +Requires: %{name} = %{version}-%{release} +BuildRequires: native-turbo-tools + +%description relocation +This package contains relocations for %{name}. +%endif + ############################################################################## # Prepare for the build. ############################################################################## @@ -477,6 +496,9 @@ pushd $builddir { cat config.log; false; } make %{?_smp_mflags} -O -r %{glibc_make_flags} +%if %{ENABLE_RELOC} +objreloc libc.so.6 +%endif popd ############################################################################## @@ -670,6 +692,11 @@ for i in $RPM_BUILD_ROOT%{_prefix}/bin/{xtrace,memusage}; do -i $i done +%if %{ENABLE_RELOC} +mkdir -p ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +install -p ${RPM_BUILD_DIR}/%{name}-%{version}/build-%{target}/libc.so.6.relocation ${RPM_BUILD_ROOT}/usr/lib/relocation/%{_libdir} +%endif + touch master.filelist touch glibc.filelist touch common.filelist @@ -1236,6 +1263,13 @@ fi %attr(0600,root,root) %verify(not md5 size mtime) %ghost %config(missingok,noreplace) /var/db/nscd/services %ghost %config(missingok,noreplace) /etc/sysconfig/nscd +%if %{ENABLE_RELOC} +%files relocation +%dir %attr(500, root, root) /usr/lib/relocation +%dir %attr(500, root, root) /usr/lib/relocation/%{_libdir} +%attr(400, root, root) /usr/lib/relocation/%{_libdir}/libc.so.6.relocation +%endif + %files -f nss_modules.filelist -n nss_modules /var/db/Makefile @@ -1264,6 +1298,9 @@ fi %endif %changelog +* Tue Aug 8 2023 longwei - 2.38-4 +- add libc.so relocation file for sysboost + * Mon Aug 7 2023 zhanghao - 2.38-3 - fix Segmentation fault in nss module - fix nss database check reload and get memleak diff --git a/reserve-relocation-information-for-sysboost.patch b/reserve-relocation-information-for-sysboost.patch new file mode 100644 index 0000000000000000000000000000000000000000..d1650343c5c38bd671c128507c4181418316d8c5 --- /dev/null +++ b/reserve-relocation-information-for-sysboost.patch @@ -0,0 +1,25 @@ +From f5b655b91fd1e59e128c379ccf4712e493e692da Mon Sep 17 00:00:00 2001 +From: l00580197 +Date: Tue, 8 Aug 2023 21:44:38 +0800 +Subject: [PATCH] reserve relocation information for sysboost + +--- + Makerules | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makerules b/Makerules +index 018780c8..a4603f68 100644 +--- a/Makerules ++++ b/Makerules +@@ -534,7 +534,7 @@ lib%.so: lib%_pic.a $(+preinit) $(+postinit) $(link-libc-deps) + $(call after-link,$@) + + define build-shlib-helper +-$(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) \ ++$(LINK.o) -shared -static-libgcc -Wl,-O1 $(sysdep-LDFLAGS) -Wl,--emit-relocs \ + $(if $($(@F)-no-z-defs)$(no-z-defs),,-Wl,-z,defs) $(rtld-LDFLAGS) \ + $(if $($(@F)-no-dt-relr),$(no-dt-relr-ldflag),$(dt-relr-ldflag)) \ + $(extra-B-$(@F:lib%.so=%).so) -B$(csu-objpfx) \ +-- +2.33.0 +