[PATCH rtems-lwip v1 1/8] lwip.py: Add library and compile flags

Chris Johns chrisj at rtems.org
Wed Aug 24 02:24:39 UTC 2022


On 24/8/2022 5:47 am, Kinsey Moore wrote:
> This allows linking with libm and follows the RTEMS convention of
> compiling with function sections for linking optimization and dead code
> removal.
> ---
>  lwip.py | 11 +++++++++++
>  wscript |  2 +-
>  2 files changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/lwip.py b/lwip.py
> index f565deb..b97d273 100644
> --- a/lwip.py
> +++ b/lwip.py
> @@ -173,3 +173,14 @@ def build(bld):
>                  use='telnetd lwip rtemstest ftpd',
>                  cflags='-g -Wall -O0',
>                  includes=drv_incl + common_includes + './rtemslwip/test/ ' + os.path.relpath(os.path.join(arch_lib_path,'include')))
> +
> +def add_flags(flags, new_flags):
> +    for flag in new_flags:
> +        if flag not in flags:
> +            flags.append(flag)
> +
> +def bsp_configure(conf, arch_bsp):
> +    conf.env.LIB += ['m']

How do the section options result in needing libm?

> +    section_flags = ["-fdata-sections", "-ffunction-sections"]

This is triggering a tweak ...
https://git.rtems.org/rtems_waf/tree/rtems.py#n390. I wonder if a check for
`-fdata-sections` is missing in rtems_waf?

Chris


More information about the devel mailing list