[PATCH] spec/libdebugger: Only enable for supported architectures

Chris Johns chrisj at rtems.org
Thu Oct 21 08:06:31 UTC 2021


On 21/10/21 4:59 pm, Sebastian Huber wrote:
> On 21/10/2021 07:45, Chris Johns wrote:
>> On 21/10/21 4:30 pm, Sebastian Huber wrote:
>>> On 21/10/2021 04:09, chrisj at rtems.org wrote:
>>>> From: Chris Johns<chrisj at rtems.org>
>>>>
>>>> ---
>>>>    spec/build/cpukit/libdebugger.yml             | 5 ++++-
>>>>    spec/build/testsuites/libtests/debugger01.yml | 4 +---
>>>>    2 files changed, 5 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/spec/build/cpukit/libdebugger.yml
>>>> b/spec/build/cpukit/libdebugger.yml
>>>> index f316cc18e8..4e689044e7 100644
>>>> --- a/spec/build/cpukit/libdebugger.yml
>>>> +++ b/spec/build/cpukit/libdebugger.yml
>>>> @@ -5,7 +5,9 @@ copyrights:
>>>>    - Copyright (C) 2020 embedded brains GmbH (http://www.embedded-brains.de)
>>>>    cppflags: []
>>>>    cxxflags: []
>>>> -enabled-by: true
>>>> +enabled-by:
>>>> +- arm
>>>> +- i386
>>>>    includes: []
>>>>    install: []
>>>>    install-path: ${BSP_LIBDIR}
>>>> @@ -24,4 +26,5 @@ source:
>>>>    - cpukit/libdebugger/rtems-debugger-target.c
>>>>    - cpukit/libdebugger/rtems-debugger-threads.c
>>>>    target: debugger
>>>> +name: BUILD_LIBDEBUGGER
>>>>    type: build
>>>
>>> Library items cannot have a name. You need an option item for this.
>>
>> An option implies it is user configurable and it is not. How would you pass the
>> enable-it state to the tests?
> 
> Yes, all options can be set by the user.

Huh? Libdl is not optional and it has an `opt*` file.

What is the user option for controlling libdl? I could not find one in the
bsp_defaults.

>> If there is another approach could be please explain how this is to handled?
> 
> One only option is to use an option.

Sorry, again I cannot follow what I am suppose to do. There are no options
related to building libdebugger. It is fixed by the arch and it needs to be that
way. It is either enabled for an arch or it is not and the common files should
not be built if there is no support. Building the common files into a the lib
breaks backward compatibility for users detecting the library and then using it.

I am confused why an option would be used or even considered. It seems wrong to
me and the documentation would support that. It says "Use the prefix opt for
options.". Again it is not optional.

Why is what I have done not suitable? I have used the fields present in the YAML
files and it seems to work?

An example of what is needed may help?

>> The waf build for libdebugger is broken. The library should only be built for
>> the archs that have a backend. As it currently is the library is created and
>> installed and this is hidden by the fact the test is conditional on the archs
>> and not the library being built. This is now exposed by Kinsey's patch to
>> libbsd. LibBSD does not build.
>>
>> I based adding the name on libdl. It seems libdl is done differently and I have
>> no idea why and how it works.
> 
> libdl uses an option:

Yes. I followed the "Find the Right Item" section and used grep to find libdl
and copied what it does. It failed.

> spec/build/cpukit/optlibdl.yml

Hmmm and???

As I said I copied optlibdl.yml to optlibdebugger.yml, added the similar stuff
to libdl to cpuopts.yml and it did not work. This is the error:

raceback (most recent call last):
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Scripting.py",
line 119, in waf_entry_point
    run_commands()
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Scripting.py",
line 182, in run_commands
    ctx=run_command(cmd_name)
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Scripting.py",
line 173, in run_command
    ctx.execute()
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Scripting.py",
line 375, in execute
    return execute_method(self)
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Build.py",
line 93, in execute
    self.execute_build()
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Build.py",
line 96, in execute_build
    self.recurse([self.run_dir])
  File
"/opt/work/si/rtems/rtems.git/.waf-2.0.20-36f5354d605298f6a89c09e0c7ef6c1d/waflib/Context.py",
line 133, in recurse
    user_function(self)
  File "/opt/work/si/rtems/rtems.git/wscript", line 1501, in build
    items[bld.env.TOPGROUP].build(bld, bic)
  File "/opt/work/si/rtems/rtems.git/wscript", line 223, in build
    p.build(bld, bic)
  File "/opt/work/si/rtems/rtems.git/wscript", line 223, in build
    p.build(bld, bic)
  File "/opt/work/si/rtems/rtems.git/wscript", line 222, in build
    for p in self.links():
  File "/opt/work/si/rtems/rtems.git/wscript", line 194, in _init_links
    self._links.append(items[uid])
KeyError: '/cpukit/optlibddebugger'

You have to admit this is a horrible error message. It provides no insight into
problem or the solution.

Chris


More information about the devel mailing list