diff --git a/glibc.spec b/glibc.spec index e37b5bddfd7f6dd5da878e476ec5591641a53ecb..9d54c758e65fcdbd7b85241fbcf7951361d02c56 100644 --- a/glibc.spec +++ b/glibc.spec @@ -41,6 +41,8 @@ %bcond_with valgrind %endif +%global ENABLE_RELOC 1 + %if %{with bootstrap} %undefine with_benchtests %undefine with_werror @@ -65,7 +67,7 @@ ############################################################################## Name: glibc Version: 2.36 -Release: 17 +Release: 18 Summary: The GNU libc libraries License: %{all_license} URL: http://www.gnu.org/software/glibc/ @@ -114,6 +116,9 @@ Patch9013: x86-use-total-l3cache-for-non_temporal_threshold.patch Patch9014: strcmp-delete-align-for-loop_aligned.patch Patch9015: add-pthread_cond_clockwait-GLIBC_2_28.patch Patch9016: add-GB18030-2022-charmap-BZ-30243.patch +%if %{ENABLE_RELOC} +Patch9017: sysboost-Retain-relocation-information-for-sysboost.patch +%endif Provides: ldconfig rtld(GNU_HASH) bundled(gnulib) @@ -385,6 +390,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. ############################################################################## @@ -486,6 +504,9 @@ pushd $builddir { cat config.log; false; } make %{?_smp_mflags} -O -r %{glibc_make_flags} +%if %{ENABLE_RELOC} +objreloc libc.so.6 +%endif popd ############################################################################## @@ -679,6 +700,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 -m 400 ${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 @@ -1272,7 +1298,15 @@ fi %files -f compat-2.17.filelist compat-2.17 %endif +%if %{ENABLE_RELOC} +%files relocation +/usr/lib/relocation/%{_libdir}/libc.so.6.relocation +%endif + %changelog +* Wed Jul 12 2023 liutie - 2.36-18 +- malloc: libc.so: create reloc for sysboost + * Tue Jul 11 2023 lijianglin - 2.36-17 - add the test of the entire GB18030 charmap diff --git a/sysboost-Retain-relocation-information-for-sysboost.patch b/sysboost-Retain-relocation-information-for-sysboost.patch new file mode 100644 index 0000000000000000000000000000000000000000..f83ff925e8bab1bd5c0b823cebe0b86006c1eb55 --- /dev/null +++ b/sysboost-Retain-relocation-information-for-sysboost.patch @@ -0,0 +1,34 @@ +From 2e19fce683b277f569f84fb02d474d13b54cf902 Mon Sep 17 00:00:00 2001 +From: c30027328 +Date: Wed, 12 Jul 2023 09:33:49 +0800 +Subject: [PATCH] Retain relocation information for sysboost + +--- + Makerules | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Makerules b/Makerules +index 09c0cf83..4aedced6 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) \ +@@ -552,7 +552,7 @@ else + # binutils only position loadable notes into the first page for binaries, + # not for shared objects + $(common-objpfx)shlib.lds: $(common-objpfx)config.make $(..)Makerules +- $(LINK.o) -shared -Wl,-O1 \ ++ $(LINK.o) -shared -Wl,-O1 -Wl,--emit-relocs \ + -nostdlib -nostartfiles \ + $(sysdep-LDFLAGS) $(rtld-LDFLAGS) $(LDFLAGS.so) \ + -Wl,--verbose 2>/dev/null | \ +-- +2.33.0 +