From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mo4-p00-ob.smtp.rzone.de (mo4-p00-ob.smtp.rzone.de [85.215.255.21]) by sourceware.org (Postfix) with ESMTPS id 62A6C3858D20 for ; Fri, 17 Nov 2023 00:07:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 62A6C3858D20 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=clisp.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=clisp.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 62A6C3858D20 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=85.215.255.21 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700179632; cv=pass; b=BTJ3nGSOHyaZh/Q4A05LTyGGTxCz2mRQAb21kaq4VdpgKAs5mId5aLYtw/LqVdZfZ7p/DugOOcR+s8RPjfxqBh0cP6o68rvtbJX/D2VvjlHxh8fHn28Rx56pAcEjg4YR40hPj4KOP5poYphTl9WI7X++5yRXVfp9ViGR5ZhZbyQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1700179632; c=relaxed/simple; bh=KAdkA4vVt2ogRzXG0dWELrSbrVWISxNDwpLlRd+dmKQ=; h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID: MIME-Version; b=fpadvosuhehIOIOjoTLBC81TvP+yQa2xRv3r3ydU3Bk45aaYj5h7lZ8N6q167tiqNGavvXYmdoGEnZRnzz//TH9lsvzT3uZIONwITJ8joqd/TCHk+HslNOG1QJ6Bsz6YcFZaR/7gCHUxLfPMBLcIn/fNXYhrQWvgjAl1mDMnaOU= ARC-Authentication-Results: i=2; server2.sourceware.org ARC-Seal: i=1; a=rsa-sha256; t=1700179621; cv=none; d=strato.com; s=strato-dkim-0002; b=E3FL7FcCge/hd7ib8SB74BTZiLegtMcY4qZw0WghMpuu5aGxb8wR6rJDawznRKEBcl iSzDpcvwenpK0YC3OKIiPcZhgsPsutCbZuOs2e8dv7oJjPU9xaKdZ81qeztsGjL4G1NP ZeLrhSsrBzcRgXcQchiQT969du0H44skSLiVSqcVit1TlByQWod4w6S7aoh9+lmd1tqL xgKpwnGkZQEdt4nSOaeXJrSzTw+2AU38RNuQqm8eYONipnWJlSEii+luNMtZUSuk+Go6 dv4tiito8XLIn8m3bQQC4cwGHxQK8Dtd5O3/2Rm8VUAsbUwo9nfdHRfY9L+Np7IUTSxD /32g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; t=1700179621; s=strato-dkim-0002; d=strato.com; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=dw3HoHJno91stJB7Mu6Wbc4liEf0Gp29wCIfLjvBdHU=; b=Kiex4ykNcP5VLcOb5wssUs4Z0nYIqxFm4VgcrJUr7pWwvO6RlA8ETkljgYWhKsBtv4 nUeQBKMLvgdcOKZtAppMN/Vdn+EG3sT9EjcQXEWx39SAv1pXWX+NexelShWZYvPaUpUX O8UzJN/vEw8oeMW2VX2PlK9Kk30poqrvVFuLLS3o3xIRvcewOZtKFhhlHepKOYkYMA5y cohLkyLT0ECGGSRWGyZy5USGExbJdqumzGeoYA2rwL9Ug9ztnEhZOHuY8zmu7jCKK8n/ o/nVzSsWFXVYaRJudZXI2HCNWUNqCmQwDrhhlb6DfQEtNJwDXxkh66/TTVIgw4QWD38S Az/w== ARC-Authentication-Results: i=1; strato.com; arc=none; dkim=none X-RZG-CLASS-ID: mo00 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1700179621; s=strato-dkim-0002; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=dw3HoHJno91stJB7Mu6Wbc4liEf0Gp29wCIfLjvBdHU=; b=PdqS+ZDCLSR3Fh0OLeTRnCW/FHr8O/NYYzuS2NQ1ll4rO6VRJfI+SUm3hW51f6mqQe Rd14zVOp0Xl9VYReaKVDyu6/qa5/VR4E6CM+D5nCpupalp7hEOdRjnKaB8X0BbwXpAAE EKKeJVrlIxAfj35cfVbdpgY58DWjlwdxDxt4saLOzjqxXWoYXEBC9F+zGdbrCwxG8a+I 98pLl2DR5xIVyaYY2RbOxVZQfhI6592yPKNgv5zBb3VLMEK0hA+YXWzYVq2zwWaZ4mE2 yFuuunnWhVbxhuxCZjiRL1C2QU8283qNUuon5MQ8hpWuWr5e+6puWhCPkuwj9ZRXRQR0 CKHA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; t=1700179621; s=strato-dkim-0003; d=clisp.org; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=dw3HoHJno91stJB7Mu6Wbc4liEf0Gp29wCIfLjvBdHU=; b=OeW+Ph7SKx3d9PS3ISrUY7fMMTUCRRvxxWyyqWWPlvk6t+RoIFQfg1cp2X+N1m3UPz gmZ7HQtHtvOuS5wGotBQ== X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpPDiPYT1i/LlaU+R8s97SJTqX3z" Received: from nimes.localnet by smtp.strato.de (RZmta 49.9.1 AUTH) with ESMTPSA id D75765zAH071UU5 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Fri, 17 Nov 2023 01:07:01 +0100 (CET) From: Bruno Haible To: David Edelsohn Cc: Arsen =?utf-8?B?QXJzZW5vdmnEhw==?= , GCC Patches , bug-gettext@gnu.org Subject: Re: building GNU gettext on AIX Date: Fri, 17 Nov 2023 01:07:01 +0100 Message-ID: <5798081.UuxTggG6dJ@nimes> In-Reply-To: References: <5078775.gJyxqlhIka@nimes> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: David Edelsohn wrote: > > 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) > > > > I have asked the IBM Clang team why ibm-clang depends on libpthreads. The reason is that - For a library, it is a normal expectation nowadays that it is multithread-safe. - Making a library multithread-safe (without major hacks) means to do locking or to call pthread_once / call_once in some places. - The ISO C 11 threading functions in libc have some drawbacks compared to the pthread functions. [1] So most developer prefer to rely on the POSIX threads API. - Since AIX does not have the POSIX mutex functions in libc and does not support weak symbols like in ELF, this means a dependency to pthread_mutex_lock or pthread_once. - Accordingly, in the list of libraries above, 3 libraries need pthread* symbols: $ nm -X 64 /usr/lib/libc++abi.a | grep ' U ' | grep pthread_mutex pthread_mutex_lock U - pthread_mutex_unlock U - $ nm -X 64 /usr/lib/libc++.a | grep ' U ' | grep pthread_mutex pthread_mutex_destroy U - pthread_mutex_init U - pthread_mutex_lock U - pthread_mutex_trylock U - pthread_mutex_unlock U - pthread_mutexattr_destroy U - pthread_mutexattr_init U - pthread_mutexattr_settype U - $ nm -X 64 /usr/opt/zlibNX/lib/libz.a | grep ' U ' | grep pthread_mutex pthread_mutex_destroy U - pthread_mutex_init U - pthread_mutex_lock U - pthread_mutex_unlock U - Bruno [1] Lock initialization is clumsy. The return value of a thread is only an 'int', not a pointer. Etc.