Build failure for iconv/iconvconfig

Florian Weimer fweimer@redhat.com
Fri Apr 3 20:58:28 GMT 2020


* William Tambe:

> On Fri, Apr 3, 2020 at 3:42 PM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * William Tambe:
>>
>> > On Fri, Apr 3, 2020 at 11:34 AM Florian Weimer <fweimer@redhat.com> wrote:
>> >>
>> >> * William Tambe via Libc-help:
>> >>
>> >> > We are porting GLIBC and we are getting the following linking error;
>> >> > from the logs below, any idea what object is missing ?
>> >> >
>> >> > arch-elf/bin/ld: /glibc-build/iconv/iconvconfig.o: in function `print_version':
>> >> > iconvconfig.c:(.text+0x36): undefined reference to `dcgettext'
>> >> > arch-elf/bin/ld: iconvconfig.c:(.text+0x36): warning: internal error:
>> >> > unsupported relocation
>> >>
>> >> You need to fix that first, the rest may be fallout from that.
>> >
>> > We fixed "internal error: unsupported relocation" and are no longer
>> > seeing that error, but we are still seeing the undefined references as
>> > shown below; any idea what is the missing object file we need to add,
>> > and where in the makefile to add it ?
>>
>> It looks like you are completely missing libc.
>
> I see following in iconv/Makefile:
> iconvconfig-modules = strtab xmalloc hash-string
>
> Would it be where to append missing module to build iconvconfig.o ? if
> yes, what would be the name of the module ?

You need to check if libc.so.6 is on the linker command line.  It should
be.  Here is what I see:

gcc -Wl,-rpath-link=…/build:…/build/math:…/build/elf:…/build/dlfcn:…/build/nss:…/build/nis:…/build/rt:…/build/resolv:…/build/mathvec:…/build/support:…/build/crypt:…/build/nptl
  -nostdlib -nostartfiles -o …/build/iconv/iconvconfig -Wl,-z,combreloc
  -Wl,-z,relro -Wl,--hash-style=both …/build/csu/crt1.o …/build/csu/crti.o
  `gcc --print-file-name=crtbegin.o` …/build/iconv/iconvconfig.o
  …/build/iconv/strtab.o …/build/iconv/xmalloc.o
  …/build/iconv/hash-string.o
  -Wl,-dynamic-linker=/lib64/ld-linux-x86-64.so.2 …/build/libc.so.6
  …/build/libc_nonshared.a -Wl,--as-needed …/build/elf/ld.so
  -Wl,--no-as-needed -lgcc `gcc --print-file-name=crtend.o`
  …/build/csu/crtn.o

If libc.so.6 is there, you need to check if it has the expected
contents.  Based on the error messages you quoted, it's not clear to me
if the linker can find any symbols at all.

Thanks,
Florian



More information about the Libc-help mailing list