On Sun, May 12, 2019 at 10:24:19AM +0200, Pierre Labastie via lfs-dev wrote:
> On 12/05/2019 06:24, Ken Moffat via lfs-dev wrote:
> > 
> > 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"
> > 
> 
> jhalfs default, which I use, and I guess others too, is to have CFLAGS unset.

Thanks.  That was what I had expected,

> Note the defaults CFLAGS for glibc come frome Makeconfig:
> ----------------------------
> override CFLAGS = -std=gnu11 -fgnu89-inline $(config-extra-cflags) \
>                $(filter-out %frame-pointer,$(+cflags)) $(+gccwarn-c) \
>                $(+extra-math-flags) \
>                $(sysdep-CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(<F)) \
>                $(CFLAGS-$(@F)) $(tls-model) \
>                $(foreach lib,$(libof-$(basename $(@F))) \
>                              $(libof-$(<F)) $(libof-$(@F)),$(CFLAGS-$(lib)))
> --------------------------
> and "+cflags" contains either what has been passed as CFLAGS, or "-g -O2".
> 
> The #error you are seeing comes from file include/libc-symbols.h. It flags the
> error if __OPTIMIZE__ is not defined when compiling. From gcc doc,
> __OPTIMIZE__ is defined to 1 whenever optimization is enabled (even -Os).
> 
> From my glibc logs, almost all the calls to gcc have "-g -O2" in their command
> line. Ah, and they have also "-include ../include/libc-symbols.h".
> 
> So, IIUC, if you pass a CFLAGS without -Osomething (explicit or implied), the
> error is triggered. BTW, I've been pulling my hair several times in my life
> for using -02 (zero two), instead of -O2 (letter O two)...
> 
> Pierre

My intention in this build is to not set CFLAGS, so I had assumed it
would not pass anything.  Perhaps something in my scripts is passing
CFLAGS="" by accident (my functions now include a maze of twisty
passages to set variations of the options.  Ah, yes, I think I know
where I'm maybe passing CFLAGS=" ".  I've currently gone past glibc,
will maybe let it be (depending on other issues).

But this build is only to see how much longer / bigger a full build
(my normal desktop) would be without ptimizations.  When I've
managed to complete it I'll go back to the tuning.

ĸen
-- 
Before the universe began, there was a sound. It went: "One, two, ONE,
two, three, four" [...] The cataclysmic power chord that followed was
the creation of time and space and matter and it does Not Fade Away.
 - wiki.lspace.org/mediawiki/Music_With_Rocks_In


-- 
http://lists.linuxfromscratch.org/listinfo/lfs-dev
FAQ: http://www.linuxfromscratch.org/faq/
Unsubscribe: See the above information page

Reply via email to