This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Why a specific gcc runtime is needed?


Hi there,

static libs usually have a '.a' extension on linux (can't comment on other platforms). On linux you will find a file glibc.a, which is basicly an archive of all the object files. During static compilation the compiler will select all the objects, that will be needed by the executeable, which in turn will be linked to the executeable by the linker ...

regards

-Sven


Lin George wrote:
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]