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
* 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
From 9722d209326b84d8817c1ae654190bdc6b546690 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Chigot?=
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
* 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
diff --git a/libffi/Makefile.am b/libffi/Makefile.am
index 02e36176c67..c671444c57c 100644
--- a/libffi/Makefile.am
+++ b/libffi/Makefile.am
@@ -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
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index 6ff0c67a779..86eb1104f94 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -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.
diff --git a/libffi/configure b/libffi/configure
index 4bababb87f5..9550a0906eb 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -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
diff --git a/libffi/configure.ac b/libffi/configure.ac
index bff5a1e7189..71777ea9b11 100644
--- a/libffi/configure.ac
+++ b/libffi/configure.ac
@@ -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/$