From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 0FF6A3857BAF for ; Wed, 22 Jun 2022 20:21:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 0FF6A3857BAF Received: by mail-wr1-x42f.google.com with SMTP id i10so21225841wrc.0 for ; Wed, 22 Jun 2022 13:21:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=D04qs6xJ3OLj8N4He6qyW5WzdWD1qnYWNG+exf9AJNc=; b=mRqxCkgQiliEF2at0C2Svou6tx2k/axqAAefKVjaMY+alkz+RloDOrWkciXu6qK/oZ 0YUQnmaZihFJuTHFaFda46R0YYKntUkpLvZVqSGGBmjVCRTIsYLXwKL45Xr/yWgkOcbO wQvmQk3ptv7kKtZlHPUEpAfbF47yYLn4SJVD4NYQosw8nVWTZinm5wkhPrJCmZxKvvEf 9xuqmI8hYS1Ro6+FZTe3FhlmA/xaNQ295dE2+4zIT82x/OjMjFek2MaUEiOc+FXPYt4t JLv1kX9t5rENbWy9kbjYkCN6eh+OkZqVUnI2XoLPUhcUBFgv6fWhQc6AiesE+tfV9LcR w59g== X-Gm-Message-State: AJIora+ky7DXY1q4Cn5uxR5uv2Sd0Lu0e9longdHX+9nGpAwOlpUDaaU aUM8sFnL1ko3U2NW0i+MjlM= X-Google-Smtp-Source: AGRyM1uEFv1CSmcCDQTmQZg+xOogayZQ5XPUsOWOwRqu9PVRDZa/SIe5a/DqHwIZWvqC2GHvhhAEYA== X-Received: by 2002:a05:6000:698:b0:21b:8977:6dda with SMTP id bo24-20020a056000069800b0021b89776ddamr4818497wrb.211.1655929298617; Wed, 22 Jun 2022 13:21:38 -0700 (PDT) Received: from [192.168.1.95] (host81-138-1-83.in-addr.btopenworld.com. [81.138.1.83]) by smtp.googlemail.com with ESMTPSA id p19-20020a05600c1d9300b0039c5642e430sm491380wms.20.2022.06.22.13.21.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Jun 2022 13:21:37 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: remove intl/ directory? From: Iain Sandoe In-Reply-To: <5937718.KnAXcdumGx@omega> Date: Wed, 22 Jun 2022 21:21:37 +0100 Cc: GCC Development Content-Transfer-Encoding: quoted-printable Message-Id: <6D6D5C3F-0249-4AC7-83BC-7ED96ED3370C@googlemail.com> References: <32334822.2dzg3u6YtW@omega> <61E1C7F4-3CC0-4346-BEE4-3FAC928C5181@googlemail.com> <9181FC49-E1B7-402F-9B5C-6D7C81D62EC8@googlemail.com> <5937718.KnAXcdumGx@omega> To: Bruno Haible X-Mailer: Apple Mail (2.3608.120.23.2.7) X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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 X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 22 Jun 2022 20:21:42 -0000 Hi Bruno, +1 on the C reasons for removing intl. (however, once we have a rough working patch, it would still need buy-in = from GDB + binutils) > On 21 Jun 2022, at 03:05, Bruno Haible wrote: >> So, indeed, part of this is quite straight forward - we can amend the = Makefile.def >> to specify that GCC should use gettext-runtime (it will be used if = the directory is >> present, otherwise there will be no intl support). >>=20 >> The tricky part is that we need to use the runtime =E2=80=98uninstalled= =E2=80=99, and here is where >> intl is helpful - it provides a =E2=80=98config.intl=E2=80=99 that = can be sourced via gettext-sister.m4 >> to provide the neccessary configure input to directories that want to = use intl. >>=20 >> I have hacked a change to gettext-sister.m4 that fishes the same = information out >> of gettext-runtime/Makefile (as configured in $build) - obviously = this is going to be >> fragile w.r.t different versions of gettext-runtime (so I am not = suggesting this is a >> viable patch) - simply something to illustrate what needs to be = figured out. >>=20 >> So - the changes are in Makefile.def and config/gettext-sister.m4 = (the patch includes >> the regenerated files for convenience of use). >>=20 >> I tried this with gettext-0.21 on macOS 10.15 and, AFAICT, it DTRT - = but needs work >> to resolve the main point above. >=20 > Excellent! Glad to see that you are going ahead so quickly. >=20 > I have now added the necessary support for this "uninstalled" = situation from > the gettext side: > = https://git.savannah.gnu.org/gitweb/?p=3Dgettext.git;a=3Dcommitdiff;h=3D6f= 048e30a88282ed6712ce8d6000302fd287daad > This is in a form that is maintainable from gettext's side. >=20 > I believe that with this, you can change these lines from = gettext-sister.m4 >=20 > BUILD_INCLUDED_LIBINTL=3D`grep BUILD_INCLUDED_LIBINTL = ../gettext-runtime/Makefile|sed s/BUILD_INCLUDED_LIBINTL\ =3D\ //` > USE_NLS=3D`grep USE_NLS ../gettext-runtime/Makefile|sed s/USE_NLS\ =3D\= //` > LIBICONV=3D`grep ^LIBICONV ../gettext-runtime/Makefile|sed = s/LIBICONV\ =3D\ //` > INTL_MACOSX_LIBS=3D`grep ^INTL_MACOSX_LIBS = ../gettext-runtime/Makefile|sed s/INTL_MACOSX_LIBS\ =3D\ //` > XGETTEXT=3D`grep XGETTEXT ../gettext-runtime/Makefile|sed s/XGETTEXT\ = =3D\ //` > GMSGFMT=3D`grep GMSGFMT ../gettext-runtime/Makefile|sed s/GMSGFMT\ =3D\= //` > POSUB=3D`grep POSUB ../gettext-runtime/Makefile|sed s/POSUB\ =3D\ //` > LIBINTL=3D"\${top_builddir}/../gettext-runtime/intl/.libs/libintl.a = $LIBICONV $INTL_MACOSX_LIBS" > INCINTL=3D"-I\${top_builddir}/../gettext-runtime/intl" >=20 > roughly to this: >=20 > relative_builddir=3D'${top_builddir}/../gettext-runtime' > . ${top_builddir}/../gettext-runtime/uninstalled-config.sh Yes ( # We can use an in-tree build of libintl. if test -f = ifelse([$1],,[../gettext-runtime],[$1])/uninstalled-config.sh; then = relative_builddir=3D'ifelse([$1],,[${top_builddir}/..],[$1]/..)/gettext-ru= ntime' . ifelse([$1],,[../gettext-runtime],[$1])/uninstalled-config.sh elif test -f ifelse([$1],,[../intl],[$1])/config.intl; then . ifelse([$1],,[../intl],[$1])/config.intl fi ) and it works ... =E2=80=A6 although now I see some configure warnings about not being = able to access build-aux (which I do not recall seeing with the previous = hack - but that could be just bad memory ;) ) ----- FWIW this following snippet would be just as broken on macOS as other = noted platforms - it would need auto-foo-provided shared lib extension - = or the equivalent to be used. =E2=80=A6 is there any reason that all platforms with non-=E2=80=99so=E2=80= =99 suffixes would not work with that change? +# LIBINTL is a set of compiler options, to use when linking without = libtool, +# that ensures that the library that contains the *gettext() family of = functions +# gets found. +if test @USE_INCLUDED_LIBINTL@ =3D yes; then + if test '@ENABLE_SHARED@' =3D yes; then + # NB: This case is not supported on AIX and HP-UX. + LIBINTL=3D"${relative_builddir}/intl/.libs/libintl.so = -Wl,-rpath,${relative_builddir}/intl/.libs @LIBICONV@ = @INTL_MACOSX_LIBS@" + else + LIBINTL=3D"${relative_builddir}/intl/.libs/libintl.a @LIBICONV@ = @INTL_MACOSX_LIBS@" + fi +else + # The functionality is provided by libc. + LIBINTL=3D +fi > There is also a GCC specific quirk, that I upstreamed into GNU = gettext: > = https://git.savannah.gnu.org/gitweb/?p=3Dgettext.git;a=3Dcommitdiff;h=3Dfd= c2bd236a6a62b477c1fca4205df10b0e64266b IMHO we need to fix this ^ in GCC config - since gettext-runtime accepts = =E2=80=9C=E2=80=94with-pic=E2=80=9D we should amend the GCC configury to = pass =E2=80=94with-pic [to GMP et. al. as well, currently to build = in-tree with host-shared, needs a manual =E2=80=94with-pic on the = configure too] I added a change that looks at the [host-shared] flag in the top-level = configure, it just needs to be moved and used to add the =E2=80=94with-pic= flags where needed (where =E2=80=98just=E2=80=99 is more than 5mins = work, and needs testing widely =E2=80=A6) =20 >> P.S. I am slighty surprised that configuring with =E2=80=94disable-java= does not appear to stop >> the on-screen popup appearing that tells me I need to install Java to = use this =E2=80=A6 that >> would be an irritation when using this on a headless box. >=20 > Thanks for reporting this; it should be fixed now, through > = https://git.savannah.gnu.org/gitweb/?p=3Dgettext.git;a=3Dcommitdiff;h=3D97= 1dcbdbebb05d7ae8aa6399a0c79442fa996c5c yes, thanks! > You find a tarball from the current gettext git, that contains all = these > changes, in https://alpha.gnu.org/gnu/gettext/gettext-20220620.tar.gz = . > Obviously, the GCC documentation will have to say that all this works = only > with GNU gettext 0.22 or newer, i.e. after I make the next release. Indeed, we can set a minimum version. I think that we now need to deal with the GCC-side of the configury =E2=80= =A6 1) add logic [like GMP et. al.] to specify an external source of the = library (when there is no-in-tree source present) 2) if the in-tree source is available, I believe that the current = status-quo is that it will override anything set with (1). (1) might be slightly more tricky to do than GMP et. al. since they = operate by jamming the -I, -L and -lxxx into the CFLAGS/LDFLAGS, where = the in-tree intl scheme inserts the information into the configured = variables, so we would need to emulate that for an installed libintl. ----- Anyways, it=E2=80=99s 10.4 release time so all my resources (machines = and time) are tied up with that - so probably nothing happening on this = (from me at least) until that release (and my darwin-specific follow-on) = is done. thanks for working on this! Iain