On 2019-05-12 05:24 +0100, Ken Moffat via lfs-dev wrote: > As people probably know, I usually set my own CFLAGS when building > LFS (at a minimum, -O2 to get rid of most debug symbols).
Me too. > But I'm now trying to compare the build times and the size of the > executables for "I did it my way" against using the default CFLAGS > from the individual packages (or from BLFS, or using releease builds > for cmake and meson). > > Got through chapter 5 ok, time was not a lot greater but the space > used by /tools was a lot bigger (2.4 GB instead of 851MB). But in > chapter 6 glibc was not happy: > > # error "glibc cannot be compiled without optimization" > > Looking on google, and trying to follow a link to the FAQ > specifically for this (apparently failed, but left me at hte FAQ) > all I can find is the old advice from Seth: if you use CFLAGS and > the build fails, people will suggest you try without those CFLAGS. > > Fine, and I remember suggestions to use -O3 for glibc from Greg > Schafer. So, I've added CFLAGS='-O2' for glibc if my own CFLAGS are > not set (and I had a similar fix which became ineffective when I > reworked how I set/pass my CFLAGS, at that time it was labelled as > being needed for at least x86_32). > > But unless I'm looking in the wrong place, I can't see any CFLAGS in > the book ? So, how do you all build glibc in chroot ? In autotools configure script, if CFLAGS is not set, the script defaults to use "-O2 -g" or something the package author set. However, if it is set (for some packages, *even if set to nothing*, i. e. CFLAGS=""), the script will throw away the default and use your setting. That's different from cmake or meson. Beside the stupid libtool, I also dislike this "feature" of autotools. -- Xi Ruoyao <xry...@mengyan1223.wang> School of Aerospace Science and Technology, Xidian University -- http://lists.linuxfromscratch.org/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page