Re: [PATCH RSB v2] rtems-kernel: Implement kernel recipe using waf

2021-11-02 Thread Chris Johns
On 3/11/21 4:13 am, Ryan Long wrote:
> 
> -Original Message-
> From: Chris Johns  
> Sent: Monday, November 1, 2021 8:48 PM
> To: Ryan Long ; devel@rtems.org
> Subject: Re: [PATCH RSB v2] rtems-kernel: Implement kernel recipe using waf
> On 28/10/21 2:09 am, Ryan Long wrote:
>> + %define rtems_bsp 
>> + %(%{_topdir}/../source-builder/rtems-kernel-config-check -b 
>> + %{with_rtems_bsp_config})
> 
> How are config file errors handled? I normally return `ERROR` or something 
> that can be checked.
> [Ryan Long] Right now the script is handling all the errors. I'll add some 
> error checking to rtems-kernel-common.cfg.

And if the helper script finds and error what happens to the RSB build?

Chris
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


Re: [PATCH] fix memory leak within calloc.c libtests

2021-11-02 Thread Joel Sherrill
This looks good to me.

--joel

On Mon, Nov 1, 2021 at 8:18 PM zack leung  wrote:
>
> bump
>
>
> On Mon, 18 Oct 2021 at 23:46, zack leung  wrote:
>
> > fix came from github code inspector, flagged by one of the analysis that
> > was done
> > ---
> >  testsuites/libtests/POSIX/calloc.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/testsuites/libtests/POSIX/calloc.c
> > b/testsuites/libtests/POSIX/calloc.c
> > index bd04faa800..a7537c8cc4 100644
> > --- a/testsuites/libtests/POSIX/calloc.c
> > +++ b/testsuites/libtests/POSIX/calloc.c
> > @@ -16,6 +16,8 @@ int
> >  main (void)
> >  {
> >void *foo = calloc (42, 43);
> > +  int rc = (foo != NULL);
> > +  free(foo);
> >
> > -  return (foo != NULL);
> > +  return rc;
> >  }
> > --
> > 2.33.0
> >
> ___
> devel mailing list
> devel@rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


RE: [PATCH RSB v2] rtems-kernel: Implement kernel recipe using waf

2021-11-02 Thread Ryan Long


-Original Message-
From: Chris Johns  
Sent: Monday, November 1, 2021 8:48 PM
To: Ryan Long ; devel@rtems.org
Subject: Re: [PATCH RSB v2] rtems-kernel: Implement kernel recipe using waf

On 28/10/21 2:09 am, Ryan Long wrote:
> Closes #4145
> ---
>  rtems/config/tools/rtems-kernel-6.cfg  |   6 +-
>  rtems/config/tools/rtems-kernel-common.cfg | 125 
>  source-builder/rtems-kernel-config-check   | 147 
> +
>  source-builder/sb/options.py   | 135 +-
>  4 files changed, 283 insertions(+), 130 deletions(-)  create mode 
> 100755 source-builder/rtems-kernel-config-check
> 
> diff --git a/rtems/config/tools/rtems-kernel-6.cfg 
> b/rtems/config/tools/rtems-kernel-6.cfg
> index f1d0990..9120862 100644
> --- a/rtems/config/tools/rtems-kernel-6.cfg
> +++ b/rtems/config/tools/rtems-kernel-6.cfg
> @@ -2,10 +2,10 @@
>  # RTEMS 5
>  #
>  
> -%define rtems_kernel_version 3ec5f20484cc4201e1d7b87844505644533b6148
> -%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.bz2 \
> -  
> BjMKrf5n1YR6IpiZrY5TUEzKATPRJxA2/6m6f833DdRu+RyLxccXqA4gHRdVUqFelFNQ3o0XdG4o1naBKYfhkQ==
> +%define rtems_kernel_version 3bb97a30b17b6c138dead3e3a6b329c3b301cdb3
>  
> +%hash sha512 rtems-kernel-%{rtems_kernel_version}.tar.gz \
> +  
> +m/ogwrJj4X60ewDIbV6WRj1MJa/22gQHQd56XiNMfvCr0nsvcXdkXKAObLIGYIGYfUyEw
> +lVk3SRjjRFkFalDGQ==
>  #
>  # The RTEMS build instructions.
>  #
> diff --git a/rtems/config/tools/rtems-kernel-common.cfg 
> b/rtems/config/tools/rtems-kernel-common.cfg
> index 157c7a4..d5b67dd 100644
> --- a/rtems/config/tools/rtems-kernel-common.cfg
> +++ b/rtems/config/tools/rtems-kernel-common.cfg
> @@ -9,7 +9,7 @@
>  # and BSPs. Only after the source to download.
>  #
>  %if %{_dry_run} && %{defined with_download}
> - %log Kenrel configuration errors ignored
> + %log Kernel configuration errors ignored
>   %define rtems_kernel_error 0
>  %else
>   %define rtems_kernel_error 1
> @@ -19,10 +19,15 @@
>   %define rtems_kernel_version %{rsb_version}  %endif
>  
> +%if %{defined with_rtems_bsp_config}
> + %define _target 
> +%(%{_topdir}/../source-builder/rtems-kernel-config-check -v 
> +%{rtems_version} -t %{with_rtems_bsp_config})

