Kbase 21403: Does Progress Support Building Shared Libraries w/ PROBUILD?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Unverified
GOAL:
What is the basic process of building executables using Probuild and it's affect on Shared Libraries?
FIX:
-- Compiling and linking
For all the platforms, C/C++ programs (they are virtually the same because C++ is a superset of C) start as text files, normally ending with the .c file extension. During the compilation process, the compiler (cc) creates the object code file, usually ending with .o. The object file contains unlinked machine code. The linker (called link editor in UNIX), ld, then links the .o files to make an executable.
-- Building libraries
Libraries can be created with functions that have been built and are likely to be reused again and again. Libraries are simply archived .o's.
-- Shared (dynamic) libraries vs. non-shared (static) libraries
A shared library has code that gets loaded once and is reused in memory for all applications that use the same library. (On Windows, this is called dynamic link libraries, dll's). If a library is statically linked to an application, each application has a copy of the library in memory.
To create a shared library:
First the source code needs to be compiled into position-independent code (objects), so that it can be mapped to any suitable place in the process address space when the library is loaded dynamically. The command to do this depends on which system is being used.
For example, on HP, the compiler switch to do this is the +z option.
Second, ld needs to be used to create a shared library from .o or .a files.
Since the objects (.o's) provided with PROBUILD are not position-independent; end users cannot build shared libraries to include these objects.
Therefore, Progress does not support building shared libraries with PROBUILD.