sbsv1/abld/doc/cedar-mostly-thumb.txt
author Zheng Shen <zheng.shen@nokia.com>
Mon, 30 Aug 2010 15:04:06 +0800
changeset 631 9435b9008a58
parent 599 fa7a3cc6effd
permissions -rw-r--r--
ROM Tools 13.1.0.1 Bug468 initialized static data built into a static library does not get initialized correctly
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
599
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     1
Intro.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     2
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     3
A new GCC98r2 platform/build target has been added to Cedar. This
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     4
platform is called ARM4T and implements the 'mostly thumb' build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     5
policy. Under this policy user-side code is built in THUMB (ARMv4)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     6
mode by default and kernel side code is built in ARM (ARMv4) mode with
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     7
no interworking support. These defaults can be overridden by various
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     8
means (see below). When the default is overridden both user and
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
     9
kernel-side code is built in ARM (ARMv4) mode with interworking
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    10
support.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    11
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    12
Overriding the default.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    13
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    14
The default can be overridden at project (MMP)and compontent (BLD.INF)
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    15
level and also interactively via a commandline argument to MAKMAKE.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    16
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    17
i) MMP 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    18
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    19
A new keyword ALWAYS_BUILD_AS_ARM is introduced to the supported MMP
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    20
file syntax. This keyword takes no arguments. It applies only to
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    21
platforms that implement the 'mostly thumb' policy. In other words it
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    22
is ignored by other platforms (e.g. ARM4). 
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    23
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    24
ii. BLD.INF
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    25
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    26
A new qualifier, BUILD_AS_ARM, is introduced for MMP file statements
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    27
in the BLD.INF syntax. The syntax for such statements thus becomes:
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    28
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    29
PRJ_MMPFILES
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    30
[<mmp path>\<mmp file>] {<qualifiers>}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    31
{MAKEFILE|NMAKEFILE} [<path>\<makefile>] {build_as_arm}
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    32
// <qualifiers> are tidy, ignore, build_as_arm
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    33
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    34
iii. MAKMAKE
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    35
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    36
MAKMAKE has been extended to accept the option -ARM. Supplying this
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    37
option has the same effect as if ALWAYS_BUILD_AS_ARM is supplied in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    38
the MMP file.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    39
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    40
Build/Release Directory Structure.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    41
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    42
Build artefacts are placed in either UREL or UDEB beneath ARM4T in
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    43
both build and release trees whatever ISA is targeted. The exception
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    44
is import libraries. Because ARM4T only supports version 4 of the ARM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    45
architecture different import stubs implementations are required for
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    46
each of the possible modes that clients can be compiled in (e.g. ARM
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    47
without-interworking vs ARM with-interworking vs THUMB). Therefore
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    48
import libraries are placed in the UREL sub-directory of ARM4, ARMI or
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    49
THUMB respectively within the release tree.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    50
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    51
Static Libraries.  
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    52
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    53
Static libraries are always built in ARM mode with interworking. A
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    54
consequence of this is that the linker (LD) will introduce veneers
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    55
into executables built in THUMB mode. The veneers are responsible for
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    56
switching mode (as appropriate). However the introduction of a veneer
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    57
has a small impact on code size. These two factors (i.e. static libs
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    58
being ARM and veneers) mean that an ARM4T THUMB executable will always
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    59
be slightly larger than if it had been built using the old THUMB build
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    60
target.
fa7a3cc6effd Add sbsv1 to new structure
jjkang
parents:
diff changeset
    61