blob: d82f533cb462bda85b58fc854d4112dc4a1f2a8b [file] [log] [blame]
Andrew Geissler09036742021-06-25 14:25:14 -05001Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From ad4c21f0f59b52357019148ec94d767aa2acd8f2 Mon Sep 17 00:00:00 2001
5From: Jonathan Wakely <jwakely@redhat.com>
6Date: Tue, 1 Jun 2021 11:00:16 +0100
7Subject: [PATCH] libstdc++: Fix installation of python hooks [PR 99453]
8
9When no shared library is installed, the new code to determine the name
10of the -gdb.py file yields an empty string. Use the name of the static
11library in that case.
12
13libstdc++-v3/ChangeLog:
14
15 PR libstdc++/99453
16 * python/Makefile.am: Use archive name for printer hook if no
17 dynamic library name is available.
18 * python/Makefile.in: Regenerate.
19
20(cherry picked from commit 9f7bc160b4a0f27dce248d1226e3ae7104b0e67b)
21---
22 libstdc++-v3/python/Makefile.am | 4 ++++
23 libstdc++-v3/python/Makefile.in | 4 ++++
24 2 files changed, 8 insertions(+)
25
26diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am
27index 0c2b207b86e..8efefa5725c 100644
28--- a/libstdc++-v3/python/Makefile.am
29+++ b/libstdc++-v3/python/Makefile.am
30@@ -48,5 +48,9 @@ install-data-local: gdb.py
31 ## the correct name.
32 @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
33 $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
34+ if [ -z "$$libname" ]; then \
35+ libname=`sed -ne "/^old_library=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
36+ $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
37+ fi; \
38 echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
39 $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
40diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
41index 2efe0b96a19..9904a9197de 100644
42--- a/libstdc++-v3/python/Makefile.in
43+++ b/libstdc++-v3/python/Makefile.in
44@@ -609,6 +609,10 @@ install-data-local: gdb.py
45 @$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
46 @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
47 $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
48+ if [ -z "$$libname" ]; then \
49+ libname=`sed -ne "/^old_library=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
50+ $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
51+ fi; \
52 echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
53 $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
54
55--
562.25.1
57