This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] math/Makefile: don't clobber old libm.so on install [BZ #19822]
- From: Dylan Alex Simon <dylan-sourceware at dylex dot net>
- To: libc-alpha at sourceware dot org
- Date: Tue, 15 Mar 2016 13:20:01 -0400
- Subject: [PATCH] math/Makefile: don't clobber old libm.so on install [BZ #19822]
- Authentication-results: sourceware.org; auth=none
When installing glibc >= 2.22 in-place on a x86_64-pc-linux system with glibc
<= 2.21, the install will clobber the existing libm.so (e.g.,
/lib64/libm-2.21.so) with a linker script. As a result, anything depending on
libm will fail to run (and running processes will segfault) and the install
fails. This is because the makefile writes the linker script directly to
/lib64/libm.so.6, which is a symlink.
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.
I can confirm that without this patch a glibc 2.22 or 2.23 "make install"
renders my system unusable, but with it 2.23 installs just fine. (I note that
by the time the install is finished, libm.so.6 is a symlink again, presumably
from ldconfig, so I'm not exactly sure why it's making a linker script.)
---
diff -u math/Makefile
--- a/math/Makefile 2016/02/18 17:54:00 1.1
+++ b/math/Makefile 2016/03/11 01:31:41
@@ -100,7 +100,8 @@
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.