public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Arsen Arsenović" <arsen@aarsen.me>
To: David Edelsohn <dje.gcc@gmail.com>
Cc: Richard Biener <richard.guenther@gmail.com>,
	Bruno Haible <bruno@clisp.org>,
	gcc-patches@gcc.gnu.org
Subject: Re: [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext
Date: Thu, 16 Nov 2023 23:32:54 +0100	[thread overview]
Message-ID: <867cmh8g6i.fsf@aarsen.me> (raw)
In-Reply-To: <CAGWvny=2m1MV8HgeMbmf5aHbRGf2HHiWrHk1dgNhOef7b6H+1Q@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 4105 bytes --]


David Edelsohn <dje.gcc@gmail.com> writes:

> On Thu, Nov 16, 2023 at 5:22 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>
>>
>> David Edelsohn <dje.gcc@gmail.com> writes:
>>
>> > Don't build with the dependent libraries in tree.  Don't build the
>> > dependent libraries as shared libraries. The libraries are already built
>> > and in /opt/cfarm, as mentioned in the Compile Farm wiki.
>> >
>> > AIX is not Solaris and not Linux.  It doesn't use ELF.  AIX shared
>> > libraries *ARE* shared object files in archives.  Shared object
>> versioning
>> > is handled by multiple objects in the same archive.
>>
>> Hmm, I see.  I removed all the deps but gettext from the tree.
>>
>> This leaves gettext-runtime fulfilling the previous role of intl/.
>>
>> However, I'm confused about how this worked before, in that case, since,
>> IIRC, intl also produced libraries and was also put into host exports.
>>
>> Leaving gettext in tree produces:
>>
>> Could not load program gawk:
>>         Dependent module
>> /home/arsen/build/./gettext/intl/.libs/libintl.a(libintl.so.8) could not be
>> loaded.
>>         Member libintl.so.8 is not found in archive
>>
>> I'll try to see why intl/ didn't cause the same issue soon.
>>
>> Thanks, have a lovely evening.
>>
>
> The previous version of "intl" was built as a static library.  Configure in
> the older package had the option --enable-host-shared,
> which I did not use.  Based on the failure message, the in-tree gettext
> seems to be built as a shared library.  If you explicitly
> pass --disable-shared to the in-tree configure, you may get farther.  I'm
> currently using --disable-shared --disable-threads.
> As we have discussed, the current gettext will retain some references to
> pthreads despite the configure option.

Sure, but my patch does insert --disable-shared:

--8<---------------cut here---------------start------------->8---
host_modules= { module= gettext; bootstrap=true; no_install=true;
                module_srcdir= "gettext/gettext-runtime";
		// We always build gettext with pic, because some packages (e.g. gdbserver)
		// need it in some configuratons, which is determined via nontrivial tests.
		// Always enabling pic seems to make sense for something tied to
		// user-facing output.
                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
                lib_path=intl/.libs; };
--8<---------------cut here---------------end--------------->8---

... and it is applied:

--8<---------------cut here---------------start------------->8---
-bash-5.1$ ./config.status --config
--srcdir=../../gcc/gettext/gettext-runtime --cache-file=./config.cache
  --disable-werror --with-gmp=/opt/cfarm
  --with-libiconv-prefix=/opt/cfarm --disable-libstdcxx-pch
  --with-included-gettext --program-transform-name=s,y,y,
  --disable-option-checking --build=powerpc-ibm-aix7.3.1.0
  --host=powerpc-ibm-aix7.3.1.0 --target=powerpc-ibm-aix7.3.1.0
  --disable-intermodule --enable-checking=yes,types,extra
  --disable-coverage --enable-languages=c,c++
  --disable-build-format-warnings --disable-shared --disable-java
  --disable-csharp --with-pic build_alias=powerpc-ibm-aix7.3.1.0
  host_alias=powerpc-ibm-aix7.3.1.0 target_alias=powerpc-ibm-aix7.3.1.0
  CC=gcc CFLAGS=-g 'LDFLAGS=-static-libstdc++ -static-libgcc
  -Wl,-bbigtoc' 'CXX=g++ -std=c++11' CXXFLAGS=-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 (?)

I do see that the build system adds intl to the LD_LIBRARY_PATH.

I will be testing dropping lib_path from the module definition above.
It might be superflous (I think it is only used for LD_LIBRARY_PATH, for
when the libs built by the build system are shared - which they never
are for in-tree gettext).  I'll take the shot to add --disable-threads,
too, for this test.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: drop gettext lib_path --]
[-- Type: text/x-patch, Size: 6259 bytes --]

