* [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps
@ 2017-05-03 9:15 Mason
2017-05-03 9:35 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Mason @ 2017-05-03 9:15 UTC (permalink / raw)
To: buildroot
Hello,
I use buildroot to generate kernel + rootfs image for an ARM
platform, typically cross-compiled with the Linaro toolchain.
I also have a large body of software in a separate repo
(outside of the BR tree) with its own build system.
This repo includes kernel modules, user-space libraries
and apps, which need to be cross-compiled and built on
top of the rootfs generated by BR.
Therefore, I would need to pass some information from BR
to the separate build system, such as
- ARCH
- CROSS_COMPILE
- location of the cross-toolchain, to add to the PATH
- location of the sysroot
What is the best way to do this?
I tried a post-image script, but I didn't see ARCH or
CROSS_COMPILE in the env or as arguments.
Regards.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps
2017-05-03 9:15 [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps Mason
@ 2017-05-03 9:35 ` Thomas Petazzoni
2017-05-03 9:48 ` Mason
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2017-05-03 9:35 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 3 May 2017 11:15:15 +0200, Mason wrote:
> I use buildroot to generate kernel + rootfs image for an ARM
> platform, typically cross-compiled with the Linaro toolchain.
>
> I also have a large body of software in a separate repo
> (outside of the BR tree) with its own build system.
What do you call "its own build system" ?
> This repo includes kernel modules, user-space libraries
> and apps, which need to be cross-compiled and built on
> top of the rootfs generated by BR.
>
> Therefore, I would need to pass some information from BR
> to the separate build system, such as
>
> - ARCH
> - CROSS_COMPILE
> - location of the cross-toolchain, to add to the PATH
> - location of the sysroot
>
> What is the best way to do this?
Create Buildroot packages for the different software components you
need to build.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps
2017-05-03 9:35 ` Thomas Petazzoni
@ 2017-05-03 9:48 ` Mason
2017-05-03 12:23 ` Thomas Petazzoni
0 siblings, 1 reply; 4+ messages in thread
From: Mason @ 2017-05-03 9:48 UTC (permalink / raw)
To: buildroot
On 03/05/2017 11:35, Thomas Petazzoni wrote:
> On Wed, 3 May 2017 11:15:15 +0200, Mason wrote:
>
>> I use buildroot to generate kernel + rootfs image for an ARM
>> platform, typically cross-compiled with the Linaro toolchain.
>>
>> I also have a large body of software in a separate repo
>> (outside of the BR tree) with its own build system.
>
> What do you call "its own build system" ?
A scary jungle of intertwined / recursive Makefiles. Basically,
one types 'make all' to build modules, libs, apps, and firmwares.
Sorting this mess out would be a multi-man-months effort.
>> This repo includes kernel modules, user-space libraries
>> and apps, which need to be cross-compiled and built on
>> top of the rootfs generated by BR.
>>
>> Therefore, I would need to pass some information from BR
>> to the separate build system, such as
>>
>> - ARCH
>> - CROSS_COMPILE
>> - location of the cross-toolchain, to add to the PATH
>> - location of the sysroot
>>
>> What is the best way to do this?
>
> Create Buildroot packages for the different software components you
> need to build.
OK, what's the second best way to do this, then?
The way it was done in the past is to get BR to produce a script
that exports the above information, and source said script before
invoking the proprietary build system.
Regards.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps
2017-05-03 9:48 ` Mason
@ 2017-05-03 12:23 ` Thomas Petazzoni
0 siblings, 0 replies; 4+ messages in thread
From: Thomas Petazzoni @ 2017-05-03 12:23 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 3 May 2017 11:48:28 +0200, Mason wrote:
> > What do you call "its own build system" ?
>
> A scary jungle of intertwined / recursive Makefiles. Basically,
> one types 'make all' to build modules, libs, apps, and firmwares.
> Sorting this mess out would be a multi-man-months effort.
You don't need to "sort this mess out". Just create a Buildroot package
that does "make all".
> > Create Buildroot packages for the different software components you
> > need to build.
>
> OK, what's the second best way to do this, then?
Again: create a package for it. Whatever you think should be done in a
shell script can be done in a Buildroot package, so there is no reason
to not create a Buildroot package for your stuff.
You don't necessarily need to split it into multiple Buildroot
packages. It can be just one big Buildroot package that calls your
"make all" stuff to build your home-grown apps/libs/modules in one go.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-03 12:23 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03 9:15 [Buildroot] Cross-compiling out-of-tree kernel modules and user-space apps Mason
2017-05-03 9:35 ` Thomas Petazzoni
2017-05-03 9:48 ` Mason
2017-05-03 12:23 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox