From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) by sourceware.org (Postfix) with ESMTPS id A398E3858D20 for ; Sat, 18 Nov 2023 18:27:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A398E3858D20 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=aarsen.me Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=aarsen.me ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A398E3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=80.241.56.161 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700332069; cv=none; b=f53tAEnqB8a4tm055sqM9MUbTKAeeYG4isfuMHFDupmuUZpkgVB/bab+X1DFhqsEUKa/en9+cimSs9bctm5d3qy8iexuM6054DwSgR6Q3GKtr1uj6oBZ16gtn76Bij+SHQ/WWqSso0IsW6rcx56bUs1231TY8/2kuelCeiRtvoM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700332069; c=relaxed/simple; bh=QXVAuEj9ux1NSsNtB43vzzVQpJ6Kv33bJscVH6MmiuU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Y2KockuXKBJlxnVot6Gcq3xfyRj24j1ZBybTTNxSyrSt0nDJmD57f5yRKXttnC8r678u46D3Hto83oY/oZOb/VwmxyzJHZANDxxR2m6YFMpX7hQ0hVDA2M6CWGrLhYDs/sVXFmfd/qZIbjpixufn3498oZ+p5q2p5GZ1y1jYIVA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4SXj1W5KzMz9sWM; Sat, 18 Nov 2023 19:27:43 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aarsen.me; s=MBO0001; t=1700332063; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=U+L4zpy4wmKU3u2vpaACvY/vM9My6U2wugTuVpO0jZw=; b=uC3M8TJLgUd2hqvQ5OKAn+Q7EqNLjNZxbPENanlg07ykBlUJaalZtt98/Y992tQ6zsmXLv Z+uln0rhQ1ZA3EDf50YjNmkHkHjiGqmngZNFPKOYXNznGkLVunBjDPqzrAN9Nn99e+t0WM 7HL+aXwqkggopCrTd2HCMnLqYdu+sZMgBKdwhOVjbgzKz95mMDDbkNssDzWpq6JMI/8sIR 4sMqeDKTj71baiNoEa49dLYoNbk50sfFftTL6Yp4p2mxrK0NGzkGo9kP6brpfWyVXVTf+v C00821w/iha4/vgjsK2eHAuKDgmFT0UBQzJcQzk9NuvR8X0cqEjr8jVz/Pm49Q== References: <86o7fwhr03.fsf@aarsen.me> <8634x7hza7.fsf@aarsen.me> <86il61fscr.fsf@aarsen.me> <861qcpbdt2.fsf@aarsen.me> <86cyw99w4j.fsf@aarsen.me> <867cmh8g6i.fsf@aarsen.me> <86o7fs6a3j.fsf@aarsen.me> <87a5rc2yuv.fsf@aarsen.me> From: Arsen =?utf-8?Q?Arsenovi=C4=87?= To: David Edelsohn Cc: Richard Biener , Bruno Haible , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Date: Sat, 18 Nov 2023 19:10:54 +0100 In-reply-to: Message-ID: <86a5ravrvn.fsf@aarsen.me> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Rspamd-Queue-Id: 4SXj1W5KzMz9sWM X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_ASCII_DIVIDERS,KAM_INFOUSMEBIZ,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable David Edelsohn writes: > On Fri, Nov 17, 2023 at 10:17=E2=80=AFAM Arsen Arsenovi=C4=87 wrote: > >> >> David Edelsohn writes: >> >> > On Fri, Nov 17, 2023 at 3:46=E2=80=AFAM Arsen Arsenovi=C4=87 wrote: >> > >> >> >> >> David Edelsohn writes: >> >> >> >> > On Thu, Nov 16, 2023 at 5:52=E2=80=AFPM Arsen Arsenovi=C4=87 >> wrote: >> >> > >> >> > [snip] >> >> >> Sure, but my patch does insert --disable-shared: >> >> >> >> >> >> --8<---------------cut here---------------start------------->8--- >> >> >> host_modules=3D { module=3D gettext; bootstrap=3Dtrue; no_install= =3Dtrue; >> >> >> module_srcdir=3D "gettext/gettext-runtime"; >> >> >> // We always build gettext with pic, because some >> >> packages >> >> >> (e.g. gdbserver) >> >> >> // need it in some configuratons, which is determi= ned >> >> via >> >> >> nontrivial tests. >> >> >> // Always enabling pic seems to make sense for >> something >> >> >> tied to >> >> >> // user-facing output. >> >> >> extra_configure_flags=3D'--disable-shared >> --disable-java >> >> >> --disable-csharp --with-pic'; >> >> >> lib_path=3Dintl/.libs; }; >> >> >> --8<---------------cut here---------------end--------------->8--- >> >> >> >> >> >> ... and it is applied: >> >> >> >> >> >> --8<---------------cut here---------------start------------->8--- >> >> >> -bash-5.1$ ./config.status --config >> >> >> --srcdir=3D../../gcc/gettext/gettext-runtime >> --cache-file=3D./config.cache >> >> >> --disable-werror --with-gmp=3D/opt/cfarm >> >> >> --with-libiconv-prefix=3D/opt/cfarm --disable-libstdcxx-pch >> >> >> --with-included-gettext --program-transform-name=3Ds,y,y, >> >> >> --disable-option-checking --build=3Dpowerpc-ibm-aix7.3.1.0 >> >> >> --host=3Dpowerpc-ibm-aix7.3.1.0 --target=3Dpowerpc-ibm-aix7.3.1.0 >> >> >> --disable-intermodule --enable-checking=3Dyes,types,extra >> >> >> --disable-coverage --enable-languages=3Dc,c++ >> >> >> --disable-build-format-warnings --disable-shared --disable-java >> >> >> --disable-csharp --with-pic build_alias=3Dpowerpc-ibm-aix7.3.1.0 >> >> >> host_alias=3Dpowerpc-ibm-aix7.3.1.0 >> target_alias=3Dpowerpc-ibm-aix7.3.1.0 >> >> >> CC=3Dgcc CFLAGS=3D-g 'LDFLAGS=3D-static-libstdc++ -static-libgcc >> >> >> -Wl,-bbigtoc' 'CXX=3Dg++ -std=3Dc++11' CXXFLAGS=3D-g >> >> >> --8<---------------cut here---------------end--------------->8--- >> >> >> >> >> >> I'm unsure how to tell what the produced binaries are w.r.t static= or >> >> >> shared, but I only see .o files inside intl/.libs/libintl.a, while= I >> see >> >> >> a .so.1 in (e.g.) /lib/libz.a, hinting at it not being shared (?) >> >> >> >> >> > >> >> > An AIX shared library created by libtool will look like >> >> > libfoo.a[libfoo.so.N], where N is the package major version number. >> >> > Normally with one file. >> >> >> >> > An AIX static library will look like libfoo.a[a.o, b.o, c.o] >> >> > with multiple object files. >> >> > >> >> > An AIX archive can contain a combination of shared objects and >> >> > normal object files. >> >> > >> >> > AIX normally uses the convention shr.o or shr_64.o for the name >> >> > of the shared object file. Hint, hint, an AIX archive can contain >> >> > both 32 bit and 64 bit object files or shared objects. >> >> > >> >> > I don't know why the gettext build system would create >> >> > /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) >> >> > if --disable-shared was requested. That clearly is using the >> >> > naming of a libtool AIX shared object and failing due to >> >> > the missing shared object. Although in this case, the problem >> >> > seems to be the shared library load path. AIX uses LIBPATH, >> >> > not LD_LIBRARY_PATH. >> >> >> >> It doesn't create libintl.a with a libintl.so.8 inside of it. The >> >> libintl.a contains a bunch of objects, as I'd expect of a static >> >> library: >> >> >> >> --8<---------------cut here---------------start------------->8--- >> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a | grep libintl >> >> -bash-5.1$ ar -t gettext/intl/.libs/libintl.a >> >> bindtextdom.o >> >> dcgettext.o >> >> ... >> >> --8<---------------cut here---------------end--------------->8--- >> >> >> >> >> >> > Also, for me, the out of tree path was >> >> > >> >> > gettext/gettext-runtime/intl/.libs >> >> > >> >> > Is your search path missing a level? >> >> >> >> No, the above is generated by the GCC build system and builds >> >> gettext-runtime directly (per Brunos recommendation a while ago) as it >> >> is replacing intl/ of similar functionality. >> >> >> >> I'm currently building GCC with libintl with the threads hack you >> >> mentioned applied (as I got undefined references to the pthread >> >> functions you discovered). I suspect that, bar this issue (which, II= UC, >> >> Bruno will fix in a new release?) the patch above will fix the issues >> >> you've encountered on AIX (note that if you want to use gettext in-tr= ee, >> >> you'd still have to fetch gettext into the tree). >> >> >> >> Maybe we should provide a download-prerequisite-y script that skips >> >> everything but GNU gettext, to retain same behavior? >> >> >> >> Have a lovely day. >> >> >> > >> > I'm concerned that the gettext fixes are working around AIX support for >> > libpthread.a as opposed to making --disable-threads function. >> >> Indeed, my intention is to --disable-threads. The goal of the >> workaround is simply to test the patch I wrote. >> > > --disable-threads currently does not completely disable threads. Bruno is > suggesting --enable-threads=3Disoc that relies on mtx mutex functions in = libc. Even with --enable-threads=3Disoc in place of --disable-threads, I get a link error: (ld): er full ld: 0711-318 ERROR: Undefined symbols were found. The following symbols are in error: Symbol Inpndx TY CL Source-File(Object-File) OR Import= -File{Shared-object} RLD: Address Section Rld-type Referencing S= ymbol --------------------------------------------------------------------------= -------------------- .pthread_mutex_lock [26] ER PR ../../../../gcc/gettext/gettext-ru= ntime/intl/gnulib-lib/setlocale_null.c(./../gettext/intl/.libs/libintl.a[li= bgnu_la-setlocale_null.o]) 00000388 .text R_RBR [99] <.set= locale_null_with_lock> .pthread_mutex_unlock [30] ER PR ../../../../gcc/gettext/gettext-ru= ntime/intl/gnulib-lib/setlocale_null.c(./../gettext/intl/.libs/libintl.a[li= bgnu_la-setlocale_null.o]) 000003bc .text R_RBR [99] <.set= locale_null_with_lock> ER: The return code is 8. collect2: error: ld returned 8 exit status Bruno, am I missing something? =2Dbash-5.1$ ./config.status --config =2D-srcdir=3D../../gcc/gettext/gettext-runtime --cache-file=3D./config.cach= e --disable-werror --with-gmp=3D/opt/cfarm --with-libiconv-prefix=3D/opt/cf= arm --disable-libstdcxx-pch --with-included-gettext --program-transform-nam= e=3Ds,y,y, --disable-option-checking --build=3Dpowerpc-ibm-aix7.3.1.0 --hos= t=3Dpowerpc-ibm-aix7.3.1.0 --target=3Dpowerpc-ibm-aix7.3.1.0 --disable-inte= rmodule --enable-checking=3Dyes,types,extra --disable-coverage --enable-lan= guages=3Dc,c++ --disable-build-format-warnings --disable-shared --enable-th= reads=3Disoc --disable-java --disable-csharp --with-pic build_alias=3Dpower= pc-ibm-aix7.3.1.0 host_alias=3Dpowerpc-ibm-aix7.3.1.0 target_alias=3Dpowerp= c-ibm-aix7.3.1.0 CC=3Dgcc CFLAGS=3D-g 'LDFLAGS=3D-static-libstdc++ -static-= libgcc -Wl,-bbigtoc' 'CXX=3Dg++ -std=3Dc++11' CXXFLAGS=3D-g This is on gcc119. TIA, have a lovely night. > Yes, GCC should configure the in tree gettext with --disable-threads, but > that configure option is not completely effective and does not produce a > build without threads references. > > Thanks, David > > >> >> > --enabled-threads=3Disoc use of mtx_* is a workaround, but it's still = not >> > allowing users to truly disable threads. >> > >> > Thanks, David >> >> =2D-=20 Arsen Arsenovi=C4=87 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iOYEARYKAI4WIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCZVkCHF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0RkVF MkIzRDExM0ZDMDBBMzE2MkQ2MDYxNTJDMjk0MzAxRUEyQzQ5MxAcYXJzZW5AYWFy c2VuLm1lAAoJEFLClDAeosSTdp0A+wVqpBWiat/kY5qgFRii2WmGP1JvTxDQLGWh A64idJ/VAQDjbUgFDwMMpHENJDbmrkul/jxPZ/qTCbM4RJOzVVcIAA== =mg3O -----END PGP SIGNATURE----- --=-=-=--