Trying to build GIT pulled from today results in this linker error: nenolod@neon:~/build/uClibc$ make VERBOSE=1 rm -f lib/libc.so lib/libc.so.0 lib/libuClibc-0.9.32-git.so gcc -Wl,-EL -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,-s -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.32-git.so -Wl,--whole-archive libc/libc_so.a -Wl,--no-whole-archive ./lib/interp.os ./lib/ld64-uClibc.so.0 ./lib/uclibc_nonshared.a /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libgcc.a libc/libc_so.a(bzero.os): In function `__bzero_chk': (.text+0x5): undefined reference to `__GI___chk_fail' /usr/bin/ld: libc/libc_so.a(bzero.os): relocation R_X86_64_PC32 against undefined symbol `__GI___chk_fail' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: ld returned 1 exit status make: *** [lib/libc.so] Error 1 However, this works: nenolod@neon:~/build/uClibc$ gcc -Wl,-EL -shared -Wl,--warn-common -Wl,--warn-once -Wl,-z,combreloc -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,-s -Wl,-init,__uClibc_init -Wl,-soname=libc.so.0 -nostdlib -o lib/libuClibc-0.9.32-git.so -Wl,--whole-archive -Wl,--no-whole-archive ./lib/interp.os ./lib/ld64-uClibc.so.0 ./lib/uclibc_nonshared.a /usr/lib/gcc/x86_64-linux-gnu/4.3.2/libgcc.a ./lib/libc.a I'm pretty sure that command is wrong, however.
Created attachment 2617 [details] entirely lame method of fixing this bug
Created attachment 2623 [details] same method applied to libpthread...
Hi William, both patches look fine, but I'm wondering if it should be better to add the alias using libc_hidden_proto / libc_hidden_def. Currently on uClibc only x86_64 has the _chk version of string functions, but in the future it could be extended to other arch as well.
hi carmelo! i agree that the solution you propose is better. unfortunately, we wanted to make x86_64 a release goal for alpine and getting that going early on in the development process was a goal of mine, so i just took the hacktastic way of doing it and got out my sledgehammer. if you want, i'll take a look at creating a patch that does it this way this weekend.
Created attachment 3127 [details] use libc_hidden_proto / libc_hidden_def following patch uses libc_hidden_proto and is a git format signed-off patch that can just be git am'd. i'll also send this to the list by hand.
Created attachment 3133 [details] same for nptl this patch makes nptl match the behaviour as seen on sh, using the GETOFF macro. nptl is working with this patch on x86_64 by the way.
Thanks William, I'll manage to include them.
Just FYI. I got this error with libuClibc-0.9.31, when I use as target x86_64, generic or core2. I back to libuClibc-0.9.30.
(In reply to comment #8) > Just FYI. > I got this error with libuClibc-0.9.31, when I use as target x86_64, generic or > core2. Hi, seems this is fixed on 0.9.32-rc3.
Sorry I made a little confusion. I hit this problem using builroot-2011.02, and as I had report, with buildroot git version and toolchain with uClibc0.9.32-rc3 this bug is fixed. thanks,