[39552] in Kerberos
Re: Threading support (on HP-UX)
daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Sep 17 01:56:25 2025
Message-ID: <d84f1782-49dd-4cde-967e-2e2c7f487b5a@mit.edu>
Date: Wed, 17 Sep 2025 01:54:58 -0400
MIME-Version: 1.0
To: "Osipov, Michael (IN IT IN)" <michael.osipov@innomotics.com>,
kerberos@mit.edu
Content-Language: en-US
From: "Greg Hudson" <ghudson@mit.edu>
In-Reply-To: <fa9ed2fd-2d13-434a-a9fd-5ae49e36223c@innomotics.com>
Content-Type: text/plain; charset="utf-8"; Format="flowed"
Errors-To: kerberos-bounces@mit.edu
Content-Transfer-Encoding: 8bit
On 9/16/25 14:09, Osipov, Michael (IN IT IN) via Kerberos wrote:
> Using HP-UX 11.31 and MIT Kerberos 1.22.1.
We will take pull requests to fix HP-UX support (provided that they are
tested and complete for what they set out to do), but can't proactively
fix things or speak authoritatively to how the code behaves on that
platform.
>> configure: WARNING: missing thread-safe function: gethostbyname_r
>> configure: WARNING: missing thread-safe function: getservbyname_r
These functions are only used in fake-addrinfo.c. If the library winds
up using getaddrinfo()/getnameinfo() directly (as I think it should),
then configure.ac not finding these functions shouldn't be a concern
aside from the spurious warnings.
> While I was able to find the define in the generated Makefiles, neither
> -lpthread or -mt with "grep -r ^PTHREAD_LIBS --include=Makefile ."
The design intent in 2005 was to avoid linking against libpthread,
because it degraded performance in single-threaded programs. Instead,
we use weak references (where we can) to invoke pthreads functions when
libpthreads is loaded in the process, or do nothing when it is not.
To that end, aclocal.m4 has:
hpux*)
# These are the flags that "gcc -pthread" adds. But we don't
# want "-pthread" because that has link-time effects, and we
# don't exclude CFLAGS when linking. *sigh*
PTHREAD_CFLAGS="-D_REENTRANT -D_THREAD_SAFE
-D_POSIX_C_SOURCE=199506L"
but I don't know if weak reference support was tested on HP-UX at the time.
It's probable that this 2005 design qualifies as too clever in 2025.
OpenSSL's libcrypto appears to link directly against libpthread, and it
is a much more widely-used library than libkrb5 or libgssapi_krb5.
________________________________________________
Kerberos mailing list Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos