Subject: Re: `-ffreestanding'
To: Todd Vierling <tv@wasabisystems.com>
From: Richard Earnshaw <rearnsha@buzzard.freeserve.co.uk>
List: tech-kern
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=
rary
> : calls can be safely #defined into their builtin equivalents and that =
they
> : will safely fall back. Not that we probably need to support the floa=
ting
> : point ones.
> =
> However, gcc should autodetect these in the userland case. It's the ke=
rnel
> 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.
R.