[PATCH rtems-lwip v1 1/8] lwip.py: Add library and compile flags
Kinsey Moore
kinsey.moore at oarcorp.com
Wed Aug 24 12:32:18 UTC 2022
On 8/23/2022 21:24, Chris Johns wrote:
> 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?
It doesn't; this patch is a more general flags fixup patch. This allows
applications to link against libm and is something that NTP will need.
Without this waf can't resolve the libm reference and omits it in the
linking step. If you'd prefer this to be split into two different
patches, I can do that.
>
>> + 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
It's possible we've never noticed because we always use them together,
but it probably needs the check just to be thorough.
Kinsey
More information about the devel
mailing list