Re: GCC C/C++ runtime library question

vbdis@aol.com (VBDis)
18 Oct 2003 15:36:26 -0400

          From comp.compilers

Related articles
GCC C/C++ runtime library question ramanathan.ramadass@spirentcom.com (2003-10-14)
Re: GCC C/C++ runtime library question Brian.Inglis@SystematicSw.ab.ca (Brian Inglis) (2003-10-18)
Re: GCC C/C++ runtime library question marcov@stack.nl (Marco van de Voort) (2003-10-18)
Re: GCC C/C++ runtime library question vbdis@aol.com (2003-10-18)
| List of all articles for this month |

From: vbdis@aol.com (VBDis)
Newsgroups: comp.compilers
Date: 18 Oct 2003 15:36:26 -0400
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
References: 03-10-078
Keywords: library, GCC, C++
Posted-Date: 18 Oct 2003 15:36:26 EDT

ramanathan.ramadass@spirentcom.com (Ramanathan Ramadass) schreibt:


>1. What is the exact difference between the C runtime and the C
>standard libraries i.e where does one end and the other begin;
>specifically w.r.t gcc? While i am going through a lot of text(both
>online and book form) i am not 100% clear on this.


Currently I'm doing a similar job, extending the standard library of
another compiler for GNU compatibility. I intend to achieve that
compatibility by creating a glibc with all those modules, which are
not found in the compiler's standard library. Linking with that
library in the first place should exclude all multiply existing
modules.


Some suggestions:


Have a look at the glibc and related documentation. The glibc is a
merge of multiple C standards (C89, C99), and other POSIX
etc. standards and extensions. The glibc package can be rebuilt with
a selection of these standards, when you modify features.h as
appropriate. At the same time you have a chance to introduce your own
#define for exclusion or replacement of specific modules with those
from your library.


>2. In a gcc distribution where exactly does the compiler specific
>magic lie within the runtime libraries? I might have to modify gcc to
>use only my libraries but where and how do i begin?


I don't know what "magic" you mean, gcc doesn't care for libraries -
that's the task of ld. But as gcc can be used as a cross compiler, at
least the platform specific header files reside in the
/lib/gcc-lib/... directories. You can create another target branch for
your library there, so that you can specify with --target whether gcc
shall compile for the default platform, using the standard glibc, or
for your target, using your glibc replacement. IMO the compiler itself
deserves no modifications herefore, as long as the target machine has
the same instruction set as the build machine.


> Currently i have built the 3rd party vendor's library and am linking
>with it but for some symbols i still have to go to the gcc
>runtimes. I am running "nm" and extracting the object modules using
>"ar" for all the unresolved symbols; which seems to be a roundabout
>way of doing things.


Locate the missing modules in the glibc package, and add these to your
project. It may become tricky to remove unwanted dependencies from
the glibc "internal" header files.


DoDi


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.