- Timestamp:
-
01/07/16 00:44:42 (8 years ago)
- Author:
-
Joel Sherrill
- Comment:
-
Add information about build_bsp which will be attached
Legend:
- Unmodified
- Added
- Removed
- Modified
-
v4
|
v5
|
|
25 | 25 | KEEP |
26 | 26 | }}} |
27 | | macro to such sections. See for example c/src/lib/libbsp/sparc/shared/startup/linkcmds.base which has already been tailored. |
| 27 | macro to such sections. See for example c/src/lib/libbsp/sparc/shared/startup/linkcmds.base which has already been tailored. Each BSP will have a linkcmds file which may or may not include a shared base file. |
28 | 28 | |
29 | 29 | == Task Requirements == |
… |
… |
|
36 | 36 | Be prepared to generate a proper patch for your changes. |
37 | 37 | |
38 | | Build each BSP in the BSP family with the configure option "--enable-tests=samples" |
39 | | |
40 | | Record the size of the sample executables as reported by the size command for this architecture. The build output has this information but it can be obtained by running a command similar to the following from the top of the build directory: |
41 | | |
| 38 | A script "build_bsp" is attached which will assist in performing this task. It should be downloaded, placed in the same directory as the rtems/ source directory, and made executable (e.g. ''chmod +x build_bsp''). The following lines near the top of the "build_bsp" script should be edited to localize the following directory paths: |
42 | 39 | {{{ |
43 | | find . -name "*.exe" | while read f; do (cd `dirname $f `; mips-rtems4.12-size `basename $f`); done | grep "\.exe" |
| 40 | # Tailor these for your local installation |
| 41 | RTEMS_TESTER_DIR=${HOME}/rtems-4.11-work/rtems-tools/ |
| 42 | RTEMS_TOOLS_DIR=${HOME}/rtems-4.11-work/tools/ |
44 | 43 | }}} |
45 | 44 | |
46 | | Note that CPU will have to be replaced with the appropriate CPU architecture. |
| 45 | The script is invoked as: |
| 46 | {{{ |
| 47 | ./build_bsp CPU BSP |
| 48 | }}} |
| 49 | It will build the specified CPU/BSP in the appropriate configuration for evaluating the reduction in application executable size. When executed, the script will create a build directory (b-BSP), configure in that directory (output in b-BSP/c.log), and then build RTEMS (output in b-BSP/b.log). If the build completes successfully, a "0" will be printed. Otherwise an error has occurred. |
47 | 50 | |
48 | | Edit one or more .cfg and .inc files to add the appropriate options to CFLAGS_OPTIMIZE_V and LDFLAGS as shown in the previous section. |
| 51 | Record the size of the sample executables as reported by the "build_bsp" script and printed as part of the output on a successful build. This is an example invocation of "build_bsp" for the sh/gensh1 BSP: |
| 52 | {{{ |
| 53 | $ time ./build_bsp sh gensh1 |
49 | 54 | |
50 | | Edit one or more linkcmds files located within either c/src/lib/libbsp/CPU/BSP/startup/ or c/src/lib/libbsp/CPU/shared/startup to add the KEEP directives. |
| 55 | real 0m46.623s |
| 56 | user 1m48.800s |
| 57 | sys 0m32.261s |
| 58 | text data bss dec hex filename |
| 59 | 67826 8090 8760 84676 14ac4 ticker.exe |
| 60 | 29762 3770 5064 38596 96c4 minimum.exe |
| 61 | 144274 20038 10564 174876 2ab1c capture.exe |
| 62 | 84242 8502 8836 101580 18ccc nsecs.exe |
| 63 | 134978 18986 9328 163292 27ddc paranoia.exe |
| 64 | 150194 22910 9036 182140 2c77c cdtest.exe |
| 65 | 64850 7274 8728 80852 13bd4 base_sp.exe |
| 66 | 66946 7510 12168 86624 15260 unlimited.exe |
| 67 | 80770 5866 8316 94952 172e8 hello.exe |
| 68 | 0 |
| 69 | }}} |
| 70 | Note that the "time" command was used to measure how long this took to execute. The next lines show the size of the sample executables. The final line is "0" indicating the invocation was successful. |
51 | 71 | |
52 | | Rebuild the BSP variants in the BSP Family and again note the size. If there is no reduction, something is not right. If the reduction is near 100%, then something is not right. |
| 72 | Now make the modifications needed to turn on the per element section capability: |
| 73 | |
| 74 | * Edit one or more .cfg and .inc files to add the appropriate options to CFLAGS_OPTIMIZE_V and LDFLAGS as shown in the previous section. |
| 75 | |
| 76 | * Edit one or more linkcmds files located within either c/src/lib/libbsp/CPU/BSP/startup/ or c/src/lib/libbsp/CPU/shared/startup to add the KEEP directives. |
| 77 | |
| 78 | Using the "build_bsp" script, rebuild the BSP variants in the BSP Family and again note the sizes. If there is no reduction, something is not right. If the reduction is near 100%, then something is not right. |
53 | 79 | |
54 | 80 | If the BSP variant is one which can be tested on a simulator, then you need to test it. |