lkml.org 
[lkml]   [2020]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: GCC section alignment, and GCC-4.9 being a weird one
On Wed, Oct 21, 2020 at 10:42:01AM -0700, Nick Desaulniers wrote:
> On Wed, Oct 21, 2020 at 6:45 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > Ah, thanks!
> >
> > In that case something like the below ought to make it good.
> >
> > I'll go feed it to the robots, see if anything falls over.
> >
> > ---
> > kernel/sched/deadline.c | 4 +++-
> > kernel/sched/fair.c | 4 +++-
> > kernel/sched/idle.c | 4 +++-
> > kernel/sched/rt.c | 4 +++-
> > kernel/sched/sched.h | 3 +--
> > kernel/sched/stop_task.c | 3 ++-
> > 6 files changed, 15 insertions(+), 7 deletions(-)
> >
> > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> > index 6d93f4518734..f4855203143d 100644
> > --- a/kernel/sched/deadline.c
> > +++ b/kernel/sched/deadline.c
> > @@ -2504,7 +2504,9 @@ static void prio_changed_dl(struct rq *rq, struct task_struct *p,
> > }
> >
> > const struct sched_class dl_sched_class
> > - __attribute__((section("__dl_sched_class"))) = {
> > + __attribute__((section("__dl_sched_class")))
> > + __attribute__((aligned(__alignof__(struct sched_class)))) = {
>
> If you used some of the macros from
> include/linux/compiler_attributes.h like __section and __aligned, I
> would prefer it. Please consider spelling out __attribute__(()) an
> antipattern.

Feh, and then suffer more patches because someone doesn't like how
__section uses # :/

\
 
 \ /
  Last update: 2020-10-22 09:39    [W:0.062 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site