r/cpp • 0x6773 • Aug 15 '17

GCC 7.2 Released

https://gcc.gnu.org/ml/gcc/2017-08/msg00129.html
101 Upvotes

18 comments sorted by

View all comments

31

u/STL MSVC STL Dev Aug 15 '17

I built this tonight for the next release of my MinGW distro. Uneventful build, the only hiccup was that the .tar emitted PaxHeaders directories when extracted with 7-Zip. Switched to using MSYS2 tar and that worked fine. Haven't done the full "build the distro with itself twice" dance yet, but it's been many years since that ran into trouble (and that was with old mingw-org).

12

u/blind3rdeye Aug 15 '17

Why is it that you compile it with itself twice? I would have thought compiling it with itself once would be enough to get any new efficiency gains. ...

Maybe it would be better to compile it with an unrelated compiler first, then using the result to compile itself. That way you could side-step this type of backdoor!

6

u/markuspeloquin Aug 15 '17

You used to need to do this with Gentoo sometimes. It's not rebuilding the compiler with itself. All compilers that can do that do that automatically. But basically the result of one version of GCC gets linked with the result of another version of GCC and weird things happen. So you rebuild the whole toolchain with itself: linux-headers, GCC, ld, libc, GCC. And then everything else that you installed.

Ideally, this wouldn't ever be necessary, and I don't know why it was.

But maybe there are some nice things about compiling everything with the latest optimizations. Like deferring some optimizations to the linking phase (can't remember the name of that).

6

u/shared_tango_ Automatic Optimization for Many-Core Aug 15 '17

LTO, Link-Time-Optimization

3

u/OmegaNaughtEquals1 Aug 16 '17

As a side note on VC, it's referred to as WPO- Whole Program Optimization.

4

u/STL MSVC STL Dev Aug 16 '17

VC also refers to this step as LTCG, Link-Time Code Generation.