Re:GCC 8 Link Time and Interprocedural Optimization
by ebikelaw on Monday June 18, 2018 @08:06PM
(#17342693)
If your build system is reproducible there is no reason this would not work.
[ Parent
| on HN ]
Re:GCC 8 Link Time and Interprocedural Optimization
by jlarocco on Monday June 18, 2018 @09:19PM
(#17343048)
Maybe that's the case now, with GCC 8, but historically that hasn't been true.
In the past the effects of using both -g and -O* flags could interact each other because they can both affect how registers are allocated, how call stacks are setup, how functions are inlined, etc. In other words, adding -g by itself made the build non-reproducible.
If that's no longer true in GCC 8 it's great news.
Re:GCC 8 Link Time and Interprocedural Optimization
by readittwice on Tuesday June 19, 2018 @01:38AM
(#17344079)
AFAIR GCC bootstrap builds by default with "-g -O2". There are 3 stages: 1) use system compiler to compile GCC's source code, 2) use resulting binary to build same source, 3) use binary from 2) to build source one more time. After all stages the binaries from stage 2 and 3 are compared byte for byte if they are identical.
Bootstrap failures are taken very seriously by the GCC developers. So I really doubt that -g and -O* lead to non-deterministic builds.
Re:GCC 8 Link Time and Interprocedural Optimization
by glandium on Monday June 18, 2018 @10:17PM
(#17343310)
> In other words, adding -g by itself made the build non-reproducible.
In my experience, this is largely not true. However, what is plausible is that before GCC 8, LTO, which, for speed reasons, can split work across multiple threads, was not deterministic, and GCC 8 might have made that better.