Re: Fw: binary size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Compilation flag are similar/same except some more error/warn ignore flags for c++20.
________________________________
From: Ming Cheng <chengm349@xxxxxxxxxxx>
Sent: Tuesday, January 4, 2022 11:42 AM
To: Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
Cc: gcc-help <gcc-help@xxxxxxxxxxx>
Subject: Re: Fw: binary size

Hi Jonathan,
I just pasted a lib. It's applicable to binary. I am wondering whether there is a way to generate smaller binary by ver 10.2.1 close to 7.3.1? Would bigger size binary slower ?

regard
Ming

________________________________
From: Jonathan Wakely <jwakely.gcc@xxxxxxxxx>
Sent: Tuesday, January 4, 2022 7:53 AM
To: Ming Cheng <chengm349@xxxxxxxxxxx>
Cc: gcc-help <gcc-help@xxxxxxxxxxx>
Subject: Re: Fw: binary size



On Tue, 4 Jan 2022, 02:13 Ming Cheng via Gcc-help, <gcc-help@xxxxxxxxxxx<mailto:gcc-help@xxxxxxxxxxx>> wrote:


________________________________
From: Ming Cheng <Ming.Cheng@xxxxxxxxxxxxx<mailto:Ming.Cheng@xxxxxxxxxxxxx>>
Sent: Tuesday, January 4, 2022 2:10 AM
To: Ming Cheng <chengm349@xxxxxxxxxxx<mailto:chengm349@xxxxxxxxxxx>>
Subject: binary size


Hi,



If I use

g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)

Copyright (C) 2017 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



-rw-r--r-- 1 mcheng flexusr 4632980 Jan  4 09:54 libfilelog.a



If I use

g++ (GCC) 10.2.1 20210130 (Red Hat 10.2.1-11)

Copyright (C) 2020 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.



-rw-r--r-- 1 mcheng flexusr 7008006 Jan  4 10:08 libfilelog.a



How to reduce binary size generated by C++20 compiler?


You're just looking at the file size, and it's not a binary. The difference is probably due to additional debug info produced by the new GCC. Other things can affect it too, like optimization settings.

Why do you want to reduce it? What is your real goal?




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux