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: Arsen Arsenović
Subject: Re: building GNU gettext on AIX
Date: Thu, 16 Nov 2023 19:50:11 +0100

Bruno Haible <bruno@clisp.org> writes:

> David Edelsohn wrote:
>> > It is great that gettext and libintl can be built thread-safe, but GCC
>> > (cc1, gcov, etc.) are not pthreads applications and are not built with
>> > pthreads.  Because libintl defaults to pthreads enabled, NLS cannot
>> > function in GCC on AIX by default.  
>> ...
>> The latest issue is that a few files in gettext ignore --disable-pthreads
>> and creates a dependency on pthread_mutex.
>
> GNU gettext does not have an option '--disable-pthreads'. Instead, it has
> options
>
>   --enable-threads={isoc|posix|isoc+posix|windows}
>                           specify multithreading API
>
>   --disable-threads       build without multithread safety
>
>> The issue appears to be that intl/gnulib-lib/{mbrtowc.c,setlocale_null.c}
>> include pthread.h based on HAVE_PTHREAD_API, which is defined as 1 in
>> intl/config.h build directory
>
> Yup, I confirm that the dependency comes from these two object files.
>
> Will the next GCC release support AIX 7.1.x ? Recall that AIX 7.1 went
> end-of-life on 2023-04-30 [1]
>
>   * If no, then the simple solution would be to pass the configure option
>       --enable-threads=isoc
>     This should not introduce a link dependency, because the mtx_lock,
>     mtx_unlock, and mtx_init functions are in libc in AIX ≥ 7.2. Currently it
>     does not work (it still uses pthread_mutex_lock and pthread_mutex_unlock
>     despite --enable-threads=isoc). But I could make this work and release
>     a gettext 0.22.4 with the fix.
>
>   * If yes, then the question is how distributors will in general package
>     libintl on AIX. If it's installed in public locations (such as in
>     /opt/freeware/{lib,lib64}/libintl.a on gcc119.fsffrance.org), then we
>     have a problem: It may cause undefined behaviour in multithreaded
>     packages that use GNU libintl.
>     If you can guarantee that it will be installed in GCC-private directories
>     (and outside the path where GCC looks for libraries to link with!) then
>     it would be OK to install such a non-thread-safe libintl.
>     But if you cannot guarantee that, we are in trouble.

The in-tree configuration already passes --disable-shared, so I imagine
passing --disable-threads would be OK too, for the case that it is
utilized.  (relevant for the latter case: GCC-private build of libintl)

>     How do other library vendors handle this issue on AIX? Do they ship two
>     libraries, one MT-safe and one not? Under different names? Or in different
>     library search paths?
>
> Bruno
>
> [1] https://www.ibm.com/support/pages/aix-support-lifecycle-information


-- 
Arsen Arsenović

Attachment: signature.asc
Description: PGP signature


reply via email to

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