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

Andreas Naumann dev at andin.de
Mon Mar 16 22:15:24 UTC 2020


Hi,

On 12.03.20 14:00, Arnout Vandecappelle wrote:
> 
> 
> 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

The issue was that the cmake configure step stopped with an error if I 
used the -O option. I dont think it was related to which output strategy 
was used.

>> 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.

I dont mind the entering/leaving info. Rather I thought -Orecurse would 
buffer everything to the end of the buildroot process, which is not what 
I wanted.

>>
>> 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?

I did after brmake.

> 
>   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...

Hmm, I have not seen problems anywhere else with the -O option. Just in 
this case the configure step died. After some fiddling I found out it's 
connected to what the bootstrap script does with the option 
--parallel=$(PARALLEL_JOBS). If the --parallel option was not used then 
-Oxxx was not a problem, but of course, the build used one core only.


regards,
Andreas




> 
>   Regards,
>   Arnout
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
> 


More information about the buildroot mailing list