On AIX 7.2, for a 64-bit build, the environment variable AR needs to be set
to 'ar -X 64', see
https://gitlab.com/ghwiki/gnow-how/-/wikis/Platforms/Configuration .

This is what I have done, and nevertheless the groff build fails:

$ make
...
  GEN      src/utils/lookbib/lookbib.1
        make  all-am
  AR       libdriver.a
ar: 0707-126 src/libs/libdriver/input.o is not valid with the current object 
file mode.
        Use the -X option to specify the desired object mode.
ar: 0707-126 src/libs/libdriver/printer.o is not valid with the current object 
file mode.
        Use the -X option to specify the desired object mode.
make: 1254-004 The error code from the last command is 2.

Passing V=1 to see the details:

$ make V=1
        make  all-am
        rm -f libdriver.a
        ar cr libdriver.a src/libs/libdriver/input.o  
src/libs/libdriver/printer.o
ar: 0707-126 src/libs/libdriver/input.o is not valid with the current object 
file mode.
        Use the -X option to specify the desired object mode.
ar: 0707-126 src/libs/libdriver/printer.o is not valid with the current object 
file mode.
        Use the -X option to specify the desired object mode.
make: 1254-004 The error code from the last command is 2.


This is caused by the line in Makefile.am:
AR=ar

config.status contains the correct value:
S["AR"]="ar -X 64"

The attached patch will fix it.

>From 65a86224ee31f0008ae77d6a107c04c93b4364d5 Mon Sep 17 00:00:00 2001
From: Bruno Haible <br...@clisp.org>
Date: Mon, 6 Mar 2023 01:11:19 +0100
Subject: [PATCH] build: Fix build failure on AIX in 64-bit mode.

* Makefile.am (AR): Remove hardcoded value. Let Automake use the value from
config.status.
---
 Makefile.am | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index a5d8907f4..f7ab4107e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright (C) 1989-2020 Free Software Foundation, Inc.
+# Copyright (C) 1989-2023 Free Software Foundation, Inc.
 # Original Makefile.in written by James Clark (j...@jclark.com)
 # Migrated to Automake by Bertrand Garrigues
 #
@@ -449,6 +449,7 @@ CCC=@CXX@
 # LIBS
 # LIBM
 # LIBICONV
+# AR
 # RANLIB
 # INSTALL
 # INSTALL_PROGRAM
@@ -457,7 +458,6 @@ CCC=@CXX@
 # INSTALL_INFO
 # LN_S
 
-AR=ar
 ETAGS=etags
 ETAGSFLAGS=
 # Flag that tells etags to assume C++.
-- 
2.34.1

Reply via email to