public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: "Arsen Arsenović" <arsen@aarsen.me>
Cc: Bruno Haible <bruno@clisp.org>,
	David Edelsohn <dje.gcc@gmail.com>,
	 GCC Patches <gcc-patches@gcc.gnu.org>,
	bug-gettext@gnu.org
Subject: Re: building GNU gettext on AIX
Date: Fri, 17 Nov 2023 09:33:33 +0100	[thread overview]
Message-ID: <CAFiYyc01shsYvFY6rkhVhLxH4dmqtnnTguBVwKYZN8+wWKW50Q@mail.gmail.com> (raw)
In-Reply-To: <86o7ft70mn.fsf@aarsen.me>

On Fri, Nov 17, 2023 at 12:13 AM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>
> Bruno Haible <bruno@clisp.org> writes:
>
> > Hi David,
> >
> >> the default, distributed libintl library will not allow GCC to be built
> >> with NLS enabled.
> >
> > The problem is this configure test from gettext.m4
> >
> >   checking for GNU gettext in libintl... no
> >
> > It should say
> >
> >   checking for GNU gettext in libintl... yes
> >
> > I reproduce it with simple hello-world package, outside GCC.
> >
> > It tests whether a program that uses gettext() can be linked with
> >   -lintl -liconv
> > But now, on AIX, it needs to test whether such a program can be linked with
> >   -lintl -liconv -lpthread
> >
> >> Were you suggesting that --enable-threads=isoc would work now or that it
> >> would require further changes for a future release?
> >
> > It requires a change, effectively to do as if HAVE_PTHREAD_API is undefined
> > if --enable-threads=isoc was provided.
> >
> > I can prepare a new gettext release that has both issues fixed:
> >   - gettext.m4 that fixes the configure test and sets the variable LIBINTL
> >     to "-Lsome/libdir -lintl -liconv -lpthread",
> >   - mbrtowc.o and setlocale*.o that use mtx_* locks instead of pthread_*
> >     mutexes when requested.
> >
> > But you then need to make up your mind w.r.t. what I wrote in the earlier
> > mail.
> >
> >   * GCC can pass --enable-threads=isoc, to avoid the libpthread dependency
> >     on AIX ≥ 7.2.
>
> Hmm, would that option work everywhere, though?  Or would we have to
> wire up configury to detect which flag to use?  If so, what would it
> look like.

I'd highly recommend the in-tree gettext to be built with thread
support _disabled_,
only a static library built and never installed (but linked statically
into the host
binaries).

So if --disable-threads (or how it is called) does not work you need
to fix _that_.
Likewise if --disable-shared doesn't work correctly on all platforms
you have to fix
that as well.

Richard.

