libbsd: Conditional compilation of tests

Kinsey Moore kinsey.moore at oarcorp.com
Tue Oct 5 20:56:32 UTC 2021


On 10/5/2021 02:48, Chris Johns wrote:
> On 5/10/21 10:27 am, Kinsey Moore wrote:
>> Currently debugger01 is the only user of the test-if-library in libbsd and it
>> doesn't seem to work as expected. The configure step that detects libdebugger
>> occurs and succeeds as it should for the zynq a9 qemu BSP, but debugger01.exe
>> never gets compiled. I found this behavior while working on the implementation
>> for libdebugger for AArch64. Is there some configuration that I'm missing to
>> actually enable that test? Changing it to an unconditional test yields a
>> successfully compiled debugger01.exe.
>>
>> Perhaps someone that has more familiarity with the waf configure scripts can
>> tell me what I'm missing.
> More than likely :)
>
> This is the generator for 'test-if-library' ...
>
> https://git.rtems.org/rtems-libbsd/tree/builder.py?h=6-freebsd-12#n1184
>
> which is ...
>
> https://git.rtems.org/rtems-libbsd/tree/builder.py?h=6-freebsd-12#n658
>
> Now the easy bit of the hard part ....
>
> https://git.rtems.org/rtems-libbsd/tree/waf_libbsd.py?h=6-freebsd-12#n166
>
> which is adding 'True or' which leads to the hard part ... lots of data you need
> to look over. Look for the debugger01 test.
>
> The builder comes from ..
>
> https://git.rtems.org/rtems-libbsd/tree/wscript?h=6-freebsd-12#n76
>
> The output adding True creates is the `self.data` as the comment says and that
> is the internal view of the libbsd build and sources that is parsed to
> constructs the waf build. It is also used to manage the source merge to and from
> FreeBSD.
>
> The data is inserted into the build here so track the debugger insert ...
>
> https://git.rtems.org/rtems-libbsd/tree/waf_libbsd.py?h=6-freebsd-12#n91
>
> Finally the tests are generated here ...
>
> https://git.rtems.org/rtems-libbsd/tree/waf_libbsd.py?h=6-freebsd-12#n627
>
> Maybe something is wrong in this last part so the bld.program is not happening.
>
> I hope this helps.

Thanks, I think it got me to the root of the problem. When the libbsd 
waf build for the debugger01 test was moved from a header check to the 
more appropriate library check, it was still checking for HAVE_DEBUGGER 
which gets defined for header checks but not for library checks 
(alternatively, the waf library may have changed in the intervening 
period). I've sent a preliminary patch to the list that resolves the 
problem, but it may not be exactly the right patch for the job.


Kinsey



More information about the devel mailing list