[Scons-users] Building Linux Kernel Loadable Modules

Bill Deegan bill at baddogconsulting.com
Wed Jan 14 18:59:31 EST 2015


Enrique,

You may want to use:
env.SharedObject() instead of Object()

You might also consider a PseudoBuilder (see users guide) for such instead
of a builder given it's basically just N compiles and 1 link per module?

-Bill

On Wed, Jan 14, 2015 at 3:02 PM, Enrique Herrera <enriqueh73 at gmail.com>
wrote:

> env.Object('foo.o','$SRC/driver/mstpmain.c')
> env.Object('bar.o','$SRC/driver/queue.c')
> env.Command('foobar.o',['fo.o','bar.o'],'$LD -r $SOURCES -o $TARGET')
>
> This is the way I got it working. I would have to create a Builder if it
> gets any more complicated or more drivers in the project.
>
> Thanks for you help.
>
> On Wed, Jan 14, 2015 at 2:46 PM, Dirk Bächle <tshortik at gmx.de> wrote:
>
>> Hi Enrique,
>>
>> On 14.01.2015 21:42, Enrique Herrera wrote:
>>
>>>
>>> I have a legacy Linux embedded application, that uses Scons has its
>>> build tool. The project only consists of an SConstruct file. I
>>> do not have the luxury of having SConfig.py and Sconscript files within
>>> this project. I have been trying to add a new
>>> env.Environment() that will build an external loadable module of a Linux
>>> Kernel 2.4.x driver.
>>>
>>> Basically, this is what I need to do this to build the driver:
>>>
>>> [...]
>>>
>>> ld -r foo.o bar.o -o foobar.o
>>>
>>> [...]
>>>
>>> That's not what I really want to do. I just need to link the two object
>>> files together. I really do not know how.
>>>
>>>
>> you can use the Command() method (see http://www.scons.org/doc/
>> production/HTML/scons-user.html#chap-builders-commands ) to run single
>> commands like this one. However, if you need this functionality more often
>> you should consider to write a proper Builder for creating loadable Kernel
>> modules (see http://www.scons.org/wiki/ToolsForFools ).
>> The Command() should look something like this:
>>
>>   env.Command('foobar.o', ['foo.o', 'bar.o'], '$LD -r $SOURCES $TARGET')
>>
>> Best regards,
>>
>> Dirk
>>
>> _______________________________________________
>> Scons-users mailing list
>> Scons-users at scons.org
>> https://pairlist4.pair.net/mailman/listinfo/scons-users
>>
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150114/fe648bc3/attachment.html>


More information about the Scons-users mailing list