[PATCH 01/22] tester: Update to support new build system

Chris Johns chrisj at rtems.org
Wed Mar 3 00:57:42 UTC 2021


On 3/3/21 10:06 am, Joel Sherrill wrote:
> On Tue, Mar 2, 2021 at 4:48 PM Chris Johns <chrisj at rtems.org
> <mailto:chrisj at rtems.org>> wrote:
> 
>     On 3/3/21 3:54 am, Gedare Bloom wrote:
>     > On Tue, Mar 2, 2021 at 8:52 AM Joel Sherrill <joel at rtems.org
>     <mailto:joel at rtems.org>> wrote:
>     >> On Tue, Mar 2, 2021 at 9:46 AM Gedare Bloom <gedare at rtems.org
>     <mailto:gedare at rtems.org>> wrote:
>     >>>
>     >>> On Mon, Mar 1, 2021 at 1:01 PM Alex White <alexanderjwhite at gmail.com
>     <mailto:alexanderjwhite at gmail.com>> wrote:
>     >>>>
>     >>>> The tester configurations had not been updated to match the paths and
>     >>>> conventions used by the new build system. These have been updated,
>     >>>> and a few more libraries have been enabled in symbol-sets.ini.
>     >>>> ---
>     >>>>  tester/rtems/testing/bsps/griscv-sis-cov.ini  |  4 +-
>     >>>>  tester/rtems/testing/bsps/leon3-qemu-cov.ini  |  4 +-
>     >>>>  tester/rtems/testing/bsps/leon3-sis-cov.ini   |  4 +-
>     >>>>  tester/rtems/testing/coverage/symbol-sets.ini | 91 ++++++++++---------
>     >>>>  4 files changed, 52 insertions(+), 51 deletions(-)
>     >>>>
>     >>>> diff --git a/tester/rtems/testing/bsps/griscv-sis-cov.ini
>     b/tester/rtems/testing/bsps/griscv-sis-cov.ini
>     >>>> index 7249af6..e8de95f 100644
>     >>>> --- a/tester/rtems/testing/bsps/griscv-sis-cov.ini
>     >>>> +++ b/tester/rtems/testing/bsps/griscv-sis-cov.ini
>     >>>> @@ -35,7 +35,7 @@
>     >>>>  bsp            = griscv-sis
>     >>>>  arch           = riscv
>     >>>>  tester         = %{_rtscripts}/run.cfg
>     >>>> -target         = riscv-rtems5
>     >>>> +target         = riscv
> 
>     What is this being used for? I can only it present in the cov scripts.
> 
> 
> See below. 
> 
> 
>     >>> These are the only ini files that define this target? With this
>     >>> change, target is same as arch. Is target needed? I can't immediately
>     >>> tell where it gets used later?  'target' is usually understood as the
>     >>> binutil/gcc target triplet, so if the triplet is not being used, the
>     >>> variable should be less misleading. covoar_target might be better if
>     >>> this variable is needed in covar? I don't see it in any other
>     >>> non-coverage ini files though, so maybe it is not needed at all?
>     >>
>     >>
>     >> covoar originally used nm, addr2line, and objdump. This has been reduced to
>     >> objdump but it needs the target name to be able to invoke that. At this
>     point,
>     >> the target has to be provided or covoar has to have rtems6 hard-coded and
>     >> add rtems6 to the architecture.
>     >>
>     >> Is there a variable in the tester to set this to?
>     >>
>     >>>
>     >>>>  bsp_run_cmd    = %{rtems_tools}/%{bsp_arch}-rtems%{rtems_version}-sis
>     >>>>  bsp_run_opts   = -nouartrx -r -tlim 300 s -m 4 -cov
>     >>>> -bsp_covoar_cmd = -S %{bsp_symbol_path} -E %{cov_explanations} -f TSIM
>     >>>> +bsp_covoar_cmd = -T riscv-rtems6 -S %{bsp_symbol_path} -E
>     %{cov_explanations} -f TSIM
>     >>>
>     >>> what about:
>     >>> -T %{arch}-rtems%{rtems_version}
>     >>>
>     >>> We should be limiting hard-coding version numbers.
>     >>
>     >>
>     >> If that works, I would be happy.
>     >
>     > I t hink it might be %{bsp_arch} --- see bsp_run_cmd above ;)
> 
>     Do you need the option? There are other tools in rtems-tool that determine the
>     exec-prefix. Could the toolkit's support in `rtemstoolkit/rld-cc.h` help?
> 
>     We knows the arch from the machine type in the ELF file and the toolkit should
>     know the version. The nice thing about covoar is it keyed into the version.
> 
> 
> Can you get the GNU target? Knowing the architecture is only a bit of the problem?
> 
> I didn't spot anything in rtemstoolkit which  would give you CPU-rtems[567]...
> 
> If you have an example, great. 

There is no generic support for tools other than cc and ld at the moment but it
could be added to rld-cc.[h,cpp]. I suggest adding a call:

 void
 make_tool_command(const std::string            tool_name,
                   rld::process::arg_container& args)
 {
    std::string cmd = tool_name;
    if (!exec_prefix.empty ())
      cmd = exec_prefix + "-rtems" + rld::rtems::version () + '-' + cmd;
        args.push_back (cmd);
 }

... and then updating `make_cc_command` and `make_ld_command` to use this call.

An example of using the support with suitable command line options is ...

https://git.rtems.org/rtems-tools/tree/linkers/rtems-ld.cpp#n413
https://git.rtems.org/rtems-tools/tree/linkers/rtems-ld.cpp#n278

Then exec'ing a tool ...

https://git.rtems.org/rtems-tools/tree/linkers/rtems-syms.cpp#n307

Does help and make sense?

Chris


More information about the devel mailing list