]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: don't clobber old libm.so on install [BZ #19822]
authorDylan Alex Simon <dylan-sourceware@dylex.net>
Tue, 15 Mar 2016 17:20:01 +0000 (13:20 -0400)
committerMike Frysinger <vapier@gentoo.org>
Mon, 21 Mar 2016 06:22:03 +0000 (02:22 -0400)
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
NEWS
math/Makefile

index ba4a3f2f65e8e5d35fb1299aaa246e9d211c10d7..d97d7a513895d0c4a42402979e5055d79a229f04 100644 (file)
--- 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 93c46afa83f72541fcf3ac8588df7723615e6ac4..dbd647cd15617914933644cc3b1221279c3bfc97 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@ Version 2.22.1
 
   17905, 18420, 18421, 18480, 18589, 18743, 18778, 18781, 18787, 18796,
   18870, 18887, 18921, 18928, 18969, 18985, 19003, 19018, 19058, 19174,
-  19178, 19590, 19682.
+  19178, 19590, 19682, 19822.
 
 * The LD_POINTER_GUARD environment variable can no longer be used to
   disable the pointer guard feature.  It is always enabled.
index 2c9d72da0ba7467e15df327b428cc06c1f66f8b7..84b4ded6d97567a1e062984fbc69d48fb93c2d05 100644 (file)
@@ -99,7 +99,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.