0001-Upstream-Status-Backport.patch 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. From b93236bd8cd749196e787a9d36bcd09e673b3604 Mon Sep 17 00:00:00 2001
  2. From: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  3. Date: Mon, 22 Nov 2021 00:13:28 +0800
  4. Subject: [PATCH 1/1] Upstream-Status: Backport Signed-off-by: Ross Burton
  5. <ross.burton@arm.com>
  6. From ad4c21f0f59b52357019148ec94d767aa2acd8f2 Mon Sep 17 00:00:00 2001
  7. From: Jonathan Wakely <jwakely@redhat.com>
  8. Date: Tue, 1 Jun 2021 11:00:16 +0100
  9. Subject: [PATCH] libstdc++: Fix installation of python hooks [PR 99453]
  10. When no shared library is installed, the new code to determine the name
  11. of the -gdb.py file yields an empty string. Use the name of the static
  12. library in that case.
  13. libstdc++-v3/ChangeLog:
  14. PR libstdc++/99453
  15. * python/Makefile.am: Use archive name for printer hook if no
  16. dynamic library name is available.
  17. * python/Makefile.in: Regenerate.
  18. (cherry picked from commit 9f7bc160b4a0f27dce248d1226e3ae7104b0e67b)
  19. Signed-off-by: Jun Yuan Tan <junyuan.tan@starfivetech.com>
  20. ---
  21. libstdc++-v3/python/Makefile.am | 24 ++++++++----------------
  22. libstdc++-v3/python/Makefile.in | 18 ++++++------------
  23. 2 files changed, 14 insertions(+), 28 deletions(-)
  24. diff --git a/libstdc++-v3/python/Makefile.am b/libstdc++-v3/python/Makefile.am
  25. index 01517a2a522..8efefa5725c 100644
  26. --- a/libstdc++-v3/python/Makefile.am
  27. +++ b/libstdc++-v3/python/Makefile.am
  28. @@ -44,21 +44,13 @@ gdb.py: hook.in Makefile
  29. install-data-local: gdb.py
  30. @$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
  31. ## We want to install gdb.py as SOMETHING-gdb.py. SOMETHING is the
  32. -## full name of the final library. We want to ignore symlinks, the
  33. -## .la file, and any previous -gdb.py file. This is inherently
  34. -## fragile, but there does not seem to be a better option, because
  35. -## libtool hides the real names from us.
  36. - @here=`pwd`; cd $(DESTDIR)$(toolexeclibdir); \
  37. - for file in libstdc++.*; do \
  38. - case $$file in \
  39. - *-gdb.py) ;; \
  40. - *.la) ;; \
  41. - *) if test -h $$file; then \
  42. - continue; \
  43. - fi; \
  44. - libname=$$file;; \
  45. - esac; \
  46. - done; \
  47. - cd $$here; \
  48. +## full name of the final library. We use the libtool .la file to get
  49. +## the correct name.
  50. + @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
  51. + $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
  52. + if [ -z "$$libname" ]; then \
  53. + libname=`sed -ne "/^old_library=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
  54. + $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
  55. + fi; \
  56. echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
  57. $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
  58. diff --git a/libstdc++-v3/python/Makefile.in b/libstdc++-v3/python/Makefile.in
  59. index c35dbe55961..9904a9197de 100644
  60. --- a/libstdc++-v3/python/Makefile.in
  61. +++ b/libstdc++-v3/python/Makefile.in
  62. @@ -607,18 +607,12 @@ gdb.py: hook.in Makefile
  63. install-data-local: gdb.py
  64. @$(mkdir_p) $(DESTDIR)$(toolexeclibdir)
  65. - @here=`pwd`; cd $(DESTDIR)$(toolexeclibdir); \
  66. - for file in libstdc++.*; do \
  67. - case $$file in \
  68. - *-gdb.py) ;; \
  69. - *.la) ;; \
  70. - *) if test -h $$file; then \
  71. - continue; \
  72. - fi; \
  73. - libname=$$file;; \
  74. - esac; \
  75. - done; \
  76. - cd $$here; \
  77. + @libname=`sed -ne "/^library_names=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
  78. + $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
  79. + if [ -z "$$libname" ]; then \
  80. + libname=`sed -ne "/^old_library=/{s/.*='//;s/'$$//;s/ .*//;p;}" \
  81. + $(DESTDIR)$(toolexeclibdir)/libstdc++.la`; \
  82. + fi; \
  83. echo " $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py"; \
  84. $(INSTALL_DATA) gdb.py $(DESTDIR)$(toolexeclibdir)/$$libname-gdb.py
  85. --
  86. 2.33.1