[Buildroot] [PATCH v6 18/28] package/cmake: Fix for using -O in top-level make

Arnout Vandecappelle arnout at mind.be
Thu Mar 12 13:00:24 UTC 2020



On 11/03/2020 23:25, Thomas Petazzoni wrote:
> Hello,
> 
> Let's add Arnout in the loop, for the make sorcery.

 Not much sorcery going on here...

> On Mon, 17 Feb 2020 22:23:40 +0100
> Andreas Naumann <anaumann at ultratronik.de> wrote:
> 
>> Setting -O in top level make somehow interferes with the explicit setting of
>> -jX in the cmake bootstrap script. Avoid passing down MAKEFLAGS in the configure
>> case.
>>
>> Signed-off-by: Andreas Naumann <anaumann at ultratronik.de>
> 
> This commit log was a bit vague on what the issue was. If I understand
> correctly, what you see is that the "make" process running to build
> host-cmake is constantly entering/leaving its build directory, like
> this:
> 
> make[3]: Entering directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> [ 50%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read_support_filter_rpm.c.o
> make[3]: Leaving directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> make[3]: Entering directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> [ 50%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read_support_filter_none.c.o
> make[3]: Leaving directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> make[3]: Entering directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> [ 50%] Building C object Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_read_support_filter_program.c.o
> make[3]: Leaving directory '/home/thomas/projets/buildroot/output/build/host-cmake-3.15.5'
> 
> Reading
> https://www.gnu.org/software/make/manual/html_node/Parallel-Output.html,
> it seems like it is expected for -Otarget to behave like this.

Indeed, looks exactly like expected.

> However,
> if you use -Orecurse, it works as expected: the entire output of the
> sub-make is buffered, and output in one-go when the make target at the
> Buildroot level completes.
> 
> So I'm not sure we want to prevent -Otarget from doing what it does: we
> should probably instead use -Orecurse.


 Where do we pass -Otarget to begin with?

 There could be something to be set for globall resetting MAKEFLAGS and taking
control over the make flags entirely from Buildroot infra when calling into
package build systems. However, this is a bit complicated in make, and I'm not
entirely convinced we really want that...

 Regards,
 Arnout


More information about the buildroot mailing list