Re: Build kernels with -ffreestanding?

2016-12-28 Thread Mark Kettenis
> > >> > > > >> The nice thing about this solution is that we can choose explicitly > > > >> which optimizations we want. And as you can see the kernel makefile > > > >> gets simpler ;). > > > >> > > > >> Of cour

Re: Build kernels with -ffreestanding?

2016-12-28 Thread Mark Kettenis
oper bounds checking on > > >> __builtin_memcpy(), so we don't lose that. > > >> > > >> The nice thing about this solution is that we can choose explicitly > > >> which optimizations we want. And as you can see the kernel makefile > &g

Re: Build kernels with -ffreestanding?

2016-12-28 Thread Reyk Floeter
>>>> __builtin_memcpy(), so we don't lose that. >>>> >>>> The nice thing about this solution is that we can choose explicitly >>>> which optimizations we want. And as you can see the kernel makefile >>>> gets simpler ;). >>>>

Re: Build kernels with -ffreestanding?

2016-12-27 Thread Martin Pieuchot
itly > >> which optimizations we want. And as you can see the kernel makefile > >> gets simpler ;). > >> > >> Of course the real reason why I'm looking into this is that clang > >> makes it really hard to build kernels without -ffreestanding. > >&g

Re: Build kernels with -ffreestanding?

2016-12-27 Thread Jeremie Courreges-Anglas
per bounds checking on >> __builtin_memcpy(), so we don't lose that. >> >> The nice thing about this solution is that we can choose explicitly >> which optimizations we want. And as you can see the kernel makefile >> gets simpler ;). >> >> Of

Re: Build kernels with -ffreestanding?

2016-12-24 Thread Joerg Sonnenberger
On Sat, Dec 24, 2016 at 12:08:35AM +0100, Mark Kettenis wrote: > We can get those optimizations back by doing: > > #define memcpy(d, s, n) __builtin_memcpy((d), (s), (n)) You might still want to put a prototype in, just before the define. Joerg

Re: Build kernels with -ffreestanding?

2016-12-24 Thread Mark Kettenis
e nice thing about this solution is that we can choose explicitly > > > which optimizations we want. And as you can see the kernel makefile > > > gets simpler ;). > > > > > > Of course the real reason why I'm looking into this is that clang > > > makes

Re: Build kernels with -ffreestanding?

2016-12-24 Thread Jonathan Gray
t gcc still does proper bounds checking on > > __builtin_memcpy(), so we don't lose that. > > > > The nice thing about this solution is that we can choose explicitly > > which optimizations we want. And as you can see the kernel makefile > > gets simpler ;). > >

Re: Build kernels with -ffreestanding?

2016-12-24 Thread Mark Kettenis
bout this solution is that we can choose explicitly > which optimizations we want. And as you can see the kernel makefile > gets simpler ;). > > Of course the real reason why I'm looking into this is that clang > makes it really hard to build kernels without -ffreestanding. > >

Build kernels with -ffreestanding?

2016-12-23 Thread Mark Kettenis
looking into this is that clang makes it really hard to build kernels without -ffreestanding. The diff below implements this strategy, and enabled the optimizations for memcpy() and memset(). We can add others if we think there is a benefit. I've tested the diff on amd64. We may need to put an #undef