- Timestamp:
-
05/28/07 20:26:39 (17 years ago)
- Author:
-
JoelSherrill
- Comment:
-
/* Configuring RTEMS for Size */ Add some more information comparing m68k and SPARC sizes.
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v1
|
v2
|
|
37 | 37 | After making sure your BSP doesn't do something that results in unnecessary object files being linked in, then you can focus on configuring RTEMS to be as small as possible. The following guidelines should help: |
38 | 38 | |
| 39 | * Remember that your choice of architecture dramatically impacts your code size. Code for the RISC processors like the SPARC and PowerPC is generally larger than for CISC such as m68k or SuperH. The following is the size of the minimum.exe for the SPARC/SIS and M68K/MVME136 BSPs built using the same RTEMS options: |
| 40 | |
| 41 | {{{ |
| 42 | text data bss dec hex filename |
| 43 | 57488 3396 4392 65276 fefc sparc-sis-minimum.exe |
| 44 | 43744 3376 20160 67280 106d0 ./m68k-rtems4.8/c/mvme136/testsuites/samples/minimum/minimum.nxe |
| 45 | }}} |
| 46 | |
| 47 | In this case, the m68k BSP is considerably smaller in text and slightly smaller in data. The bss is larger because the mvme136 BSP reserves a generous starting stack in the bss and the SIS BSP assigns it differently. |
| 48 | |
39 | 49 | * Use -Os instead of -O2. This optimizes for size. |
40 | 50 | * Consider building a custom newlib binary optimized for size. |
41 | 51 | * Add -DNDEBUG to your BSP's custom/XXX.cfg CFLAGS options. This disables assert code in RTEMS so should be done cautiously. |
42 | | * configure RTEMS with as many features disabled as possible: |
| 52 | * configure RTEMS with as many features disabled as possible. The following is an example configure command for the SPARC/SIS BSP. On |
43 | 53 | |
44 | 54 | {{{ |
45 | | .../configure --target=XXX --prefix=YYY \ |
46 | | USE_TICKS_FOR_CPU_USAGE_STATISTICS=1 USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS=1 \ |
| 55 | .../rtems-XXX/configure --target=sparc-rtems4.8 --enable-rtemsbsp=sis \ |
| 56 | --prefix=XXX \ |
| 57 | USE_TICKS_FOR_CPU_USAGE_STATISTICS=1 \ |
| 58 | USE_TICKS_FOR_RATE_MONOTONIC_STATISTICS=1 \ |
47 | 59 | --disable-itron --disable-posix --disable-networking --disable-cxx \ |
48 | | --disable-multiprocessing |
| 60 | --disable-multiprocessing --enable-tests=samples |
49 | 61 | }}} |
50 | 62 | |