bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: building GNU gettext on AIX


From: David Edelsohn
Subject: Re: building GNU gettext on AIX
Date: Wed, 15 Nov 2023 14:26:20 -0500

When I try to configure gettext-0.22.3, I receive the following error:

checking for socklen_t equivalent... configure: error: Cannot find a type to use in place of socklen_t

configure: error: /nasfarm/edelsohn/src/gettext-0.22.3/libtextstyle/configure failed for libtextstyle


configure:43943: /nasfarm/edelsohn/install/GCC12/bin/gcc -c -g -O2  -D_THREAD_SAFE conftest.c >&5

conftest.c:112:18: error: two or more data types in declaration specifiers

  112 | #define intmax_t long long

      |                  ^~~~

conftest.c:112:23: error: two or more data types in declaration specifiers

  112 | #define intmax_t long long

      |                       ^~~~

In file included from conftest.c:212:

conftest.c:214:24: error: conflicting types for 'ngetpeername'; have 'int(int,  void *, long unsigned int *)'

  214 |                    int getpeername (int, void *, unsigned long int *);

      |                        ^~~~~~~~~~~

/nasfarm/edelsohn/install/GCC12/lib/gcc/powerpc-ibm-aix7.2.5.0/12.1.1/include-fixed/sys/socket.h:647:9: note: previous declaration of 'ngetpeername' with type 'int(int,  struct sockaddr * restrict,  socklen_t * restrict)' {aka 'int(int,  struct sockaddr * restrict,  long unsigned int * restrict)'}

  647 | int     getpeername(int, struct sockaddr *__restrict__, socklen_t *__restrict__);

      |         ^~~~~~~~~~~


configure and config.h seems to get itself confused about types.


David



On Wed, Nov 15, 2023 at 7:29 AM Bruno Haible <bruno@clisp.org> wrote:
[CCing bug-gettext]

David Edelsohn wrote in
<https://gcc.gnu.org/pipermail/gcc-patches/2023-November/636558.html>:
> The current gettext-0.22.3 fails to build for me on AIX.

Here are some hints to get a successful build of GNU gettext on AIX:

1. Set the recommended environment variables before running configure:
   https://gitlab.com/ghwiki/gnow-how/-/wikis/Platforms/Configuration

   Namely:
   * for a 32-bit build with gcc:
     CC=gcc
     CXX=g++
     CPPFLAGS="-I$PREFIX/include"
     LDFLAGS="-L$PREFIX/lib"
     unset AR NM
   * for a 32-bit build with xlc:
     CC="xlc -qthreaded -qtls"
     CXX="xlC -qthreaded -qtls"
     CPPFLAGS="-I$PREFIX/include"
     LDFLAGS="-L$PREFIX/lib"
     unset AR NM
   * for a 64-bit build with gcc:
     CC="gcc -maix64"
     CXX="g++ -maix64"
     CPPFLAGS="-I$PREFIX/include"
     LDFLAGS="-L$PREFIX/lib"
     AR="ar -X 64"; NM="nm -X 64 -B"
   * for a 64-bit build with xlc:
     CC="xlc -q64 -qthreaded -qtls"
     CXX="xlC -q64 -qthreaded -qtls"
     CPPFLAGS="-I$PREFIX/include"
     LDFLAGS="-L$PREFIX/lib"
     AR="ar -X 64"; NM="nm -X 64 -B"

   where $PREFIX is the value that you pass to the --prefix configure option.

   Rationale: you can run into all sorts of problems if you choose compiler
   options at random and haven't experience with compiler options on that
   platform.

2. Don't use ibm-clang.

   Rationale: It's broken.

3. Don't use -Wall with gcc 10.3.

   Rationale: If you specify -Wall, gettext's configure adds -fanalyzer, which
   has excessive memory requirements in gcc 10.x. In particular, on AIX, it
   makes cc1 crash while compiling regex.c after it has consumed 1 GiB of RAM.

4. Avoid using a --prefix that contains earlier installations of the same
   package.

   Rationale: Because the AIX linker hardcodes directory names in shared
   libraries, GNU libtool has a peculiar configuration on AIX. It ends up
   mixing the in-build-tree libraries with the libraries in the install
   locations, leading to all sorts of errors.

   If you really need to use a --prefix that contains an earlier
   installation of the same package:
     - Either use --disable-shared and remove libgettextlib.a and
       libgettextsrc.a from $PREFIX/lib before starting the build.
     - Or use a mix of "make -k", "make -k install" and ad-hoc workarounds
       that cannot be described in a general way.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]