aix: Add FAT library support for libffi for AIX
Commit Message
Even if GCC64 is able to boostrap without libffi being a
FAT library on AIX, the tests for "-maix32" are not working
without it.
libffi/ChangeLog:
2021-10-21 Clément Chigot <clement.chigo@atos.net>
* Makefile.am (tmake_file): Build and install AIX-style FAT
libraries.
* Makefile.in: Regenerate.
* include/Makefile.in: Regenerate.
* man/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* configure (tmake_file): Substitute.
* configure.ac: Regenerate.
* configure.host (powerpc-*-aix*): Define tmake_file.
* src/powerpc/t-aix: New file.
I've already made a PR to libffi itself in order to add the common part of
this patch to it. But for now, it's still unmerged:
https://github.com/libffi/libffi/pull/661.
Clément
Comments
> Even if GCC64 is able to boostrap without libffi being a
> FAT library on AIX, the tests for "-maix32" are not working
> without it.
>
> libffi/ChangeLog:
> 2021-10-21 Clément Chigot <clement.chigo@atos.net>
>
> * Makefile.am (tmake_file): Build and install AIX-style FAT
> libraries.
> * Makefile.in: Regenerate.
> * include/Makefile.in: Regenerate.
> * man/Makefile.in: Regenerate.
> * testsuite/Makefile.in: Regenerate.
> * configure (tmake_file): Substitute.
> * configure.ac: Regenerate.
> * configure.host (powerpc-*-aix*): Define tmake_file.
> * src/powerpc/t-aix: New file.
>
> I've already made a PR to libffi itself in order to add the common part of
> this patch to it. But for now, it's still unmerged:
> https://github.com/libffi/libffi/pull/661.
Gentle ping,
Thanks
Clément
From 9722d209326b84d8817c1ae654190bdc6b546690 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?= <clement.chigot@atos.net>
Date: Thu, 21 Oct 2021 09:07:04 +0200
Subject: [PATCH] aix: Add FAT library support for libffi for AIX
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Even if GCC64 is able to boostrap without libffi being a
FAT library on AIX, the tests for "-maix32" are not working
without it.
libffi/ChangeLog:
2021-10-21 Clément Chigot <clement.chigo@atos.net>
* Makefile.am (tmake_file): Build and install AIX-style FAT
libraries.
* Makefile.in: Regenerate.
* include/Makefile.in: Regenerate.
* man/Makefile.in: Regenerate.
* testsuite/Makefile.in: Regenerate.
* configure (tmake_file): Substitute.
* configure.ac: Regenerate.
* configure.host (powerpc-*-aix*): Define tmake_file.
* src/powerpc/t-aix: New file.
---
libffi/Makefile.am | 3 +++
libffi/Makefile.in | 4 ++++
libffi/configure | 17 +++++++++++++++--
libffi/configure.ac | 12 ++++++++++++
libffi/configure.host | 2 ++
libffi/include/Makefile.in | 1 +
libffi/man/Makefile.in | 1 +
libffi/src/powerpc/t-aix | 14 ++++++++++++++
libffi/testsuite/Makefile.in | 1 +
9 files changed, 53 insertions(+), 2 deletions(-)
create mode 100644 libffi/src/powerpc/t-aix
@@ -228,4 +228,7 @@ clean-recursive: clean-multi
distclean-recursive: distclean-multi
maintainer-clean-recursive: maintainer-clean-multi
+# target overrides
+-include $(tmake_file)
+
include $(top_srcdir)/../multilib.am
@@ -439,6 +439,7 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
+tmake_file = @tmake_file@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
@@ -1931,6 +1932,9 @@ clean-recursive: clean-multi
distclean-recursive: distclean-multi
maintainer-clean-recursive: maintainer-clean-multi
+# target overrides
+-include $(tmake_file)
+
# GNU Make needs to see an explicit $(MAKE) variable in the command it
# runs to enable its job server during parallel builds. Hence the
# comments below.
@@ -644,6 +644,7 @@ LIBFFI_BUILD_VERSIONED_SHLIB_FALSE
LIBFFI_BUILD_VERSIONED_SHLIB_TRUE
OPT_LDFLAGS
SECTION_LDFLAGS
+tmake_file
toolexeclibdir
toolexecdir
FFI_DEBUG_FALSE
@@ -11481,7 +11482,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11484 "configure"
+#line 11485 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -11587,7 +11588,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11590 "configure"
+#line 11591 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -16384,6 +16385,18 @@ esac
+# Conditionalize the makefile for this target machine.
+tmake_file_=
+for f in ${tmake_file}
+do
+ if test -f ${srcdir}/src/$TARGETDIR/$f
+ then
+ tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f"
+ fi
+done
+tmake_file="${tmake_file_}"
+
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
@@ -403,6 +403,18 @@ esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
+# Conditionalize the makefile for this target machine.
+tmake_file_=
+for f in ${tmake_file}
+do
+ if test -f ${srcdir}/src/$TARGETDIR/$f
+ then
+ tmake_file_="${tmake_file_} \$(srcdir)/src/$TARGETDIR/$f"
+ fi
+done
+tmake_file="${tmake_file_}"
+AC_SUBST(tmake_file)
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
@@ -207,6 +207,8 @@ case "${host}" in
;;
powerpc-*-aix* | rs6000-*-aix*)
TARGET=POWERPC_AIX; TARGETDIR=powerpc
+ # Create AIX-style "FAT" libraries.
+ tmake_file="t-aix"
;;
powerpc-*-freebsd* | powerpc-*-openbsd* | powerpc-*-netbsd*)
TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc
@@ -311,6 +311,7 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
+tmake_file = @tmake_file@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
@@ -293,6 +293,7 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
+tmake_file = @tmake_file@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
new file mode 100644
@@ -0,0 +1,14 @@
+ifeq ($(MULTIBUILDTOP),)
+BITS=$(shell if test -z "`$(CC) -x c -E /dev/null -g3 -o - | grep 64BIT`" ; then \
+ echo '64'; else echo '32'; fi)
+ARX=$(shell echo $(AR) | sed -e 's/-X[^ ]*//g')
+LIBTOOL_VERSION_CURRENT=$(firstword $(subst :, ,$(shell grep -v '^\#' $(srcdir)/libtool-version)))
+LIBTOOL_VERSION_AGE=$(lastword $(subst :, ,$(shell grep -v '^\#' $(srcdir)/libtool-version)))
+MAJOR=$(shell echo $(LIBTOOL_VERSION_CURRENT)-$(LIBTOOL_VERSION_AGE) | bc)
+all-local: $(toolexeclib_LTLIBRARIES)
+ -rm -f .libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a
+ $(AR) rc .libs/$(PACKAGE).a .libs/$(PACKAGE).so.$(MAJOR)
+ $(AR) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
+ $(ARX) -X$(BITS) rc .libs/$(PACKAGE).a ../ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
+ $(ARX) -X$(BITS) rc ../pthread/$(PACKAGE)/.libs/$(PACKAGE).a ../pthread/ppc$(BITS)/$(PACKAGE)/.libs/$(PACKAGE).so.$(MAJOR)
+endif
\ No newline at end of file
@@ -266,6 +266,7 @@ target_alias = @target_alias@
target_cpu = @target_cpu@
target_os = @target_os@
target_vendor = @target_vendor@
+tmake_file = @tmake_file@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
top_build_prefix = @top_build_prefix@
--
2.33.0