Thanks Ian.
Do you think to link with static libc is a solution? I know how to link with a static library by using -static. My question is how to link with libc static library, because I have never done it before -- I think there must be something special for link with libc itself. I am wondering where is the location of the libc static lib? what should be the lib name, something like this -- all specific to libc itself.
Any samples to refer?
regards,
George
----- Original Message ----
From: Ian Lance Taylor <iant@google.com>
To: Lin George <george4academic@yahoo.com>
Cc: gcc-help@gcc.gnu.org
Sent: Thursday, February 8, 2007 11:11:44 PM
Subject: Re: Why a specific gcc runtime is needed?
Lin George <george4academic@yahoo.com> writes:
Why running a program on a specific platform (Linux), there are
runtime errors which mentions that specific LIBC runtime version is
required (for example, GLIBC_2.3.3).
I think C runtime should be compatible (means using one version of
gcc to build a program, it should be able to run on platform which
contains another version of gcc runtime). I am not sure whether this
error is caused by some wrongly used compile/link options (which
binds this program to specific C runtime version)?
As already noted, this is not a gcc issue. It is a glibc issue.
glibc and gcc are separate projects.
I'll add that glibc is backward compatible: if you link against glibc
version N, then you can run with glibc versions M >= N. The problem
you are encountering is that glibc is not in general forward
compatible: you can not necessarily run on glibc versions M < N. In
those cases where the program will not work with an older version of
glibc, you get a helpful error when the program starts, rather than a
confusing error at runtime.
It would be difficult to design a system which permitted full forward
compatibility with interfaces as complex and efficient as the ones
provided by glibc. I don't personally have any idea how one might do
it. But it would definitely be a nice feature.
Ian
____________________________________________________________________________________
We won't tell. Get more on shows you hate to love
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265