>
> >   * Or GCC can (continue to?) use the variable LIBINTL. This will work on
>
> If you mean the one generated by gettext.m4/uninstalled-config.sh, it is
> utilized today:
>
> LIBS = @LIBS@ libcommon.a $(CPPLIB) $(LIBINTL) $(LIBICONV) $(LIBBACKTRACE) \
>         $(LIBIBERTY) $(LIBDECNUMBER) $(HOST_LIBS)
>
> (from gcc/Makefile.in)
>
>
> >     AIX 7.1 as well but the programs will then be linked against libpthread.
> >     One additional library.
> >     $ ldd gcc
> >     /opt/freeware/bin/gcc needs:
> >          /usr/lib/libc.a(shr.o)
> >          /opt/freeware/lib/libiconv.a(libiconv.so.2)
> >          /usr/lib/libc.a(_shr.o)
> >          /unix
> >          /usr/lib/libcrypt.a(shr.o)
> >          /opt/freeware/lib/libgcc_s.a(shr.o)
> >     libpthread.a will be added to this list.
> >
> >     ibm-clang links against libpthread.a as well:
> >     $ ldd /opt/IBM/openxlC/17.1.1/bin/.ibm-clang.orig
> >     /opt/IBM/openxlC/17.1.1/bin/.ibm-clang.orig needs:
> >          /usr/lib/libpthreads.a(shr_xpg5_64.o)
> >          /usr/opt/zlibNX/lib/libz.a(libz.so.1)
> >          /usr/lib/libcurses.a(shr42_64.o)
> >          /usr/lib/libiconv.a(shr4_64.o)
> >          /usr/lib/libc++.a(shr_64.o)
> >          /usr/lib/libc++abi.a(libc++abi.so.1)
> >          /usr/lib/libc.a(shr_64.o)
> >          /usr/lib/libpthreads.a(_shr_xpg5_64.o)
> >          /usr/lib/libc++.a(libc++.so.1)
> >          /usr/lib/libunwind.a(libunwind.so.1)
> >          /usr/lib/libc.a(_shr_64.o)
> >          /unix
> >          /usr/lib/libcrypt.a(shr_64.o)
>
> David, I'll leave that decision up to you.
>
> > Bruno
>
>
> --
> Arsen Arsenović

  reply	other threads:[~2023-11-17  8:33 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 20:37 [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext David Edelsohn
2023-11-14 23:06 ` Arsen Arsenović
2023-11-15  1:49   ` David Edelsohn
2023-11-15 12:29     ` building GNU gettext on AIX Bruno Haible
2023-11-15 19:26       ` David Edelsohn
2023-11-15 21:22         ` Bruno Haible
2023-11-15 21:31           ` David Edelsohn
2023-11-15 22:39             ` Bruno Haible
2023-11-16 16:00               ` David Edelsohn
2023-11-16 16:35                 ` David Edelsohn
2023-11-16 18:01                   ` David Edelsohn
2023-11-16 18:17                     ` David Edelsohn
2023-11-16 18:52                       ` Bruno Haible
2023-11-16 22:18                         ` David Edelsohn
2023-11-16 22:46                           ` Bruno Haible
2023-11-16 23:10                             ` Arsen Arsenović
2023-11-17  8:33                               ` Richard Biener [this message]
2023-11-17  8:49                                 ` Arsen Arsenović
2023-11-17 12:24                                 ` Bruno Haible
2023-11-17 13:06                                   ` Arsen Arsenović
2023-11-16 23:38                             ` David Edelsohn
2023-11-17  0:07                               ` Bruno Haible
2023-11-17  0:15                                 ` David Edelsohn
     [not found]                 ` <84B39BF1-33D5-488E-8CF5-D08B09417568@gmail.com>
2023-11-16 17:44                   ` David Edelsohn
2023-11-16 18:47                     ` Bruno Haible
2023-11-16 18:50                       ` Arsen Arsenović
2023-11-16 18:59                         ` Bruno Haible
2023-11-16 19:14                           ` Arsen Arsenović
2023-11-19 19:49                       ` Bruno Haible
2023-11-15 14:14     ` [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
2023-11-15 15:51       ` Xi Ruoyao
2023-11-16 18:48         ` Arsen Arsenović
2023-11-15 17:19       ` David Edelsohn
2023-11-16 18:33         ` Arsen Arsenović
2023-11-16 21:11           ` Arsen Arsenović
2023-11-16 21:40             ` David Edelsohn
2023-11-16 22:19               ` Arsen Arsenović
2023-11-16 22:30                 ` David Edelsohn
2023-11-16 22:32                   ` Arsen Arsenović
2023-11-16 23:59                     ` David Edelsohn
2023-11-17  8:34                       ` Arsen Arsenović
2023-11-17  8:50                         ` Richard Biener
2023-11-17  8:56                           ` Arsen Arsenović
2023-11-17 14:41                         ` David Edelsohn
2023-11-17 15:16                           ` Arsen Arsenović
2023-11-17 16:07                             ` David Edelsohn
2023-11-18 18:10                               ` Arsen Arsenović
2023-11-19 21:55                               ` Bruno Haible
2023-11-19 23:00                                 ` Bruno Haible
2023-11-19 23:06                                   ` Andrew Pinski
2023-11-20  1:17                                 ` David Edelsohn
2023-11-20 21:18                                   ` Arsen Arsenović
2023-11-20 21:38                                     ` David Edelsohn
2023-11-21  0:44                                       ` Arsen Arsenović
2023-11-20 23:00                                     ` Bruno Haible
2023-11-21  0:45                                       ` Arsen Arsenović
2023-11-21 13:13                                         ` Arsen Arsenović
2023-11-21 16:28                                           ` David Edelsohn
2023-11-21 20:58                                           ` Eric Gallager
2023-11-15 19:58       ` David Edelsohn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFiYyc01shsYvFY6rkhVhLxH4dmqtnnTguBVwKYZN8+wWKW50Q@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=arsen@aarsen.me \
    --cc=bruno@clisp.org \
    --cc=bug-gettext@gnu.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).