gcc-6

Jean-François Caron jfcaron at phas.ubc.ca
Wed May 18 12:12:34 PDT 2016


I have an unfounded opinion about this:

> Naturally a hypothetical gcc6 port that only provides a Fortran compiler would take less space and less time to build than one that also provides C, C++, and Java compilers.


I’m not an expert on this at all, but from what I understand the only language-dependent part of the compiler is the front-end.  This bit takes your input language (C++, Fortran, whatevs) and turns it into some internal representation.  Much of the heavy work of optimization, analysis, and code-generation happens on the internal representation, which is independent of the source language.

Thus splitting gcc into separate ports for different languages would end up duplicating most of the actual machinery in gcc.  Conversely, removing specific languages from gcc wouldn’t reduce the size by that much.

Has anyone tried building gcc with just one or a few languages supported, and see the difference in size (or self-compilation time)?  Does it really make a difference?  I’d expect maybe a 20-30% size reduction if you left only C++ compared to including all the supported languages.

JF


More information about the macports-users mailing list