Deutsch   English   Français   Italiano  
<vi03n5$2c7jl$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder9.news.weretis.net!news.quux.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Bart <bc@freeuk.com>
Newsgroups: comp.lang.c
Subject: Re: else ladders practice
Date: Sun, 24 Nov 2024 20:52:54 +0000
Organization: A noiseless patient Spider
Lines: 74
Message-ID: <vi03n5$2c7jl$1@dont-email.me>
References: <3deb64c5b0ee344acd9fbaea1002baf7302c1e8f@i2pn2.org>
 <vhgr1v$2ovnd$1@paganini.bofh.team> <vhic66$1thk0$1@dont-email.me>
 <vhins8$1vuvp$1@dont-email.me> <vhj7nc$2svjh$1@paganini.bofh.team>
 <vhje8l$2412p$1@dont-email.me> <WGl%O.42744$LlWc.33050@fx42.iad>
 <vhkr9e$4bje$1@dont-email.me> <vhptmn$3mlgf$1@paganini.bofh.team>
 <vhq6b4$17hkq$1@dont-email.me> <vhqm3l$3ntp7$1@paganini.bofh.team>
 <vhso61$1o2of$1@dont-email.me> <vhtrns$71ic$1@paganini.bofh.team>
 <vhtvvc$1ukc7$1@dont-email.me> <vhuc2j$7s5i$1@paganini.bofh.team>
 <vhv5m4$27sco$1@dont-email.me> <87wmgsmme0.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Sun, 24 Nov 2024 21:52:54 +0100 (CET)
Injection-Info: dont-email.me; posting-host="ce2114238f6dc927920bdb19bad491fa";
	logging-data="2498165"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19iMmIY/XIt5XJG3mq6v+h3"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:/aXI6HwebfuIL2BVKazSc28pnwE=
In-Reply-To: <87wmgsmme0.fsf@nosuchdomain.example.com>
Content-Language: en-GB
Bytes: 4413

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.