Gentoo Archives: gentoo-user

From: Alan McKinnon <alan.mckinnon@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] make -j <n> for kernel builds?
Date: Mon, 31 Oct 2016 22:07:54
Message-Id: 6163966d-51b1-9677-7124-bd9514f6a3f0@gmail.com
In Reply to: Re: [gentoo-user] make -j for kernel builds? by John Covici
1 On 31/10/2016 23:57, John Covici wrote:
2 > On Mon, 31 Oct 2016 13:37:50 -0400,
3 > Meino.Cramer@×××.de wrote:
4 >>
5 >> Dale <rdalek1967@×××××.com> [16-10-31 18:36]:
6 >>> Meino.Cramer@×××.de wrote:
7 >>>> Hi,
8 >>>>
9 >>>> from ancient times ;) I remember, that it is not advisable
10 >>>> to compile a linux kernel with more than one cpu core.
11 >>>>
12 >>>> Is that still true, or is it save to compile it with
13 >>>> "all you can eat" ::)) ?
14 >>>>
15 >>>> Cheers
16 >>>> Meino
17 >>>>
18 >>>>
19 >>>
20 >>> While I don't upgrade my kernel very often, since I don't reboot often
21 >>> either, I've used -j 6 for my 4 core CPU for a long time. I'm pretty
22 >>> sure I've done that ever since I built this rig. So far, no problems
23 >>> that I have seen.
24 >>>
25 >>> Dale
26 >>>
27 >>> :-) :-)
28 >>>
29 >>
30 >> Great! Currently rebuilding the kernel with '-j7 ' :)
31 >
32 > I wonder, how does it make sure that a dependency is always compiled
33 > before what depends on it, so the link and all that works?
34 >
35
36 The kernel is special - it's a completely self-contained body of code
37 with no external dependencies, so it is internally consistency almost as
38 a matter of course.
39
40 As for compiling the right things in the right order, the Makefiles take
41 care of that just like all other software with a build system. How does
42 the Makefile get made? Well, when you do make <something>config, you see
43 all those deps like how iwlwifi depends on 80211 which depends on
44 networking etc. That tells you the order things must be built in. Shove
45 that into a Makefile maker, and voila, Bob's your auntie. Build issues
46 tends to get fixed during the dev period so when Linux releases a kernel
47 there's an excellent chance it will build correctly.
48
49 FWIW, none of this is a specially difficult problem. It's the kind of
50 thing I'd expect bright CS students to be able to do at the end of the
51 first year
52
53
54
55 --
56 Alan McKinnon
57 alan.mckinnon@×××××.com

Replies

Subject Author
Re: [gentoo-user] make -j <n> for kernel builds? John Covici <covici@××××××××××.com>