From 4b75355d5ee9162a922a85517ef3c0a16931544d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Arsen=20Arsenovi=C4=87?= <arsen@aarsen.me>
Date: Thu, 16 Nov 2023 23:50:30 +0100
Subject: [PATCH] disable threads, lib_path on gettext

---
 Makefile.def |  3 +--
 Makefile.in  | 27 +++++++++++----------------
 2 files changed, 12 insertions(+), 18 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index 792f81447e1b..78414b4cd89c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -80,8 +80,7 @@ host_modules= { module= gettext; bootstrap=true; no_install=true;
 		// need it in some configuratons, which is determined via nontrivial tests.
 		// Always enabling pic seems to make sense for something tied to
 		// user-facing output.
-                extra_configure_flags='--disable-shared --disable-java --disable-csharp --with-pic';
-                lib_path=intl/.libs; };
+                extra_configure_flags='--disable-shared --disable-threads --disable-java --disable-csharp --with-pic'; };
 host_modules= { module= tcl;
                 missing=mostlyclean; };
 host_modules= { module= itcl; };
diff --git a/Makefile.in b/Makefile.in
index b65ab4953bce..796717665eb7 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -768,7 +768,7 @@ TARGET_LIB_PATH_libatomic = $$r/$(TARGET_SUBDIR)/libatomic/.libs:
 
 # This is the list of directories that may be needed in RPATH_ENVVAR
 # so that programs built for the host machine work.
-HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)$(HOST_LIB_PATH_gettext)
+HOST_LIB_PATH = $(HOST_LIB_PATH_gmp)$(HOST_LIB_PATH_mpfr)$(HOST_LIB_PATH_mpc)$(HOST_LIB_PATH_isl)
 
 # Define HOST_LIB_PATH_gcc here, for the sake of TARGET_LIB_PATH, ouch
 @if gcc
@@ -796,11 +796,6 @@ HOST_LIB_PATH_isl = \
   $$r/$(HOST_SUBDIR)/isl/.libs:$$r/$(HOST_SUBDIR)/prev-isl/.libs:
 @endif isl
 
-@if gettext
-HOST_LIB_PATH_gettext = \
-  $$r/$(HOST_SUBDIR)/gettext/intl/.libs:$$r/$(HOST_SUBDIR)/prev-gettext/intl/.libs:
-@endif gettext
-
 
 CXX_FOR_TARGET_FLAG_TO_PASS = \
 	"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"
@@ -19827,7 +19822,7 @@ configure-gettext:
 	  $$s/$$module_srcdir/configure \
 	  --srcdir=$${topdir}/$$module_srcdir \
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-	  --target=${target_alias} --disable-shared --disable-java --disable-csharp --with-pic \
+	  --target=${target_alias} --disable-shared --disable-threads --disable-java --disable-csharp --with-pic \
 	  || exit 1
 @endif gettext
 
