[PATCH] Use linker garbage collection for BSP based builds

Chris Johns chrisj at rtems.org
Tue Apr 14 08:56:01 UTC 2020


On 14/4/20 5:12 pm, Sebastian Huber wrote:
> On 14/04/2020 09:02, Chris Johns wrote:
> 
>> On 14/4/20 4:57 pm, Sebastian Huber wrote:
>>> Close #3944.
>>> ---
>>>   rtems/config/rtems-bsp.cfg | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/rtems/config/rtems-bsp.cfg b/rtems/config/rtems-bsp.cfg
>>> index d50615e..91296b1 100644
>>> --- a/rtems/config/rtems-bsp.cfg
>>> +++ b/rtems/config/rtems-bsp.cfg
>>> @@ -231,7 +231,7 @@
>>>   # The linker flags need to include the machine options for the BSP.
>>>   #
>>>   %define mflags_filter  awk '{for (i=1;i<NF;++i) if ($i ~ /\-m/) 
>>> printf("%s ",$i);}'
>>> -%define rtems_bsp_ldflags %{rtems_bsp_ldflags} $(echo 
>>> "%{rtems_bsp_cflags}" | %{mflags_filter})
>>> +%define rtems_bsp_ldflags %{rtems_bsp_ldflags} $(echo 
>>> "%{rtems_bsp_cflags}" | %{mflags_filter}) -Wl,--gc-sections
>>
>> What about adding a define like ..
>>
>> %define rtems_bsp_ldflags_extra -Wl,--gc-sections
>>
>> .. or something like that and then adding it to rtems_bsp_ldflags?
>>
>> It would make it easier to track. 
> Could you please change the patch and push it.

Sure, I will do this tomorrow.

> In RTEMS 6, we should replace this flag tinkering.

We need to only expose the machine flags from RTEMS by default and an 
extra flags are special pkgcfg flags.

Chris


More information about the devel mailing list