From 1dfe9b28e617dcc705aaaae922417e2783f870f2 Mon Sep 17 00:00:00 2001
From: Keith Marshall <keith.marshall@mailinator.com>
Date: Fri, 15 Nov 2019 12:21:51 +0000
Subject: Make install-strip target work for libobjc

See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54720
	libobjc install-strip target not populated
---
 libobjc/Makefile.in | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libobjc/Makefile.in b/libobjc/Makefile.in
index 8375f6f99510..be2e4d222367 100644
--- a/libobjc/Makefile.in
+++ b/libobjc/Makefile.in
@@ -308,7 +308,8 @@
 $(srcdir)/aclocal.m4: @MAINT@ $(aclocal_deps)
 	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
 
-install: install-libs install-headers
+install-strip: INSTALL_STRIP_FLAG = -s
+install install-strip: install-libs install-headers
 
 install-libs: installdirs
 	$(SHELL) $(multi_basedir)/mkinstalldirs $(DESTDIR)$(toolexeclibdir)

Inspired by above patch:
------------------------
I created this libtool patch, for all libraries we install.
Old patch was broken, the 32bit libobjc was not strpped at all.
The --strip-unneeded option of the GNU strip command strips everythng
from the target libs. Therefore one can't use nm on the installed libs
to lookup any symbols. Options: --keep-section-symbols --keep-file-symbols
remove most space out of shared libs, but retain these tables, for lookup
purposes, however libs still show unstripped using the file command.
Above portion of the libobjc Makefile still needs to be here, because
otherwise no headers/libs from libobjc will be installed.
I will try to get this integrated into main gcc-tree, because the need
for this is alredy documented there.

--- gcc-releases-gcc-13.4.0/libstdc++-v3/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libstdc++-v3/configure	2026-06-29 13:16:09.445877700 +0200
@@ -12428,7 +12428,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libatomic/configure.orig	2025-06-05 18:05:01.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libatomic/configure	2026-06-29 13:09:31.474240700 +0200
@@ -11645,7 +11645,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libgfortran/configure.orig	2025-06-05 18:05:01.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libgfortran/configure	2026-06-29 13:10:10.087168900 +0200
@@ -13030,7 +13030,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libgo/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libgo/configure	2026-06-29 13:10:44.439033100 +0200
@@ -11783,7 +11783,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libgomp/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libgomp/configure	2026-06-29 13:11:19.904302400 +0200
@@ -11658,7 +11658,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libitm/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libitm/configure	2026-06-29 13:11:50.358407800 +0200
@@ -12321,7 +12321,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libobjc/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libobjc/configure	2026-06-29 13:12:23.240636700 +0200
@@ -11035,7 +11035,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libquadmath/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libquadmath/configure	2026-06-29 13:12:51.917555800 +0200
@@ -11069,7 +11069,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libsanitizer/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libsanitizer/configure	2026-06-29 13:13:19.359292300 +0200
@@ -12622,7 +12622,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
--- gcc-releases-gcc-13.4.0/libssp/configure.orig	2025-06-05 18:03:58.000000000 +0200
+++ gcc-releases-gcc-13.4.0/libssp/configure	2026-06-29 13:13:50.489038300 +0200
@@ -11255,7 +11255,7 @@
 $as_echo_n "checking whether stripping libraries is possible... " >&6; }
 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
   test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
-  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  test -z "$striplib" && striplib="$STRIP --keep-section-symbols --keep-file-symbols"
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
 $as_echo "yes" >&6; }
 else
