On Tue, 4 Jan 2022, 02:13 Ming Cheng via Gcc-help, <gcc-help@xxxxxxxxxxx> wrote: > > > ________________________________ > From: Ming Cheng <Ming.Cheng@xxxxxxxxxxxxx> > Sent: Tuesday, January 4, 2022 2:10 AM > To: Ming Cheng <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?