@@ -19863,7 +19858,7 @@ configure-stage1-gettext:
 	  --target=${target_alias} \
 	   \
 	  $(STAGE1_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage2-gettext maybe-configure-stage2-gettext
@@ -19897,7 +19892,7 @@ configure-stage2-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE2_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage3-gettext maybe-configure-stage3-gettext
@@ -19931,7 +19926,7 @@ configure-stage3-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE3_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stage4-gettext maybe-configure-stage4-gettext
@@ -19965,7 +19960,7 @@ configure-stage4-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGE4_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageprofile-gettext maybe-configure-stageprofile-gettext
@@ -19999,7 +19994,7 @@ configure-stageprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stagetrain-gettext maybe-configure-stagetrain-gettext
@@ -20033,7 +20028,7 @@ configure-stagetrain-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEtrain_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stagefeedback-gettext maybe-configure-stagefeedback-gettext
@@ -20067,7 +20062,7 @@ configure-stagefeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEfeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautoprofile-gettext maybe-configure-stageautoprofile-gettext
@@ -20101,7 +20096,7 @@ configure-stageautoprofile-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautoprofile_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 .PHONY: configure-stageautofeedback-gettext maybe-configure-stageautofeedback-gettext
@@ -20135,7 +20130,7 @@ configure-stageautofeedback-gettext:
 	  --target=${target_alias} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
 	  $(STAGEautofeedback_CONFIGURE_FLAGS) \
-	  --disable-shared --disable-java --disable-csharp --with-pic
+	  --disable-shared --disable-threads --disable-java --disable-csharp --with-pic
 @endif gettext-bootstrap
 
 
-- 
2.42.1


[-- Attachment #1.3: Type: text/plain, Size: 4551 bytes --]


> Thanks, David
>
>
>>
>> > Thanks, David
>> >
>> >
>> >
>> > On Thu, Nov 16, 2023 at 4:15 PM Arsen Arsenović <arsen@aarsen.me> wrote:
>> >
>> >>
>> >> Arsen Arsenović <arsen@aarsen.me> writes:
>> >>
>> >> > [[PGP Signed Part:Good signature from 52C294301EA2C493 Arsen Arsenović
>> >> (Gentoo Developer UID) <arsen@gentoo.org> (trust ultimate) created at
>> >> 2023-11-16T19:47:16+0100 using EDDSA]]
>> >> >
>> >> > David Edelsohn <dje.gcc@gmail.com> writes:
>> >> >
>> >> >> On Wed, Nov 15, 2023 at 9:22 AM Arsen Arsenović <arsen@aarsen.me>
>> >> wrote:
>> >> >>
>> >> >>>
>> >> >>> David Edelsohn <dje.gcc@gmail.com> writes:
>> >> >>>
>> >> >>> > GCC had been working on AIX with NLS, using
>> >> "--with-included-gettext".
>> >> >>> > --disable-nls gets past the breakage, but GCC does not build for
>> me
>> >> on
>> >> >>> AIX
>> >> >>> > with NLS enabled.
>> >> >>>
>> >> >>> That should still work with gettext 0.22+ extracted in-tree (it
>> should
>> >> >>> be fetched by download_prerequisites).
>> >> >>>
>> >> >>> > A change in dependencies for GCC should have been announced and
>> more
>> >> >>> widely
>> >> >>> > socialized in the GCC development mailing list, not just GCC
>> patches
>> >> >>> > mailing list.
>> >> >>> >
>> >> >>> > I have tried both the AIX Open Source libiconv and libgettext
>> >> package,
>> >> >>> and
>> >> >>> > the ones that I previously built.  Both fail because GCC configure
>> >> >>> decides
>> >> >>> > to disable NLS, despite being requested, while libcpp is
>> satisfied,
>> >> so
>> >> >>> > tools in the gcc subdirectory don't link against libiconv and the
>> >> build
>> >> >>> > fails.  With the included gettext, I was able to rely on a
>> >> >>> self-consistent
>> >> >>> > solution.
>> >> >>>
>> >> >>> That is interesting.  They should be using the same checks.  I've
>> >> >>> checked trunk and regenerated files on it, and saw no significant
>> diff
>> >> >>> (some whitespace changes only).  Could you post the config.log of
>> both?
>> >> >>>
>> >> >>> I've never used AIX.  Can I reproduce this on one of the cfarm
>> machines
>> >> >>> to poke around?  I've tried cfarm119, but that one lacked git, and I
>> >> >>> haven't poked around much further due to time constraints.
>> >> >>>
>> >> >>
>> >> >> The AIX system in the Compile Farm has a complete complement of Open
>> >> Source
>> >> >> software installed.
>> >> >>
>> >> >> Please ensure that /opt/freeware/bin is in your path.  Also, the GCC
>> >> Wiki
>> >> >> Compile Farm page has build tips that include AIX
>> >> >>
>> >> >>
>> >>
>> https://gcc.gnu.org/wiki/CompileFarm#Services_and_software_installed_on_farm_machines
>> >> >
>> >> > Thanks, that got me further.
>> >> >
>> >> >> that recommended --with-included-gettext configuration option.
>> >> >
>> >> > This flag should still exist and operate the same if gettext is
>> present
>> >> > in tree.  I've cloned gcc and downloaded prerequisites (via
>> >> > contrib/download_prerequisites) and I am trying to configure it now.
>> >>
>> >> The build failed.  After gettext/gmp/... (in-tree hostlibs) get built
>> >> and added to library paths, further GCC processes fail to run:
>> >>
>> >> configure:3305: gcc -g  -static-libstdc++ -static-libgcc -Wl,-bbigtoc
>> >> conftest.c  >&5
>> >> Could not load program
>> >> /opt/freeware/libexec/gcc/powerpc-ibm-aix7.3.0.0/10/cc1:
>> >>         Dependent module
>> >> /home/arsen/build/./gmp/.libs/libgmp.a(libgmp.so.10) could not be
>> loaded.
>> >>         Member libgmp.so.10 is not found in archive
>> >>
>> >> This seems odd.  I am not sure what compels the RTDL (?) to look up .sos
>> >> in archives, or how it knows about these archives..  I suspect it's
>> >> getting tripped by something in HOST_EXPORTS.
>> >>
>> >> >> Thanks, David
>> >> >>
>> >> >>
>> >> >>>
>> >> >>> TIA, sorry about the inconvenience.  Have a lovely day.
>> >> >>>
>> >> >>> > The current gettext-0.22.3 fails to build for me on AIX.
>> >> >>> >
>> >> >>> > libcpp configure believes that NLS functions on AIX, but gcc
>> >> configure
>> >> >>> > fails in its tests of gettext functionality, which leads to an
>> >> >>> inconsistent
>> >> >>> > configuration and build breakage.
>> >> >>> >
>> >> >>> > Thanks, David
>> >> >>>
>> >> >>>
>> >> >>> --
>> >> >>> Arsen Arsenović
>> >> >>>
>> >>
>> >>
>> >> --
>> >> Arsen Arsenović
>> >>
>>
>>
>> --
>> Arsen Arsenović
>>


-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 381 bytes --]

  reply	other threads:[~2023-11-16 22:52 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 20:37 David Edelsohn
2023-11-14 23:06 ` Arsen Arsenović
2023-11-15  1:49   ` David Edelsohn
2023-11-15 12:29     ` building GNU gettext on AIX Bruno Haible
2023-11-15 19:26       ` David Edelsohn
2023-11-15 21:22         ` Bruno Haible
2023-11-15 21:31           ` David Edelsohn
2023-11-15 22:39             ` Bruno Haible
2023-11-16 16:00               ` David Edelsohn
2023-11-16 16:35                 ` David Edelsohn
2023-11-16 18:01                   ` David Edelsohn
2023-11-16 18:17                     ` David Edelsohn
2023-11-16 18:52                       ` Bruno Haible
2023-11-16 22:18                         ` David Edelsohn
2023-11-16 22:46                           ` Bruno Haible
2023-11-16 23:10                             ` Arsen Arsenović
2023-11-17  8:33                               ` Richard Biener
2023-11-17  8:49                                 ` Arsen Arsenović
2023-11-17 12:24                                 ` Bruno Haible
2023-11-17 13:06                                   ` Arsen Arsenović
2023-11-16 23:38                             ` David Edelsohn
2023-11-17  0:07                               ` Bruno Haible
2023-11-17  0:15                                 ` David Edelsohn
     [not found]                 ` <84B39BF1-33D5-488E-8CF5-D08B09417568@gmail.com>
2023-11-16 17:44                   ` David Edelsohn
2023-11-16 18:47                     ` Bruno Haible
2023-11-16 18:50                       ` Arsen Arsenović
2023-11-16 18:59                         ` Bruno Haible
2023-11-16 19:14                           ` Arsen Arsenović
2023-11-19 19:49                       ` Bruno Haible
2023-11-15 14:14     ` [PATCH v3 0/2] Replace intl/ with out-of-tree GNU gettext Arsen Arsenović
2023-11-15 15:51       ` Xi Ruoyao
2023-11-16 18:48         ` Arsen Arsenović
2023-11-15 17:19       ` David Edelsohn
2023-11-16 18:33         ` Arsen Arsenović
2023-11-16 21:11           ` Arsen Arsenović
2023-11-16 21:40             ` David Edelsohn
2023-11-16 22:19               ` Arsen Arsenović
2023-11-16 22:30                 ` David Edelsohn
2023-11-16 22:32                   ` Arsen Arsenović [this message]
2023-11-16 23:59                     ` David Edelsohn
2023-11-17  8:34                       ` Arsen Arsenović
2023-11-17  8:50                         ` Richard Biener
2023-11-17  8:56                           ` Arsen Arsenović
2023-11-17 14:41                         ` David Edelsohn
2023-11-17 15:16                           ` Arsen Arsenović
2023-11-17 16:07                             ` David Edelsohn
2023-11-18 18:10                               ` Arsen Arsenović
2023-11-19 21:55                               ` Bruno Haible
2023-11-19 23:00                                 ` Bruno Haible
2023-11-19 23:06                                   ` Andrew Pinski
2023-11-20  1:17                                 ` David Edelsohn
2023-11-20 21:18                                   ` Arsen Arsenović
2023-11-20 21:38                                     ` David Edelsohn
2023-11-21  0:44                                       ` Arsen Arsenović
2023-11-20 23:00                                     ` Bruno Haible
2023-11-21  0:45                                       ` Arsen Arsenović
2023-11-21 13:13                                         ` Arsen Arsenović
2023-11-21 16:28                                           ` David Edelsohn
2023-11-21 20:58                                           ` Eric Gallager
2023-11-15 19:58       ` David Edelsohn
  -- strict thread matches above, loose matches on Subject: below --
2023-11-02  8:27 Arsen Arsenović
2023-11-10 10:37 ` Richard Biener

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=867cmh8g6i.fsf@aarsen.me \
    --to=arsen@aarsen.me \
    --cc=bruno@clisp.org \
    --cc=dje.gcc@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=richard.guenther@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).