Patch updated to conform to recent styleguide checks.
Thanks!
On 05/22/2015 01:14 PM, Michael Haubenwallner wrote:
> To compile 64-bit, AIX toolchain provides support to set the environment
> variable OBJECT_MODE=64, to avoid the need for changing anything else in
> the build environment. However, gcc ignores OBJECT_MODE, and does not
> set it while building gcc itself during its multi-lib build either.
> Also, CC may be some wrapper to operate in 64-bit mode. So we cannot
> rely on OBJECT_MODE being set to properly support 64-bit builds.
>
> Instead, we better identify the object mode in use by looking at the
> file type of an object file generated by CC, to properly set the
> commandline flags for additional tools used within libtool. While there
> is similar code for LD in _LT_ENABLE_LOCK, this is too late for NM.
>
> * m4/libtool.m4 (_LT_CACHE_CHECK_OBJECT_FILE_TYPE): New. Provides object
> file type identified using /usr/bin/file.
> (_LT_PREPARE_TOOLS_ABI_FLAGS): New. Defines func_set_tool_abi_flag.
> Define AIX specific ABI flags for LD, AR, NM, STRIP, RANLIB.
> Set AIX_OBJECT_MODE as well.
> (_LT_SET_TOOL_ABI_FLAG): New. Uses func_set_tool_abi_flag to set host
> specific ABI flags into tool commands.
> (_LT_PROG_AR): Use _LT_SET_TOOL_ABI_FLAG.
> (LT_PATH_LD): Ditto.
> (LT_PATH_NM): Ditto.
> (_LT_CMD_OLD_ARCHIVE): Use _LT_SET_TOOL_ABI_FLAG for STRIP, RANLIB.
> (_LT_LINKER_SHLIBS): Use AIX_OBJECT_MODE.
> (_LT_LANG_CXX_CONFIG): Ditto.
> * m4/ltoptions.m4 (_LT_WITH_AIX_SONAME): Ditto.
>From 84c75ad869c3a8c8e2642ae2272a71b6b18f85d2 Mon Sep 17 00:00:00 2001
From: Michael Haubenwallner
Date: Wed, 20 May 2015 15:42:09 +0200
Subject: [PATCH 2/2] AIX: Do not rely on OBJECT_MODE env var being set.
To compile 64-bit, AIX toolchain provides support to set the environment
variable OBJECT_MODE=64, to avoid the need for changing anything else in
the build environment. However, gcc ignores OBJECT_MODE, and does not
set it while building gcc itself during its multi-lib build either.
Also, CC may be some wrapper to operate in 64-bit mode. So we cannot
rely on OBJECT_MODE being set to properly support 64-bit builds.
Instead, we better identify the object mode in use by looking at the
file type of an object file generated by CC, to properly set the
commandline flags for additional tools used within libtool. While there
is similar code for LD in _LT_ENABLE_LOCK, this is too late for NM.
* m4/libtool.m4 (_LT_CACHE_CHECK_OBJECT_FILE_TYPE): New. Provides object
file type identified using /usr/bin/file.
(_LT_PREPARE_TOOLS_ABI_FLAGS): New. Defines func_set_tool_abi_flag.
Define AIX specific ABI flags for LD, AR, NM, STRIP, RANLIB.
Set AIX_OBJECT_MODE as well.
(_LT_SET_TOOL_ABI_FLAG): New. Uses func_set_tool_abi_flag to set host
specific ABI flags into tool commands.
(_LT_PROG_AR): Use _LT_SET_TOOL_ABI_FLAG.
(LT_PATH_LD): Ditto.
(LT_PATH_NM): Ditto.
(_LT_CMD_OLD_ARCHIVE): Use _LT_SET_TOOL_ABI_FLAG for STRIP, RANLIB.
(_LT_LINKER_SHLIBS): Use AIX_OBJECT_MODE.
(_LT_LANG_CXX_CONFIG): Ditto.
* m4/ltoptions.m4 (_LT_WITH_AIX_SONAME): Ditto.
---
m4/libtool.m4 | 85 +++--
m4/ltoptions.m4 | 3 +-
2 files changed, 84 insertions(+), 4 deletions(-)
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 7b8b591..2c0e657 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1177,6 +1177,80 @@ fi
])# _LT_SYS_MODULE_PATH_AIX
+# _LT_CACHE_CHECK_OBJECT_FILE_TYPE
+#
+# Compiles a minimal program and identifies the file type of that object file.
+# All object files linked together in one build configuration have to be of
+# the same object file type. As we always need the C compiler anyway, there
+# is no point in checking object file types per TAG.
+m4_defun([_LT_CACHE_CHECK_OBJECT_FILE_TYPE],
+[AC_REQUIRE([AC_PROG_CC])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+AC_CACHE_CHECK([$CC object file type], [lt_cv_object_file_type],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+[echo "$as_me:$LINENO: LC_ALL=C /usr/bin/file conftest.$ac_objext" >&AS_MESSAGE_LOG_FD
+lt_cv_object_file_type=`LC_ALL=C /usr/bin/file conftest.$ac_objext 2>&AS_MESSAGE_LOG_FD`
+ac_status=$?
+func_echo_all "$lt_cv_object_file_type" >&AS_MESSAGE_LOG_FD
+func_echo_all "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+lt_cv_object_file_type=`func_echo_all "$lt_cv_object_file_type" | $SED -e "s/^conftest\.$ac_objext: *//"`
+])
+ ])
+]) # _LT_CACHE_CHECK_OBJECT_FILE_TYPE
+
+
+# _LT_PREPARE_TOOLS_ABI_FLAGS
+# ---
+m4_defun([_LT_PREPARE_TOOLS_ABI_FLAGS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+# func_set_tool_abi_flag TOOL [TOOLVAR]
+# Ensure that TOOL-specific command in $TOOL (or $TOOLVAR if specified) does
+# contain $lt_abi_flag_TOOL (if defined below) as standalone argument.
+# Does nothing if $TOOL (or $TOOLVAR) is empty.
+func_set_tool_abi_flag ()
+{
+ eval "AS_CASE([\"