Re: [pre-2.3.51-2] memset problem on IA32

From: Horst von Brand (vonbrand@pincoya.inf.utfsm.cl)
Date: Mon Mar 13 2000 - 15:31:58 EST


Philipp Thomas <pthomas@suse.de> said:

[...]

> Well, there is a possible solution at the horizon for a freestanding
> environment such as the kernel, -ffreestanding. Currently this just
> implies -fno-builtin, i.e. disables builtins that don't begin with
> __builtin_. But at the moment does not effect the libcalls the block
> mover generates. It would be relatively easy to change gcc to also
> inhibit those, resulting in an abort on such structure copies by
> assignment.

Why not abort when adding two ints then? Just as much a part of C then
assigning structures...

> My reasoning would be to use -ffreestanding, as we don't have a standard
> C library around and baning all 'struct_a = struct_b' from kernel code,
> mandating either the use of struct_cpy() (which would have to be added to
> all arcs other than i386) or the direct use of memcpy(), which would then
> be inlined via the linux/string.h macro versions.

Adding a memcpy() in a library for the kernel's use is much less intrusive.
OTOH, I don't know what a freestanding compiler is allowed to assume in
terms of availability of libc functions. There are two parties to be fixed:
The kernel must provide a freestanding environment (whatever that means)
and the compiler has to abide by it.

-- 
Dr. Horst H. von Brand                       mailto:vonbrand@inf.utfsm.cl
Departamento de Informatica                     Fono: +56 32 654431
Universidad Tecnica Federico Santa Maria              +56 32 654239
Casilla 110-V, Valparaiso, Chile                Fax:  +56 32 797513

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Mar 15 2000 - 21:00:29 EST