public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* static linked glibc
@ 2009-01-20 11:43 Kolesar
  2009-01-20 15:31 ` Ian Lance Taylor
  0 siblings, 1 reply; 2+ messages in thread
From: Kolesar @ 2009-01-20 11:43 UTC (permalink / raw)
  To: gcc-help


Hi All

I want static linked glibc (v2.8) with my program and after that run on any
other linux, but i get error: 
./hamo: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./hamo)


I build and linking my program on OpenSUSE 11.0
Run on SLES 10.1 for this example

# gcc -o hamo  -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0
/usr/lib/libglib-2.0.a 
hamo.c -static-libgcc

# ldd -v ./hamo
./hamo: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./hamo)
        linux-gate.so.1 =>  (0xffffe000)
        libc.so.6 => /lib/libc.so.6 (0xb7dca000)
        /lib/ld-linux.so.2 (0xb7eff000)

        Version information:
        ./hamo:
                libc.so.6 (GLIBC_2.8) => not found
                libc.so.6 (GLIBC_2.2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.3.4) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
        /lib/libc.so.6:
                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2

Where I made mistake?

Best Regards
Kolear

-- 
View this message in context: http://www.nabble.com/static-linked-glibc-tp21561568p21561568.html
Sent from the gcc - Help mailing list archive at Nabble.com.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: static linked glibc
  2009-01-20 11:43 static linked glibc Kolesar
@ 2009-01-20 15:31 ` Ian Lance Taylor
  0 siblings, 0 replies; 2+ messages in thread
From: Ian Lance Taylor @ 2009-01-20 15:31 UTC (permalink / raw)
  To: Kolesar; +Cc: gcc-help

Kolesar <asim.husanovic@gmail.com> writes:

> I want static linked glibc (v2.8) with my program and after that run on any
> other linux, but i get error: 
> ./hamo: /lib/libc.so.6: version `GLIBC_2.8' not found (required by ./hamo)

That program was evidently not statically linked.


> # gcc -o hamo  -I/usr/lib/glib-2.0/include -I/usr/include/glib-2.0
> /usr/lib/libglib-2.0.a 
> hamo.c -static-libgcc

The -static-libgcc option links libgcc statically.  It does not link
libc statically.  To do a fully static link, use -static.

Ian

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-01-20 15:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-20 11:43 static linked glibc Kolesar
2009-01-20 15:31 ` Ian Lance Taylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).