Sujet : Re: else ladders practice
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 24. Nov 2024, 21:52:54
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vi03n5$2c7jl$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
User-Agent : Mozilla Thunderbird
On 24/11/2024 20:01, Keith Thompson wrote:
Bart <bc@freeuk.com> writes:
[...]
Most of a gcc installation is hundreds of header and archive (.a)
files for various libraries. There might be 32-bit and 64-bit
versions. I understand that. But it also makes it hard to isolate the
core compiler.
[...]
That doesn't agree with my observations.
Of course most of the headers and libraries are not part of gcc itself.
As usual, you refer to the entire implementation as "gcc".
I've built gcc 14.2.0 and glibc 2.40 from source on Ubuntu 22.04.5,
installing each into a new directory.
The gcc installation is about 5.6 GB, reduced to about 1.9 GB if I strip
the executables.
That's even huger than mine! So, that are those 3.7GB full of? What does the 1.9GB of executables do?
The glibc installation (libraries and headers) is about 199 MB, a small
fraction of the size of the gcc intallation.
Is that included in one of those two divisions above?
Of course there are other libraries that can be used with gcc, and they
could take a lot of space -- but they're not part of gcc.
So, what /is/ gcc? What's the minimum installation that can compile hello.c to hello.s for example?
I've done that experiment on my TDM version, and the answer appears to be about 40MB in this directory structure:
Directory of c:\tdm\bin
24/07/2024 10:21 1,926,670 gcc.exe
24/07/2024 10:21 2,279,503 libisl-23.dll
24/07/2024 10:22 164,512 libmpc-3.dll
24/07/2024 10:22 702,852 libmpfr-6.dll
Directory of c:\tdm\libexec\gcc\x86_64-w64-mingw32\14.1.0
24/07/2024 10:24 34,224,654 cc1.exe
Directory of c:\tdm\x86_64-w64-mingw32\include
17/01/2021 17:33 368 stddef.h
27/03/2021 20:07 2,924 stdio.h
7 File(s) 39,301,483 bytes
Here I cheated a little and used the minimum std headers from my compiler, otherwise I could have spent an hour chasing down dozens of obscure nested headers that gcc's stdio.h likes to make use of.
Is /this/ gcc then? Will you agree that it is by no means clear what 'gcc' includes, or what to call the part of a gcc installed bundle that is not technically gcc?
A more useful installation would of course need more standard headers, an assembler, linker, and whatever .a files are needed to provide the standard library.
With clang, it is easier: apparently everything needed to do the above, other than header files, is contained with a 120MB executable clang.exe.
However the full 2.8GB llvm/clang installation doesn't provide any headers, nor a linker. At least it doesn't use the provided 88MB (!) lld.exe; it expects to work on top of MSVC, which it has never managed to do.