Liste des Groupes | Revenir à cl c |
On Sun, 9 Jun 2024 11:20:11 +0100
bart <bc@freeuk.com> wrote:
It's gcc/TDM. Anything else, I can spend 10 minutes following links to a mingw download, only to end up back where I started from. gcc/TDM is a much simpler installation.No, I meant -Oz.GCC on Windows or on Linux?>
In my experience, gcc on Windows (ucrt64 variant, other gcc variants
are worse) very consistently produces bigger (stripped) exe than
even latest MSVCs which, as you correctly stated, are not as good
as older versions at producing small code.
>
The size of 'Hello, world' program (x86-64, dynamically linked C
RTL) vs2013 - 6,144 bytes
vs2019 - 9,216 bytes
gcc (Debian Linux, -no-pie) - 14,400 bytes
gcc (Debian Linux) - 14,472 bytes
gcc (ucrt64 DLL) - 18,432 bytes
gcc (old DLL) - 42,496 bytes
I get a lot worse than that:
>
C:\c>gcc hello.c
>
C:\c>dir a.exe
09/06/2024 11:04 367,349 a.exe
>
C:\c>gcc hello.c -s -Os
>
C:\c>dir a.exe
09/06/2024 11:04 88,064 a.exe
>
(It didn't like -Oz; did you mean something other than -Os?)
>
It was invented by clang, but newer gcc understand it.
I don't know what is a difference exactly, but -Oz tends to be a little
smaller.
In program as trivial as this, there should be no difference.
Both import msvcrt.dll. gcc is version 10.3.0.My gcc variants are from msys2.
>
Where did you get yours?
All were for x64.tcc gives 2KB, and mcc gives 2.5KB.x86-64 or i386?
>
Les messages affichés proviennent d'usenet.