Pass multiple same options to rtems_linkflags
Peng Fan
van.freenix at gmail.com
Sun Jul 27 14:01:34 UTC 2014
Sorry. The patch is in the attachment. Missed it just now.
2014-07-27 22:00 GMT+08:00 Peng Fan <van.freenix at gmail.com>:
> Hi,
>
>
> 2014-07-26 9:28 GMT+08:00 Chris Johns <chrisj at rtems.org>:
>
> On 26/07/2014 12:25 am, Peng Fan wrote:
>>
>>> Hi Chris,
>>>
>>> I build a rap file using such a command :
>>> rtems-ld --lib-path
>>> /opt/rtems-4.11/arm-rtems4.11/realview_pbx_a9_qemu/lib --lib m --lib
>>> rtemscpu --lib rtemsbsp --base rtld.prelink --entry rtems a.o b.o c.o
>>> *.o ...
>>> Is this ok? can reference a symbol in librtemscpu.a librtemsbsp.a? or
>>> the reference symbol from librtemscpu.a librtemsbsp.a should be included
>>> in the base image but not in the rap file?
>>>
>>
>> This is fine. You do not need to load a base image with everything you
>> might need.
>>
>> If you create another RAP file and do the same thing and that RAP pulls
>> the same code in from one of those libraries it will not be linked to.
>> Rather the first instance of the code loaded is used. The downside is a
>> possible waste of code.
>>
> Yeah.Other RAP file which references the same code that already in the
> first rap should not pull the same code into the final image.
>
>>
>> I suppose we could add code to compact the memory and not loaded the
>> object file and so the overhead is limited to the RAP file.
>
> Sorry. I can not got this. what code should be added to rtl-host?
>
>>
>>
>>
>>> I set rtems_linkflags like this:
>>> rtems_linkflags = ['--base', 'rtld.prelink',
>>> '--lib-path',
>>> '/opt/rtems-4.11/arm-rtems4.11/realview_pbx_a9_qemu/lib',
>>> '--entry', 'my_main', '--lib', 'm', '--lib',
>>> 'rtemscpu' , '--lib', 'rtemsbsp'],
>>> But waf only uses one '--lib', it removes the other two '--lib', like
>>> this: xxx '--entry', 'my_main', '--lib', 'm', 'rtemscpu', 'rtemsbsp',xxx
>>> I am not familar with waf, any advice about his?
>>>
>>
>> Try using LIBS and adding to that. Getting the order correct can be
>> tricky.
>
> To bld whose feature is 'c program', libs = ['m', 'xxx'] works. But to 'c
> rap' which is defined in RTL, adding libs to bld of waf does not work. So I
> wrote a patch to fix this, the patch first clear the RTEMS_LINKFLAGS env,
> then refill it. The patch is in the attachments.
>
> Regards,
> Peng.
>
>
>>
>> Chris
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140727/01d9c751/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-multiple-same-options-in-rtems_linkflags-problem.patch
Type: application/octet-stream
Size: 1721 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/devel/attachments/20140727/01d9c751/attachment-0002.obj>
More information about the devel
mailing list