the mk/cc.mk file seems to be causing this. if i comment out the line: CFLAGS+= ${_CC_FLAGS}$(shell ${_CC_FLAGS_SH}) then subdirs build in parallel just fine simple test is to go into src/rc/ and run `make clean && make -j`. it's obvious to tell a serial build vs a parallel build.
This appears to be an issue with GNU make. FreeBSD and NetBSD make build fine in parallel. One of my longer term goals is to remove the mk stubs I've been using and move to a home grown configure script similar to as seen in dhcpcd-5.1.x That should solve this, but I don't have time for that right now. And no, autotools is not an option :)
while that might be true, the current build code executes gcc 17 times for every object compiled (number of flags in ${_CCFLAGS}). that hardly sounds like a good idea. perhaps a better idea would be to cache the results in a file and read that back if it exists.
a quicker fix might be to change the $(shell ...) to `...` after all, the way the code is written currently, the $(shell) is expanded when the CFLAGS variable is expanded, and that gets expanded in every compile invocation or use := to force immediate evaluation -- not like cc.mk is included when it isnt used, so you wont have "wasted" expansion _CC_FLAGS_SH := $(shell ......) CFLAGS += ${_CC_FLAGS}${_CC_FLAGS_SH} if i had to guess based on some testing, make serializes $(shell) invocation so when it gets expanded by a target, all targets wait at that sync point. maybe the internal code has a mutex so that only one thing can execute. no idea, but i'll complain to upstream about it.
upstream maintains that current behavior in GNU make isnt going to change any time soon (if at all), so we'll need to rewrite the build system a bit
This should be noted in the documentation or is a blocker to openrc going stable? When updating the scripts some scripts seem to be orphaned as well bug #347483 Suspect the majority of new installations have multiple cpu's my opinion is the docs should note this. after reading a second time the comments I am unclear whether you mean here openrc will not build in parallel or software built on an openrc system will not build in parallel.
this bug has nothing to do with runtime execution. like the summary says, this is about building only.
(In reply to comment #4) > upstream maintains that current behavior in GNU make isnt going to change any > time soon (if at all), so we'll need to rewrite the build system a bit Mike and all, since we are maintaining openrc as a gentoo project now, do we want to consider converting to autotools? If so, I will volunteer to look into doing the conversion.
i dont see the effort today being worth it
I have added a fix in git, commit cca7e9f, which should improve this. We now only support GNU make, so commit c2529c1 was also added to change the README to reflect this. If you feel comfortable testing from git, feel free to test, or, this fix will be available in the next release. Feel free to reopen if this reoccurs.
Heh, I didn't look who the reporter was when I wrote my last comment. ;-) If you emerge from the live ebuild you will get the fix. Re-open if this is still an issue.