Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Lowest common denominator compile
Date: Tue, 05 Sep 2017 08:37:40
Message-Id: 20170905083727.GA23751@waltdnes.org
In Reply to: [gentoo-user] Lowest common denominator compile by Grant
1 On Mon, Sep 04, 2017 at 12:39:02PM -0700, Grant wrote
2 >
3 > Now I'm running into "trap invalid opcode" errors on the older
4 > systems. Can I disable some of the newer CPU instruction sets on the
5 > master laptop when compiling to hopefully generate binaries that will
6 > work on the older systems?
7
8 Yes. You need to find out CPU_FLAGS_X86 and "-march=" values the
9 machines have, and use that in make.conf. Run the commands...
10
11 cpuinfo2cpuflags-x86
12 gcc -c -Q -march=native --help=target | grep march=
13
14 ...on the target machines. This will tell you what "native" is and
15 what CPU_FLAGS_X86 values to use.
16
17 https://gcc.gnu.org/onlinedocs/gcc-6.3.0/gcc/x86-Options.html#x86-Options
18 lists available "march=" options, and what instruction sets they support.
19 E.g. my old core2 desktop shows...
20
21 [d531][waltdnes][~] cpuinfo2cpuflags-x86
22 CPU_FLAGS_X86="mmx mmxext sse sse2 sse3 ssse3"
23
24 [d531][waltdnes][~] gcc -c -Q -march=native --help=target | grep march=
25 -march= core2
26
27
28 Unless the laptops are really old, you can probably get away with...
29 CFLAGS="-O2 march=core2 -mfpmath=sse -fopenmp -fomit-frame-pointer -pipe -fno-unwind-tables -fno-asynchronous-unwind-tables"
30
31 booby trap 1) Unless all machines are Intel "Atom" family, do *NOT* use
32 a "march=" that implements the "movbe" instruction.
33
34 booby trap 2) If you throw in any AMD-based machines proceed with care.
35
36 Can you post the output of...
37 gcc -c -Q -march=native --help=target | grep march=
38 ...for all the target machines?
39
40 --
41 Walter Dnes <waltdnes@××××××××.org>
42 I don't run "desktop environments"; I run useful applications

Replies

Subject Author
Re: [gentoo-user] Lowest common denominator compile Grant <emailgrant@×××××.com>