[COMMITTED/2.23] math: don't clobber old libm.so on install [BZ #19822]
Mike Frysinger
vapier@gentoo.org
Fri Jan 1 00:00:00 GMT 2016
From: Dylan Alex Simon <dylan-sourceware@dylex.net>
When installing glibc (w/mathvec enabled) in-place on a system with
a glibc w/out mathvec enabled, the install will clobber the existing
libm.so (e.g., /lib64/libm-2.21.so) with a linker script. This is
because libm.so is a symlink to libm.so.6 which is a symlink to the
final libm-2.21.so file. When the makefile writes the linker script
directly to libm.so, it gets clobbered.
The simple patch below to math/Makefile fixes this. It is based on
the nptl Makefile, which does exactly the same thing in a safer way.
(cherry picked from commit f9378ac3773ffe998a2b3406568778ee9f77f759)
---
ChangeLog | 6 ++++++
NEWS | 1 +
math/Makefile | 3 ++-
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 8f5b28f..70553ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-03-21 Dylan Alex Simon <dylan-sourceware@dylex.net>
+
+ [BZ #19822]
+ * math/Makefile ($(inst_libdir)/libm.so): Write output to $@.tmp and
+ move it to the final $@ location.
+
2016-03-15 Andreas Schwab <schwab@suse.de>
[BZ #19257]
diff --git a/NEWS b/NEWS
index 228a481..db5ee12 100644
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ The following bugs are resolved with this release:
[19759] Don't inline mempcpy for x86
[19762] Use HAS_ARCH_FEATURE with Fast_Rep_String
[19792] MIPS: backtrace yields infinite backtrace with makecontext
+ [19822] libm.so install clobbers old version
Version 2.23
diff --git a/math/Makefile b/math/Makefile
index 7d573a0..6aa87f9 100644
--- a/math/Makefile
+++ b/math/Makefile
@@ -100,7 +100,8 @@ $(inst_libdir)/libm.so: $(common-objpfx)format.lds \
cat $<; \
echo 'GROUP ( $(slibdir)/libm.so$(libm.so-version) ' \
'AS_NEEDED ( $(libdir)/libmvec_nonshared.a $(slibdir)/libmvec.so$(libmvec.so-version) ) )' \
- ) > $@
+ ) > $@.new
+ mv -f $@.new $@
endif
# Rules for the test suite.
--
2.7.4
More information about the Libc-stable
mailing list