lvqcl wrote:> I just built FLAC and noticed that the size of flac.exe is noticeably bigger, > so I compared the generated Makefiles before ang after this change. > > The difference is: "-g -O2" options were added to CFLAGS. > > before: > CFLAGS = -O3 -funroll-loops -Wall -W -Winline -Wall -Wextra -Wstrict-prototypes > -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow > -Wundef -Wmissing-declarations -Wunreachable-code -Wdeclaration-after-statement > -D_FORTIFY_SOURCE=2 -msse2 -Wextra > > after: > CFLAGS = -O3 -funroll-loops -Wall -W -Winline -g -O2 -Wall -Wextra > -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align > -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code > -Wdeclaration-after-statement -D_FORTIFY_SOURCE=2 -msse2 -WextraWell -g asks the compiler to add debug symbols. What hapens if you strip the binary? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Erik de Castro Lopo wrote:>> I just built FLAC and noticed that the size of flac.exe is noticeably bigger, >> so I compared the generated Makefiles before ang after this change. >> >> The difference is: "-g -O2" options were added to CFLAGS. >> >> before: >> CFLAGS = -O3 -funroll-loops -Wall -W -Winline -Wall -Wextra -Wstrict-prototypes >> -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow >> -Wundef -Wmissing-declarations -Wunreachable-code -Wdeclaration-after-statement >> -D_FORTIFY_SOURCE=2 -msse2 -Wextra >> >> after: >> CFLAGS = -O3 -funroll-loops -Wall -W -Winline -g -O2 -Wall -Wextra >> -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align >> -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Wunreachable-code >> -Wdeclaration-after-statement -D_FORTIFY_SOURCE=2 -msse2 -Wextra > > Well -g asks the compiler to add debug symbols. What hapens if you strip > the binary?After stripping: the binary is smaller than previously (520kB vs 652kB). Probably that's because the compiler now uses -O2: according to <https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Optimize-Options.html> "If you use multiple -O options, with or without level numbers, the last such option is the one that is effective" which means that GCC doesn't try to use SIMD to vectorize the code, etc.
lvqcl wrote:> After stripping: the binary is smaller than previously (520kB vs 652kB). > > Probably that's because the compiler now uses -O2: according to > <https://gcc.gnu.org/onlinedocs/gcc-4.9.1/gcc/Optimize-Options.html> > "If you use multiple -O options, with or without level numbers, > the last such option is the one that is effective" which means that > GCC doesn't try to use SIMD to vectorize the code, etc.I've just push a fix that strips out existing "-O2 -g" before applying the what we want. Please test. Cheers, Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/