Hi Waldemar, all.
Commit that introduced a single libc and deduplicated threading code, i.e.:
http://cgit.uclibc-ng.org/cgi/cgit/uclibc-ng.git/commit/?id=29ff9055c80efe7…
has affected statically built uClibc.
After that commit if someone tries to link any application with libc.a, he gets the
message like this:
---------------------------------->8------------------------------------
..../libgcc.a(unwind-dw2-fde-dip.o): In function `_Unwind_Find_FDE':
..../libgcc/unwind-dw2-fde-dip.c:465: undefined reference to `dl_iterate_phdr'
..../bin/ld: GOT and PLT relocations cannot be fixed with a non dynamic linker.
..../bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
---------------------------------->8------------------------------------
Seems like there are complicated cyclic dependencies between libgcc.a and libc.a as when
we pass libc to linker twice,
e.g in the following order:
---------------------------------->8------------------------------------
-lc -lgcc -lc -lgcc
---------------------------------->8------------------------------------
linking is processed without any errors.
To reproduce the issue try to build a simple hello world program like:
---------------------------------->8------------------------------------
#include <stdio.h>
int main() {
printf("hello world\n");
return 0;
}
---------------------------------->8------------------------------------
and link with the latest statically built uClibc (libc.a) for ARC for example and you will
get the error, described
above.
Also you can find these errors in buildroot autobuilder's logs for different
architectures:
xtensa:
http://autobuild.buildroot.net/results/566/56636ab66a68045c43419feb7d5f356a…
arc:
http://autobuild.buildroot.net/results/025/02593e7f2eac19b77bcaad3b0e9e8f94…
Thanks.
--
Best regards,
Vlad Zakharov <vzakhar(a)synopsys.com>