[PATCH 1/2] libstdc++: skip AIX fat-archive repackage for single-arch builds

hugo@beauzee.fr hugo@beauzee.fr
Wed Sep 30 13:21:10 GMT 2026


From: Hugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com>

GNU binutils' ar cannot build AIX dual 32/64-bit archives, so the
32/64 combine in the top-level MULTIBUILDTOP recipe corrupts the
default-arch libstdc++ for a single-arch cross build with GNU binutils.

libstdc++-v3/ChangeLog:

	* config/os/aix/t-aix: Skip the 32/64 fat-archive repackage
	when MULTIDIRS is empty.

Assisted-by: Claude (claude-sonnet-5)
Signed-off-by: Hugo Beauzée-Luyssen <hugo.beauzee@datadoghq.com>
---
 libstdc++-v3/config/os/aix/t-aix | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libstdc++-v3/config/os/aix/t-aix b/libstdc++-v3/config/os/aix/t-aix
index 6676620a7e9..ae1f36c3121 100644
--- a/libstdc++-v3/config/os/aix/t-aix
+++ b/libstdc++-v3/config/os/aix/t-aix
@@ -1,11 +1,14 @@
 ifeq ($(MULTIBUILDTOP),)
+ifneq ($(MULTIDIRS),)
 BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
     echo '64'; else echo '32'; fi)
 MAJOR=$(firstword $(subst :, ,$(libtool_VERSION)))
 ARX=$(shell echo $(AR) | sed -e 's/-X[^ ]*//g')
 SUPOBJS=$(shell $(ARX) -X$(BITS) t ../ppc$(BITS)/$(PACKAGE)-v3/libsupc++/.libs/libsupc++.a)
 FSOBJS=$(shell $(ARX) -X$(BITS) t ../ppc$(BITS)/$(PACKAGE)-v3/src/filesystem/.libs/libstdc++fs.a 2>/dev/null)
+endif
 all-local:
+ifneq ($(MULTIDIRS),)
 	$(ARX) -X$(BITS) rc src/.libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)-v3/src/.libs/$(PACKAGE).so.$(MAJOR)
 	$(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)-v3/src/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)-v3/src/.libs/$(PACKAGE).so.$(MAJOR)
 	$(ARX) -X$(BITS) rc libsupc++/.libs/libsupc++.a ${addprefix ../ppc$(BITS)/$(PACKAGE)-v3/libsupc++/,$(SUPOBJS)}
@@ -15,3 +18,4 @@ all-local:
 		$(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)-v3/src/filesystem/.libs/libstdc++fs.a ${addprefix ../pthread/ppc$(BITS)/$(PACKAGE)-v3/src/filesystem/,$(FSOBJS)}; \
 	fi
 endif
+endif
-- 
2.43.0




More information about the Libstdc++ mailing list