There is a variable called `_sbdir` that is normally used to find internal 
helper scripts located in the source builder...

https://docs.rtems.org/branches/master/user/rsb/configuration.html#configuration

If you add `rtems-kernel-config-check` to `source-builder` it becomes a user 
facing tool and needs documentation and a controlled user interface. If you use:

 %{_sbdir}/sb/rtems-kernel-config-check

the helper script is internal to the source builder. Is the script internal?
[Ryan Long] I think it would only be useful in this case, so I'll move that to 
sb.

> + %define rtems_bsp 
> + %(%{_topdir}/../source-builder/rtems-kernel-config-check -b 
> + %{with_rtems_bsp_config})

How are config file errors handled? I normally return `ERROR` or something that 
can be checked.
[Ryan Long] Right now the script is handling all the errors. I'll add some 
error checking to rtems-kernel-common.cfg.

> +%endif
> +
>  #
>  # The target. It could be set in rtems_target.
>  #
> -%if %{defined rtems_target}
> +%if %{defined rtems_target} && !%{defined with_rtems_bsp_config}
>   %define _target %{rtems_target}
>  %endif
>  %if %{_target} == %{nil} && %{rtems_kernel_error} @@ -32,10 +37,21 @@  
> #  # The BSP.
>  #
> -%if !%{defined with_rtems_bsp} && %{rtems_kernel_error}
> +%if !%{defined with_rtems_bsp} && %{rtems_kernel_error} && !%{defined 
> +with_rtems_bsp_config}
>   %error No RTEMS BSP specified: --with-rtems-bsp=bsp  %endif -%define 
> rtems_bsp %{with_rtems_bsp}
> +%if !%{defined with_rtems_bsp_config}  %define rtems_bsp 
> +%{with_rtems_bsp} %endif
> +
> +#
> +# Configuration file used with waf
> +#
> +%ifn %{defined with_rtems_bsp_config}  %define config_file 
> +config-%{_target}-%{rtems_bsp}.ini
> +%else
> + %define config_file %{with_rtems_bsp_config} %endif
>  
>  #
>  # If no tools are provided use the prefix.
> @@ -98,14 +114,6 @@ URL:   https://www.rtems.org/
>   %define rtems_posix 0
>  %endif
>  
> -%if %{defined with_rtems_legacy_network}
> - %define rtems_networking 1
> -%endif
> -
> -%if %{defined with_rtems_cxx}
> - %define rtems_cxx 1
> -%endif
> -
>  %if %{defined with_rtems_bspopts}
>   %define bspopts %{with_rtems_bspopts}  %endif
> @@ -143,43 +151,43 @@ URL: https://www.rtems.org/
>  # --without-rtems-tests  : Supported, forced to no
>  # --with-rtems-smp   : Supported
>  # --without-rtems-smp: Don't care
> -# --with-rtems-legacy-network: Supported
> +# --with-rtems-legacy-network: Unsupported
>  # --without-rtems-legacy-network : Don't care
> -# --with-rtems-bspopts   : Supported, quote for a list
> -# --without-rtems-bspopts: Don't care
> -#
>  %if %{defined without_rtemsbsp}
>   %error Option