[klibc] [PATCH] kbuild: add -ffreestanding to required flags

Bill Wendling morbo at google.com
Wed Jun 6 11:50:42 PDT 2018


They way to indicate to clang that those calls shouldn't be lowered to
their unlocked versions is to mark it as freestanding. Freestanding simply
means that the standard C library can't be assumed to be available,
which in this case it's not because you're creating the C library. So
I'm not sure what other solution you wish to see here (apart from
implementing the unlocked versions in klibc, which I don't think you
want).

Could you explain why this is wrong for GCC?

-bw

On Wed, Jun 6, 2018 at 4:35 AM Thorsten Glaser <tg at mirbsd.de> wrote:

> Bill Wendling dixit:
>
> >New clang versions need the '-ffreestanding' flag because new changes
> >convert system calls to their unlocked versions, which don't exist in
> >the kernel library.
>
> This is probably wrong, a libc is not, in contrast to a bootloader
> or kernel, a freestanding environment.
>
> For the case of GCC, -ffreestanding is definitely wrong.
>
> Please look for another solution, e.g. teach clang that klibc
> does not have those unlocked calls. (AIUI klibc only supports
> GCC officially anyway…)
>
> bye,
> //mirabilos
> --
> “It is inappropriate to require that a time represented as
>  seconds since the Epoch precisely represent the number of
>  seconds between the referenced time and the Epoch.”
>         -- IEEE Std 1003.1b-1993 (POSIX) Section B.2.2.2
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.zytor.com/pipermail/klibc/attachments/20180606/c6771461/attachment.html>


More information about the klibc mailing list