bug-gettext
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: /usr/lib/gcc/x86_64-alpine-linux-musl: libgettextlib.so: undefined r


From: Jeffrey Walton
Subject: Re: /usr/lib/gcc/x86_64-alpine-linux-musl: libgettextlib.so: undefined reference to `libiconv'
Date: Mon, 15 Jun 2020 20:34:59 -0400

On Mon, Jun 15, 2020 at 8:21 PM Bruno Haible <bruno@clisp.org> wrote:
>
> Jeffrey Walton wrote:
> > FAIL: msgcat-2
> > ==============
> > msgcat: Cannot convert from "ISO-8859-1" to "UTF-8". msgcat relies on
> > iconv(). This version was built without iconv().
> > FAIL msgcat-2 (exit status: 1)
>
> This indicates that HAVE_ICONV was not defined (or was defined to 0).
>
> > I'm attaching gettext-tools/config.log.
>
> It explains it:
>
> configure:22025: checking for iconv
> configure:22049: gcc -o conftest -g2 -O2 -march=native -fPIC -pthread 
> -I/home/jwalton/tmp/ok2delete/include -DNDEBUG 
> -L/home/jwalton/tmp/ok2delete/lib -Wl,-R,'$$ORIGIN/../lib' 
> -Wl,-R,/home/jwalton/tmp/ok2delete/lib -Wl,--enable-new-dtags conftest.c -ldl 
> -lpthread -liconv >&5
> configure:22049: $? = 0
> configure:22083: result: yes
> configure:22086: checking for working iconv
> configure:22227: gcc -o conftest -g2 -O2 -march=native -fPIC -pthread 
> -I/home/jwalton/tmp/ok2delete/include -DNDEBUG 
> -L/home/jwalton/tmp/ok2delete/lib -Wl,-R,'$$ORIGIN/../lib' 
> -Wl,-R,/home/jwalton/tmp/ok2delete/lib -Wl,--enable-new-dtags conftest.c -ldl 
> -lpthread -liconv >&5
> configure:22227: $? = 0
> configure:22227: ./conftest
> Error loading shared library libiconv.so.2: No such file or directory (needed 
> by ./conftest)
> Error relocating ./conftest: libiconv_open: symbol not found
> Error relocating ./conftest: libiconv_close: symbol not found
> Error relocating ./conftest: libiconv: symbol not found
> configure:22227: $? = 127
> configure: program exited with status 127
>
> So evidently, gcc and the linker find libiconv.so (most likely due to the
> -L option that you gave). But the runtime loader does not find it.
> You did not pass an -rpath option to the linker, but you gave a -R option
> which - according to the documentation - ought to be equivalent.
>
> musl libc implements rpath handling for a long time already. [1]
>
> You pass --enable-new-dtags [2][3]. Do you have LD_LIBRARY_PATH set? That
> would explain why the -R has no effect.

I feature test for both rpaths and runpaths. The toolchain signals
both are supported by returning success (i.e., not returning an
error).

$ gcc -o conftest -g2 -O2 -march=native -fPIC -pthrea
d -I/home/jwalton/tmp/ok2delete/include -DNDEBUG -L/home/jwalton/tmp/ok2delete/l
ib -Wl,-R,'$$ORIGIN/../lib' -Wl,-R,/home/jwalton/tmp/ok2delete/lib -Wl,--enable-
new-dtags conftest.c  -liconv -ldl -lpthread

$ objdump -x conftest  |grep RUNPATH
  RUNPATH              $$ORIGIN/../lib:/home/jwalton/tmp/ok2delete/lib

$ ldd conftest
        /lib/ld-musl-x86_64.so.1 (0x7fe3853e9000)
Error loading shared library libiconv.so.2: No such file or directory
(needed by conftest)
        libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7fe3853e9000)
Error relocating conftest: libiconv_open: symbol not found
Error relocating conftest: libiconv_close: symbol not found
Error relocating conftest: libiconv: symbol not found

It looks like their loader is broken.

Jeff



reply via email to

[Prev in Thread] Current Thread [Next in Thread]