1 |
On Tue, Apr 24, 2018 at 09:40:52AM +0100, Peter Humphrey wrote |
2 |
> |
3 |
> Anyway, this all leaves unanswered the question whether getting the |
4 |
> -march setting right in a chroot matters to the operation of the |
5 |
> chroot itself, as distinct from building good code for the target |
6 |
> machine. Personally, I can't see how it can have any such effect. |
7 |
|
8 |
"-march" obviously has to match the target machine that the compiled |
9 |
code will run on. You have to run the query... |
10 |
|
11 |
gcc -c -Q -march=native --help=target | grep march= |
12 |
|
13 |
...on the "target machine" to get the necessary value. That's true, |
14 |
regardless of whether the "target machine" is physical hardware, or a |
15 |
chroot, or a VM like QEMU/VMWare/etc. Things can get ugly in some edge |
16 |
cases if the final code (-march=<target_machine>) cannot run in the |
17 |
build environment (-march=<build_machine>). |
18 |
|
19 |
1) Tests run at the end of the build, on the build machine, will obviously |
20 |
fail. |
21 |
|
22 |
2) Pale Moon (and I assume Firefox as well) use the compiled code at the |
23 |
end of the build process to generate a precompiled startup cache. I ran |
24 |
into this when I was manually building Pale Moon, targetted for my Atom |
25 |
netbook, using my Core2 desktop as the build machine. The "bonnell" cpu |
26 |
(ancient 32-bit-only Atom variant) has an instruction set called "MOVBE" |
27 |
that the Core 2 does not. Hence, the bonnell-targeted code would fail |
28 |
on the Core2 with "illegal instruction" and other weird errors. This |
29 |
will also happen building for an AMD (with "3DNOW!" instructions) on an |
30 |
intel CPU. That's "solved" by adding... |
31 |
|
32 |
ac_add_options --disable-precompiled-startupcache |
33 |
|
34 |
...to the mozconfig, preventing execution of that code in the build |
35 |
environment. The side effect is that the first time a profile is opened |
36 |
after an install or upgrade on an end-user machine, it takes somewhat |
37 |
longer, because it has execute the compiled code on the end-user machine |
38 |
to generate the cache. |
39 |
|
40 |
-- |
41 |
Walter Dnes <waltdnes@××××××××.org> |
42 |
I don't run "desktop environments"; I run useful applications |