Changes between Version 4 and Version 5 of GCI/Coding/AddPerSectionSupportToBSPs


Ignore:
Timestamp:
Jan 7, 2016, 12:44:42 AM (4 years ago)
Author:
Joel Sherrill
Comment:

Add information about build_bsp which will be attached

Legend:

Unmodified
Added
Removed
Modified
  • GCI/Coding/AddPerSectionSupportToBSPs

    v4 v5  
    2525KEEP
    2626}}}
    27 macro to such sections. See for example c/src/lib/libbsp/sparc/shared/startup/linkcmds.base which has already been tailored.
     27macro 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.
    2828
    2929== Task Requirements ==
     
    3636Be prepared to generate a proper patch for your changes.
    3737
    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 
     38A 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:
    4239{{{
    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
     41RTEMS_TESTER_DIR=${HOME}/rtems-4.11-work/rtems-tools/
     42RTEMS_TOOLS_DIR=${HOME}/rtems-4.11-work/tools/
    4443}}}
    4544
    46 Note that CPU will have to be replaced with the appropriate CPU architecture.
     45The script is invoked as:
     46{{{
     47./build_bsp CPU BSP
     48}}}
     49It 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.
    4750
    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.
     51Record 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
    4954
    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.
     55real    0m46.623s
     56user    1m48.800s
     57sys     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
     680
     69}}}
     70Note 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.
    5171
    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.
     72Now 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
     78Using 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.
    5379
    5480If the BSP variant is one which can be tested on a simulator, then you need to test it.