Re: Linux 4.9.180 build fails with gcc 9 and 'cleanup_module' specifies less restrictive attribute than its target …

Greg KH
2019-08-02T11:25:48Z

On Fri, Aug 02, 2019 at 01:00:30PM +0200, Miguel Ojeda wrote:
> On Fri, Aug 2, 2019 at 12:33 PM Greg KH <greg@kroah.com> wrote:
> >
> > On Fri, Aug 02, 2019 at 12:19:33PM +0200, Miguel Ojeda wrote:
> > > On Fri, Aug 2, 2019 at 10:17 AM Rolf Eike Beer <eb@emlix.com> wrote:
> > > >
> > > > Am Samstag, 8. Juni 2019, 14:00:34 CEST schrieb Miguel Ojeda:
> > > > > On Thu, Jun 6, 2019 at 8:59 PM Greg KH <greg@kroah.com> wrote:
> > > > > > "manually fixing it up" means "hacked it to pieces" to me, I have no
> > > > > > idea what the end result really was :)
> > > > > >
> > > > > > If someone wants to send me some patches I can actually apply, that
> > > > > > would be best...
> > > > >
> > > > > I will give it a go whenever I get some free time :)
> > > >
> > > > I fear this has never happened, did it?
> > >
> > > No. Between summer, holidays and a conference I didn't get to do it.
> > >
> > > Done the minimal approach here:
> > >
> > > https://github.com/ojeda/linux/commits/compiler-attributes-backport
> > >
> > > Tested building a handful of drivers with gcc 4.6.4, 8.3.0 and 9.1.1.
> > >
> > > Greg, I could backport the entire compiler_attributes.h, but given
> > > this is stable, we are supposed to minimize changes, right?
> > >
> > > I tried to imitate what you do in other stable patches, please check
> > > the Cc:, Link: lines and the "commit ... upstream" just in case.
> >
> > If only those 2 patches are all that is needed, nice! I'll gladly take
> > them, can you send them to me (and cc: the stable list) in email so I
> > can queue them up for the next round of releases after this one?
>
> At least for that particular problem, yeah -- I haven't done a full allmod.
>
> By the way, I just checked 4.14.y and I noticed you had already
> backported it, although going for another solution:
>
> +#if GCC_VERSION >= 90100
> +#define __copy(symbol) __attribute__((__copy__(symbol)))
> +#endif
>
> and then:
>
> +#ifndef __copy
> +# define __copy(symbol)
> +#endif

But it still doesn't work for 4.14.y and 4.19.y, so we are probably
missing something there. So if you want to fix that up, I'd appreciate
patches to do so :)

thanks,

greg k-h