Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Can't rebuild gentoo kernel-4.9.16 with gcc-5.4.0
Date: Tue, 30 May 2017 19:15:28
Message-Id: 2432739.XTOgqIVGdG@dell_xps
In Reply to: Re: [gentoo-user] Can't rebuild gentoo kernel-4.9.16 with gcc-5.4.0 by Rich Freeman
1 On Tuesday 30 May 2017 14:11:14 Rich Freeman wrote:
2 > On Tue, May 30, 2017 at 1:50 PM, Mick <michaelkintzios@×××××.com> wrote:
3 > > On Tuesday 30 May 2017 13:08:39 Neil Bothwick wrote:
4 > >> On Tue, 30 May 2017 04:20:17 -0700 (PDT), Mick wrote:
5 > >> > > After gcc-config, make sure you run:
6 > >> > > # env-update
7 > >> > > # source /etc/profile
8 > >> > >
9 > >> > > It looks like something still points to your old compiler.
10 > >> >
11 > >> > Thanks Joost, I've rebooted many times since the move/rebuild of almost
12 > >> > everything with gcc-5.4.0. Actually, now that you mention it ... I
13 > >> > can't recall if I rebuilt the linux-headers. Hmm ... will look into
14 > >> > that next.
15 > >>
16 > >> As you are rebuilding the kernel, it may be that you have parts still
17 > >> built with the old compiler. Try running make clean.
18 > >
19 > > Yes! That fixed my problem. Thank you Neil and Joost. :-)
20 >
21 > This will go a lot slower if you're constantly rebuilding after
22 > tweaking options, but I direct my kernel builds to a tmpfs.
23 >
24 > mkdir /var/tmp/linux
25 > make O=/var/tmp/linux oldconfig
26 > make O=/var/tmp/linux -j#
27 > make O=/var/tmp/linux modules_install
28 > make O=/var/tmp/linux install
29 > emerge @module-rebuild
30 >
31 > This leaves your sources completely untouched - it will just be the
32 > clean git repo (or wherever you get your sources from). Note that if
33 > you want to later build/upgrade any kernel modules you'll need to
34 > create /var/tmp/linux and run:
35 > make O=/var/tmp/linux modules_prepare
36 >
37 > (This is because you don't just have all the needed files lying around
38 > all the time for when portage needs them.)
39 >
40 > Also, you need to make sure your config file is in /boot or that
41 > /proc/config.gz support is enabled, because there won't be a
42 > /usr/src/linux/.config file lying around for when portage does kernel
43 > config checks. It automatically falls back to the running kernel when
44 > this is missing.
45 >
46 > From what I understand this is actually what the linux devs consider
47 > the preferred way to build kernels anyway. Now, the downside is that
48 > if not much has changed make can't re-use anything. The upside is
49 > that you always get a completely clean build, and since all the
50 > objects end up in a tmpfs it builds a lot faster (compared to a clean
51 > build on disk). I switched over to this when my /usr/src moved to
52 > tmpfs to cut down on wear, and also because upstream actually
53 > recommends it.
54 >
55 > But, aside from issues like the one you just ran into you won't really
56 > run into much trouble building the way most people seem to do it.
57
58 Thank you Rich, I don't usually have to tweak much my kernel options, except
59 in new systems/hardware. Nevertheless, this is a clever approach for testing
60 out different configurations. I'll keep this for future reference. Thanks
61 again!
62
63 --
64 Regards,
65 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature