Warning |
---|
This is an unapproved draft. It is currently in progress and under review. |
Include Page | ||||
---|---|---|---|---|
|
7.1 Introduction
rce modules and binary objects for host systems are compiled and linked with the gnu compiler and binutils collections. The build tool is gmake.
This chapter covers:
- #General #7.2 General compilation and linking requirements
- #Makefile #7.3 Makefile and build product hierarchy
- #Global #7.4 Global make variables
- #Constituent #7.5 Constituent makefiles
- #Packages #7.6 Packages and project makefiles
- #Make #7.7 Make examples
- #Make #7.8 Make invocation options
- #Compiler #7.9 Compiler options for rce modules
- #gnu #7.10 gnu linker options for rce modules
...
Building all projects at once is the exception. Typically, development iterations involve building and re-building individual packages and constituents. Figure 5 depicts the makefiles relevant to package and constituent builds.
Hierarchy of package- and constituent-level makefiles
Makefile search path
Under construction
[ Note: How "export library symbols...just like symbols in module sources."]
Inter-package and inter-project dependencies
Must be handled manually
If A depends on B, build B first
Order of projects in projects.mk
Order of packages in packages.mk
Library search order
When linking each library is searched once
In lists of libraries put the lower-level libs first
The search order will be the reverse of that listed
...
7.4 Global make variables
-Under construction-
The repository-level makefiles define a set of global make variables that can be useful to cite in package- and constituent-level makefiles, and which set compiler options for various targets.
...
Rule | Description | Example | ||
---|---|---|---|---|
modsneeded_<modname> | Used to record any indirect dependencies the client module may have on other modules at run time, which the dynamic linker cannot infer. | modsneeded_transport := \
| ||
modincs_<modname> | Header file include directories for headers inside the RCE release tree. | modincs_transport := \ | ||
modsinc_<modname> | Header file include directories for headers outside the RCE release tree. | modsinc_transport :\ |
...
7.6 Packages and project makefiles
Under construction
This section describes the most common make rules and option flags for packages.mk and project.mk. See Chapter Z for definitions of all options.
...
Code Block |
---|
ppc-linux ppc-rtems-rce405 ppc-rtems-ml405 i386-linux x86_64-linux sparc-solaris |
Make actions
If a rule is not specified, then what is built?
Wiki Markup |
---|
{span:class=steve}Steve: If an action is not specified, then what is built?{span} |
Make action Make rule | Description |
---|---|
all | Build 'bin' and user-defined |
dir | Create build directories, but do not build. |
obj | Compile sources |
lib | Build libraries from object files |
bin | Build libraries, executables and modules |
clean | Remove all built products |
cleanall | Same as 'clean', but removes some tmp directories as well |
List what is built and where it goes |
...
-shared and -nostdlib
as for g++.
-z combreloc
Makes sure that all relocation table entries go into a single contiguous sub-region of the shared object, even if by mischance they end up in more than one output section. This option also causes the linker to sort the entries so that those reference the same symbol occur together. This allows the dynamic linker to use a one-entry symbol lookup cache.
-T scriptname
Use the custom linker script.
-Map filename
to make a link map.
-soname modulename.major.minor.branch
to set the soname field to the module's name with version numbers and development branch appended.
*-o modulename.major.minor.branch.so *
Module filename.
-fhash-style=sysv
to suppress generation of a GNU-style hash table.
Each module that the one being constructed depends on should be named on the linker command line so that each of their sonames will be recorded in a DT_NEEDED entry in the elf dynamic section. This defines a minimum set of compatbility requirements; compatibility requirements can be expanded by implementing an rce_isCompatible function, as described in Chapter Y.
Wiki Markup |
---|
{span:class=steve}Steve: Can set rce core comaptibility here? Is this optional, only for cases where the dependency is not direct? Won't dynalink try to resolve?{span} |