Gentoo Archives: gentoo-user

From: Rich Freeman <rich0@g.o>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] duplicate gentoo system - errors
Date: Mon, 23 Nov 2020 14:23:28
Message-Id: CAGfcS_m1jDAUfrFfM6V5UsrTmSGLjY-YmLWjjA5JD59=SxPWTw@mail.gmail.com
In Reply to: Re: [gentoo-user] duplicate gentoo system - errors by Walter Dnes
1 On Mon, Nov 23, 2020 at 9:10 AM Walter Dnes <waltdnes@××××××××.org> wrote:
2 >
3 >
4 > Ouch! Are the CPUs exactly identical? If not, then you may get the
5 > "Illegal instruction" error. This is a "feature" of Gentoo, which is
6 > often user-optimized for a specific CPU.
7
8 This "feature" has nothing to do with Gentoo, but just with the fact
9 that users can set their CFLAGS to whatever you wish. If you set a
10 conservative -march and then set a more aggressive -mtune then your
11 binaries will run anywhere. That is how most distros do it.
12
13 The default CFLAGS in make.conf are "-O2 -pipe". If you stick to
14 those defaults your binaries will run anywhere.
15
16 There is nothing wrong with using -march, but you definitely need to
17 keep in mind that if you ever change CPUs then you're going to need to
18 rebuild everything.
19
20 You could just rebuild @system with generic CFLAGS and then rebuild
21 everything with -march=native or whatever you prefer once your new
22 system is running. Your applications wouldn't run that way, but you
23 could still boot the OS and the toolchain will work. If gcc is broken
24 then you can't rebuild in place.
25
26 --
27 Rich