Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jun 2002 14:00:36 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Terry Lambert <tlambert2@mindspring.com>
Cc:        Maxime Henrion <mux@FreeBSD.ORG>, <current@FreeBSD.ORG>
Subject:   Re: duplicate -ffreestanding in kernel build
Message-ID:  <20020616134100.M1933-100000@gamplex.bde.org>
In-Reply-To: <3D0B9B9C.DB27DD33@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 15 Jun 2002, Terry Lambert wrote:

> Maxime Henrion wrote:
> > Terry Lambert wrote:
> > > What exactly does this do, besides implying "-fno-builtin"?
> > >
> > > The documentation says "and implies main has no special requirements"...
> > >
> > > Neither the kernel nor modules have a "main", so the only thing that's
> > > relevent here is the "-fno-builtin", right?
> >
> > IIRC, -ffreestanding prevented GCC3 from being stupid optimizations like
                                                   ^^^^^^ smart
> > changing occurences of printf("constant string\n") to puts("constant
> > string"), which failed for kernel builds since we don't have puts() in
> > the kernel...
>
> That is an incredibly *fugly* "optimization".  It assumes that I
> use libc, unless I have "-ffreestanding", and it assumes my
> implementation of printf vs. puts.

This is a routine optimization.  It assumes that you use a C compiler
(printf and even libc might not exist, since they might be builtins).
A non-routine optimization might involve building hardware to run the
application and emitting the 1 bit instruction to turn the hardware on.

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020616134100.M1933-100000>