On Tue, 11 Feb 2014, Panu Matilainen wrote:
On 02/10/2014 10:41 PM, Robert P. J. Day wrote:
> On Mon, 10 Feb 2014, Rick Stevens wrote:
>
> > On 02/10/2014 12:09 PM, Robert P. J. Day issued this missive:
> > >
> > > grrrrrr ... following the instructions here:
> > >
> > >
https://fedoraproject.org/wiki/Building_a_custom_kernel
> > >
> > > on how to build a custom kernel (some of which is incorrect, more on
> > > that later), and builds keep failing at random places, i'm guessing
> > > because i have a hyperthreaded quad-core laptop, and the "make
-j8" is
> > > simply tripping over itself in arbitrary places.
> > >
> > > what's the easiest way to specify a single-threaded build? yes,
it
> > > will take forever, but it will be nice to verify that that's the
> > > problem.
> > >
> > > thanks.
> > >
> > > rday
> >
> > Theoretically you could do
> >
> > MAKEFLAGS="-j 1" rpmbuild blah-blah
> >
> > gmake looks for the environment variable "MAKEFLAGS". Most
reasonable
> > makefiles do "MAKEFLAGS+=other-specific-flags", so it should honor
it.
> > Keep in mind that if there are multiple "-j" variables to gmake, it
will
> > only honor the LAST one specified. YMMV.
>
> well, this is interesting ... i found the variable "smp_mflags" in
> kernel.spec, so i ran:
>
> $ rpmbuild --showrc
>
> to see how it was being set, and found the following:
>
> -14: _smp_mflags %(
> [ -z "$RPM_BUILD_NCPUS" ] \
> && RPM_BUILD_NCPUS="`/usr/bin/nproc 2>/dev/null || \
> /usr/bin/getconf _NPROCESSORS_ONLN`"; \
> if [ "$RPM_BUILD_NCPUS" -gt 16 ]; then \
> echo "-j16"; \
> elif [ "$RPM_BUILD_NCPUS" -gt 3 ]; then \
> echo "-j$RPM_BUILD_NCPUS"; \
> else \
> echo "-j3"; \
> fi )
>
> which i find fascinating since, if you follow the logic, even if you
> use "RPM_BUILD_NCPUS=1", that code above will still set it to 3. :-)
That'd be from your ~/.rpmmacros as set up by rpmdev-setuptree, not
from rpm itself. The rationale is to detect parallel build problems
in package makefiles on non-smp systems so the packager knows to
avoid %{?_smp_mflags} with make in %build.
argh ... i didn't even realize that "rpmdev-setuptree" created a
personal .rpmmacros file for me; i'm so used to creating that entire
build structure myself manually.
Note that the kernel build is known to work with parallel build, so
the problems you're seeing are something else, such as subtly faulty
components (cpu/memory/motherboard...) that trip up when pushed
hard, or overheating.
i'm willing to believe that, although this ASUS quad core has
massive cooling vents on the back, so maybe i'll run memtest on it for
a while and see what shakes out. as it is, just dropping
parallelization down to 3 seems to solve the problem, for what that's
worth.
rday
--
========================================================================
Robert P. J. Day Ottawa, Ontario, CANADA
http://crashcourse.ca
Twitter:
http://twitter.com/rpjday
LinkedIn:
http://ca.linkedin.com/in/rpjday
========================================================================