Subject: Re: `-ffreestanding'
To: Todd Vierling <>
From: Richard Earnshaw <>
List: tech-toolchain
Date: 07/19/2001 00:11:16
> On Mon, 16 Jul 2001, Richard Earnshaw wrote:
> =

> : >From a quick perusal of the source, I believe that the following lib=
> : calls can be safely #defined into their builtin equivalents and that =
> : will safely fall back.  Not that we probably need to support the floa=
> : point ones.
> =

> However, gcc should autodetect these in the userland case.  It's the ke=
> case that involves -ffreestanding and #define'ing (which won't need FP
> functions, or several of the str* functions).

We weren't talking about userland.  In userland we don't need =

-ffreestanding, so the builtins will be enabled by default.  In the =

kernel, if -ffreestanding is defined, builtins are disabled, so we were =

looking at #defining *some* standard library functions to their =

__builtin_* equivalent and whether they would then safely fall back to th=
e =

non-builtin library call if the compiler was unable to inline the functio=
n =

directly.  The functions I listed all fall into that category; I'm not =

saying that the kernel calls all of them, I'm just saying that we could =

use the __builtin_* define if necessary.