The second test (the one you want to do) works for me on i686-linux:
$ cat libtest.c
However, you should understand that the shared library you created depends on the shared libc. Thus, it is natural that he tries to open it at runtime.
$ ldd ./libtest.so linux-gate.so.1 => (0xb80c7000) libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7f4f000) /lib/ld-linux.so.2 (0xb80c8000)
One way to achieve what you want to use is: -static-libgcc -Wl,-Bstatic -lc .
F'x
source share