Runtime Libraries. NXP CodeWarrior Development Studio
Reklaam
Reklaam
Chapter 22 Libraries and Support Code
NOTE
Re-building any particular
C
and
C99
library, requires math
library of the same target. It is suggested that the math
library is built prior to building the
C99
or
C libraries.
7. Rebuild a
C++
or libc++
library file using the following command:
<CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc++_XXX libc+
+_XXX"
• For example, in PA, the following command will build the libstdc++_E500V2.a, libc++_E500V2.a
files:
<CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc++_E500V2 libc++_E500V2"
• For example, in MCU, the following command will build the libstdc+
+_E200z0_VLE_Soft.a, libc++_E200z0_VLE_Soft.a files:
<CWInstallDir>\gnu\bin\make -f EWL_C++.PA.mak -C EWL_C++ TARGETS="libstdc+
+_E200z0_VLE_Soft libc++_E200z0_VLE_Soft"
8. Rebuild a
Runtime
library file using the following command:
<CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime "librt_XXX"
• For example, in PA, the following command will build the librt_E500V2.a
file:
<CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime "librt_E500V2"
• For example, in MCU, the following command will build the librt_E200z0_VLE_Soft.a
file:
<CWInstallDir>\gnu\bin\make -f EWL_Runtime.PA.mak -C EWL_Runtime
"librt_E200z0_VLE_Soft"
Upon successful execution of the make
command, check the lib folder for the EWL libraries.
22.4 Runtime Libraries
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
387
Runtime Libraries
A runtime library provides low-level functions that support high-level C and C++ language features, such as memory management and file system access. Conceptually, a runtime library acts as an interface between a target system's hardware or operating system and the CodeWarrior C or C++ runtime environment.
This CodeWarrior product includes many runtime libraries and support code files. These files are here:
installDir \PowerPC_EABI_Support\Runtime where installDir is a placeholder for the path in which you installed your product.
For your projects to build and run, you must include the correct runtime library and startup code. These sections explain how to pick the correct files:
•
Required Libraries and Source Code Files
•
Allocating Additional Heap Space
•
22.4.1 Required Libraries and Source Code Files
Every CodeWarrior project must include a runtime library.
Select the library appropriate for your project, given the language your are using (C or C
++), the processor on your target board, and your target setting choices. Use the
information in Runtime Library Naming Conventions
to help you pick the correct library.
The runtime libraries are in this directory:
installDir \PowerPC_EABI_Support\Runtime\Lib\
Along with the pre-built runtime libraries, this CodeWarrior product includes the source code and project files required to build the runtime libraries. As a result, you can modify them as necessary.
All runtime library source code files are in this directory:
installDir
\PowerPC_EABI_Support\Runtime\Src
The runtime library project files are in this directory:
installDir
\PowerPC_EABI_Support\Runtime\Project
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
388 Freescale Semiconductor, Inc.
Chapter 22 Libraries and Support Code
The project names are
Runtime.PPCEABI.mcp
and
Run_EC++.PPCEABI.mcp
. Each project has a different build target for each configuration of the runtime library.
For more information about customizing the runtime libraries, read the comments in the source code files as well as the runtime library release notes.
NOTE
The C and C++ runtime libraries do not initialize hardware. The
CodeWarrior tools assume that you load and run the programs linked with these libraries with the CodeWarrior debugger.
When your program is ready to run as a standalone application, you must add the required hardware initialization code.
Finally, in addition to a runtime library, every C and C++ project must include one of the startup files listed below. These files contain functions called by the runtime code that you can customize if necessary. One kind of customization is board-specific initialization. For other customization examples, see either of these files:
•
__ppc_eabi_init.c
(for C language projects)
•
__ppc_eabi_init.cpp
(for C++ projects)
22.4.2 Allocating Additional Heap Space
If you specify a heap size in the EPPC Target settings panel, the linker creates a default heap of this size. The default heap needs no initialization.
You can create additional heaps by:
• Defining
ALLOC_ADDITIONAL_HEAPS
equal to
1
in either
__ppc_eabi_init.c
or
__ppc_eabi_init.cpp
.
Doing so causes the stub implementation of
AllocMoreHeaps()
to be called by the runtime initialization code.
• Implementing the
AllocMoreHeaps()
stub by calling init_alloc()
as many times as desired.
Each time init_alloc()
is called, the heap is expanded by the amount specified.
22.4.3 Choosing a Runtime Library
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
Freescale Semiconductor, Inc.
389
Runtime Libraries
Substrings embedded in the name of a runtime library indicate the type of support the library provides. Use these substrings to pick the runtime library appropriate for your project. The table below lists and defines the meaning of each library filename substring.
Table 22-3. Run time Library Naming Conventions
SP
N
NC
Runtime
Run_EC++
PPCEABI
A
E
E.fast
E 2
H
HC
S
LE
UC
V
Substring Meaning
The library is a C language library.
The library is an embedded C++ library.
The library conforms to the PowerPC Embedded Application
Binary Interface (EABI) standard.
The library provides AltiVec™ support.
The library is for e500 and e200z (formerly, Zen) targets.
The library is for e500 and e200z (formerly, Zen) targets.
Further, this library's floating-point operations are faster than those of a .E library, but they do not strictly conform to the
IEEE floating-point standard.
The library is for e500v2 targets and supports doubleprecision floating-point operations.
The library supports hardware floating-point operations.
The library supports hardware floating-point operations and code compression.
The library provides software emulation of floating-point operations.
Single Precision Floating Point only.
The library provides no floating-point support.
The library provides no floating-point support, but supports code compression.
The library is for a processor running in little-endian mode.
The library was built with the Use Unsigned Chars option of the C++ Language target settings panel enabled. As a result, all library function parameters declared char are treated as if the were declared unsigned char . Use a UC library in build targets for which the Use Unsigned Chars option is enabled.
Use a non- UC library in build targets for which this option is disabled. If the option used by the build target is different from the option used to generate the build target's runtime library, the linker issue a warning.
The library's functions:
• Contain VLE instructions.
• Perform single-precision floating point operations using the core's SPE auxiliary processing unit (APU).
• Perform double-precision floating using software routines.
VS
Use only with processors that have an SPE APU.
The library's functions:
• Contain VLE instructions.
• Perform all floating-point operations using softare routines
CodeWarrior Development Studio for Power Architecture Processors Build Tools Reference Manual, Rev.
10.6, 02/2014
390 Freescale Semiconductor, Inc.
Laadi alla
Reklaam