]> 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>
Sat, 12 Nov 2016 05:44:21 +0000 (00:44 -0500)
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)
(cherry picked from commit 73f158cef52f3968e0b9a7785638cf1737c35306)

math/Makefile

index 7d573a0074ff79c84c7fa2c95a148ad7f714515c..6aa87f95283a97ef6b537216c52a32b4d3c767ae 100644 (file)
@@ -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.