Hi Bruno, Am 22.11.2020 um 12:22 schrieb Dagobert Michelsen <d...@opencsw.org>: > Am 17.11.2020 um 22:55 schrieb Bruno Haible <br...@clisp.org>: >>> I am currently trying to compile the most recent gettext on Solaris 10 and >>> found an issue. >>> The error shows on Solaris 10 i386 64 bit only, sparc and i386 32 bit are >>> not affected: >>> >>> gmake[4]: Entering directory >>> '/home/dam/mgar/pkg/gettext/trunk/work/solaris10-i386/build-isa-amd64/gettext-0.20.2/libtextstyle/adhoc-tests' >>> /opt/csw/bin/gcc-5.5 -DHAVE_CONFIG_H -I. -I.. -I. -I. -I.. -I../lib >>> -I./../lib -DSRCDIR=\"./\" -I/opt/csw/include -O2 -pipe >>> -fno-omit-frame-pointer -m64 -march=opteron -MT hello.o -MD -MP -MF >>> .deps/hello.Tpo -c -o hello.o hello.c >>> mv -f .deps/hello.Tpo .deps/hello.Po >>> /bin/bash ../libtool --tag=CC --mode=link /opt/csw/bin/gcc-5.5 -O2 >>> -pipe -fno-omit-frame-pointer -m64 -march=opteron -m64 -march=opteron >>> -L/opt/csw/lib/64 -o hello hello.o ../lib/libtextstyle.la >>> libtool: link: /opt/csw/bin/gcc-5.5 -O2 -pipe -fno-omit-frame-pointer -m64 >>> -march=opteron -m64 -march=opteron -o .libs/hello hello.o >>> -L/opt/csw/lib/64 ../lib/.libs/libtextstyle.so -lm -ltermcap >>> -R/opt/csw/lib/64 >>> Undefined first referenced >>> symbol in file >>> iconv_ostream_create ../lib/.libs/libtextstyle.so >> >> This symbol is only defined in HAVE_ICONV is set to 1 in config.h. >> Can you search config.log for "checking for iconv" ? > > That was a good hint! Indeed iconv is not detected properly on amd64 in the > snapshot 2020-11-16, but it was on 0.20.1. For all other ISAs like sparc, > sparcv9 > and i386 the detection works fine for both compared versions.
I finally found the issue: gettext after 0.20.1 uses a more recent version of gnulib with linker ABI check located in host-cpu-c-abi.m4. This ABI check was not present up until gettext 0.20.1 hence compilation for amd64 worked. Now regarding the error in detail: the check tries to determine which ABI a platform can run as derived from the $host_cpu value. The error lies in the assumption that $host_cpu == i386 always implies C ABI i386, which is wrong at least for Solaris x86 where $host_cpu is always i386 for all CPU types including 64 bit. Maybe "isainfo -kâ should be used instead in conjunction with a Solaris platform test? This patch works for me but as HOST_CPU_C_ABI can have i386 and x86_64-x32 as values there is probably an intention to differentiate here: diff --git a/m4/host-cpu-c-abi.m4 b/m4/host-cpu-c-abi.m4 index 6db2aa2..3e40db7 100644 --- a/m4/host-cpu-c-abi.m4 +++ b/m4/host-cpu-c-abi.m4 @@ -55,12 +55,7 @@ AC_DEFUN([gl_HOST_CPU_C_ABI], [case "$host_cpu" in changequote(,)dnl - i[34567]86 ) -changequote([,])dnl - gl_cv_host_cpu_c_abi=i386 - ;; - - x86_64 ) + i[34567]86 | x86_64 ) # On x86_64 systems, the C compiler may be generating code in one of # these ABIs: # - 64-bit instruction set, 64-bit pointers, 64-bit 'long': x86_64. Btw, the updated gettext is a requirement for gnulib CI. Best regards â Dago -- "You don't become great by trying to be great, you become great by wanting to do something, and then doing it so hard that you become great in the process." - xkcd #896