linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Linux 4.19 and GCC 9
       [not found]   ` <CABWYdi1zhTTaN-GSgH0DnPfz7p=SRw0wts5QVYYVtfvoiS0qnQ@mail.gmail.com>
@ 2019-05-16 21:20     ` Miguel Ojeda
  2019-05-16 21:24       ` Ivan Babrou
  2019-05-17  2:03       ` Josh Poimboeuf
  0 siblings, 2 replies; 31+ messages in thread
From: Miguel Ojeda @ 2019-05-16 21:20 UTC (permalink / raw)
  To: Ivan Babrou, Josh Poimboeuf, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Greg KH
  Cc: Linux Kbuild mailing list, kernel-team

Hi,

On Thu, May 16, 2019 at 10:11 PM Ivan Babrou <ivan@cloudflare.com> wrote:
>
> Hey Miguel,
>
> The first error is during perf build process (make -C tools/perf install):
>
> [17:38:21] In file included from /usr/include/string.h:635,
> [17:38:21]                  from ui/tui/helpline.c:4:
> [17:38:21] In function 'strncpy',
> [17:38:21]     inlined from 'tui_helpline__push' at ui/tui/helpline.c:27:2:
> [17:38:21] /usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> '__builtin_strncpy' specified bound 512 equals destination size
> [-Werror=stringop-truncation]
> [17:38:21]   126 |   return __builtin___strncpy_chk (__dest, __src,
> __len, __bos (__dest));
> [17:38:21]       |
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [17:38:21] cc1: all warnings being treated as errors
> [17:38:21] /cfsetup_build/build/linux-4.19.43/tools/build/Makefile.build:96:
> recipe for target '/cfsetup_build/build/amd64/perf/ui/tui/helpline.o'
> failed
> [17:38:21] mv: cannot stat
> '/cfsetup_build/build/amd64/perf/ui/tui/.helpline.o.tmp': No such file
> or directory
> [17:38:21] make[6]: ***
> [/cfsetup_build/build/amd64/perf/ui/tui/helpline.o] Error 1
> [17:38:21] make[5]: *** [tui] Error 2
> [17:38:21] make[4]: *** [ui] Error 2
>
> I see that stringop-truncation is disabled in toplevel Makefile, but
> not sure if perf is using it.

Ah, alright -- CC'ing the perf maintainers then in case they want to chime in.

> If I disable perf build, the next thing is warnings like these:
>
> mm/slub.o: warning: objtool: init_cache_random_seq()+0x36: sibling
> call from callable instruction with modified stack frame
> mm/slub.o: warning: objtool: slab_out_of_memory()+0x3b: sibling call
> from callable instruction with modified stack frame
> mm/slub.o: warning: objtool: slab_pad_check.part.0()+0x7c: sibling
> call from callable instruction with modified stack frame
> mm/slub.o: warning: objtool: check_slab()+0x1c: sibling call from
> callable instruction with modified stack frame

AFAIK those are non-critical, i.e. stack traces may be wrong (or not),
but it does not mean the generated kernel itself is wrong. CC'ing the
objtool maintainers too.

> After patching that I see:
>
> In file included from /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:6:
> /tmp/build/linux-4.19.43/include/linux/module.h:133:6: warning:
> 'init_module' specifies less restrictive attribute than its target
> 'aes_init': 'cold' [-Wmissing-attributes]
>   133 |  int init_module(void) __attribute__((alias(#initfn)));
>       |      ^~~~~~~~~~~
> /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:64:1: note: in
> expansion of macro 'module_init'
>    64 | module_init(aes_init);
>       | ^~~~~~~~~~~
> /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:54:19: note:
> 'init_module' target declared here
>    54 | static int __init aes_init(void)
>       |                   ^~~~~~~~

Ditto here, those can be ignored too (unless something has changed in
GCC that I am not aware of).

> I'm not really comfortable with all the warnings, so I stopped the
> build, maybe it indeed compiles through the end.

It does (on my GCC 9.1.1 compiled from source).

I am not sure what is the policy on backporting (someone from the
stable team can probably answer that; Greg?), but note that this
kernel (and 4.20 and 5.0) was released before GCC 9 did -- and some
(all?) of this was cleaned up before GCC 9 itself released, so we were
ahead of it :-)

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-16 21:20     ` Linux 4.19 and GCC 9 Miguel Ojeda
@ 2019-05-16 21:24       ` Ivan Babrou
  2019-05-17  2:03       ` Josh Poimboeuf
  1 sibling, 0 replies; 31+ messages in thread
From: Ivan Babrou @ 2019-05-16 21:24 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Josh Poimboeuf, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Greg KH, Linux Kbuild mailing list,
	kernel-team

On Thu, May 16, 2019 at 2:21 PM Miguel Ojeda
<miguel.ojeda.sandonis@gmail.com> wrote:
>
> Hi,
>
> On Thu, May 16, 2019 at 10:11 PM Ivan Babrou <ivan@cloudflare.com> wrote:
> >
> > Hey Miguel,
> >
> > The first error is during perf build process (make -C tools/perf install):
> >
> > [17:38:21] In file included from /usr/include/string.h:635,
> > [17:38:21]                  from ui/tui/helpline.c:4:
> > [17:38:21] In function 'strncpy',
> > [17:38:21]     inlined from 'tui_helpline__push' at ui/tui/helpline.c:27:2:
> > [17:38:21] /usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> > '__builtin_strncpy' specified bound 512 equals destination size
> > [-Werror=stringop-truncation]
> > [17:38:21]   126 |   return __builtin___strncpy_chk (__dest, __src,
> > __len, __bos (__dest));
> > [17:38:21]       |
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > [17:38:21] cc1: all warnings being treated as errors
> > [17:38:21] /cfsetup_build/build/linux-4.19.43/tools/build/Makefile.build:96:
> > recipe for target '/cfsetup_build/build/amd64/perf/ui/tui/helpline.o'
> > failed
> > [17:38:21] mv: cannot stat
> > '/cfsetup_build/build/amd64/perf/ui/tui/.helpline.o.tmp': No such file
> > or directory
> > [17:38:21] make[6]: ***
> > [/cfsetup_build/build/amd64/perf/ui/tui/helpline.o] Error 1
> > [17:38:21] make[5]: *** [tui] Error 2
> > [17:38:21] make[4]: *** [ui] Error 2
> >
> > I see that stringop-truncation is disabled in toplevel Makefile, but
> > not sure if perf is using it.
>
> Ah, alright -- CC'ing the perf maintainers then in case they want to chime in.
>
> > If I disable perf build, the next thing is warnings like these:
> >
> > mm/slub.o: warning: objtool: init_cache_random_seq()+0x36: sibling
> > call from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: slab_out_of_memory()+0x3b: sibling call
> > from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: slab_pad_check.part.0()+0x7c: sibling
> > call from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: check_slab()+0x1c: sibling call from
> > callable instruction with modified stack frame
>
> AFAIK those are non-critical, i.e. stack traces may be wrong (or not),
> but it does not mean the generated kernel itself is wrong. CC'ing the
> objtool maintainers too.

I really like my stack traces definitely correct :)

Thanks for looping in the right people.

> > After patching that I see:
> >
> > In file included from /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:6:
> > /tmp/build/linux-4.19.43/include/linux/module.h:133:6: warning:
> > 'init_module' specifies less restrictive attribute than its target
> > 'aes_init': 'cold' [-Wmissing-attributes]
> >   133 |  int init_module(void) __attribute__((alias(#initfn)));
> >       |      ^~~~~~~~~~~
> > /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:64:1: note: in
> > expansion of macro 'module_init'
> >    64 | module_init(aes_init);
> >       | ^~~~~~~~~~~
> > /tmp/build/linux-4.19.43/arch/x86/crypto/aes_glue.c:54:19: note:
> > 'init_module' target declared here
> >    54 | static int __init aes_init(void)
> >       |                   ^~~~~~~~
>
> Ditto here, those can be ignored too (unless something has changed in
> GCC that I am not aware of).
>
> > I'm not really comfortable with all the warnings, so I stopped the
> > build, maybe it indeed compiles through the end.
>
> It does (on my GCC 9.1.1 compiled from source).
>
> I am not sure what is the policy on backporting (someone from the
> stable team can probably answer that; Greg?), but note that this
> kernel (and 4.20 and 5.0) was released before GCC 9 did -- and some
> (all?) of this was cleaned up before GCC 9 itself released, so we were
> ahead of it :-)
>
> Cheers,
> Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-16 21:20     ` Linux 4.19 and GCC 9 Miguel Ojeda
  2019-05-16 21:24       ` Ivan Babrou
@ 2019-05-17  2:03       ` Josh Poimboeuf
  2019-05-17  3:14         ` Ivan Babrou
  1 sibling, 1 reply; 31+ messages in thread
From: Josh Poimboeuf @ 2019-05-17  2:03 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Ivan Babrou, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Greg KH, Linux Kbuild mailing list,
	kernel-team

On Thu, May 16, 2019 at 11:20:54PM +0200, Miguel Ojeda wrote:
> > mm/slub.o: warning: objtool: init_cache_random_seq()+0x36: sibling
> > call from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: slab_out_of_memory()+0x3b: sibling call
> > from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: slab_pad_check.part.0()+0x7c: sibling
> > call from callable instruction with modified stack frame
> > mm/slub.o: warning: objtool: check_slab()+0x1c: sibling call from
> > callable instruction with modified stack frame
> 
> AFAIK those are non-critical, i.e. stack traces may be wrong (or not),
> but it does not mean the generated kernel itself is wrong. CC'ing the
> objtool maintainers too.

I don't think I recognize those warnings.  Do you also see them in the
upstream kernel?

-- 
Josh

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  2:03       ` Josh Poimboeuf
@ 2019-05-17  3:14         ` Ivan Babrou
  2019-05-17  5:09           ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Ivan Babrou @ 2019-05-17  3:14 UTC (permalink / raw)
  To: Josh Poimboeuf
  Cc: Miguel Ojeda, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Greg KH, Linux Kbuild mailing list,
	kernel-team

We are building the upstream kernel. There are a few patches, but
nothing related to objtool.

Unless you mean mainline/stable by upstream, I haven't tried that. We
stick to LTS.

On Thu, May 16, 2019 at 7:04 PM Josh Poimboeuf <jpoimboe@redhat.com> wrote:
>
> On Thu, May 16, 2019 at 11:20:54PM +0200, Miguel Ojeda wrote:
> > > mm/slub.o: warning: objtool: init_cache_random_seq()+0x36: sibling
> > > call from callable instruction with modified stack frame
> > > mm/slub.o: warning: objtool: slab_out_of_memory()+0x3b: sibling call
> > > from callable instruction with modified stack frame
> > > mm/slub.o: warning: objtool: slab_pad_check.part.0()+0x7c: sibling
> > > call from callable instruction with modified stack frame
> > > mm/slub.o: warning: objtool: check_slab()+0x1c: sibling call from
> > > callable instruction with modified stack frame
> >
> > AFAIK those are non-critical, i.e. stack traces may be wrong (or not),
> > but it does not mean the generated kernel itself is wrong. CC'ing the
> > objtool maintainers too.
>
> I don't think I recognize those warnings.  Do you also see them in the
> upstream kernel?
>
> --
> Josh

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  3:14         ` Ivan Babrou
@ 2019-05-17  5:09           ` Greg KH
  2019-05-17  7:38             ` Peter Zijlstra
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-05-17  5:09 UTC (permalink / raw)
  To: Ivan Babrou
  Cc: Josh Poimboeuf, Miguel Ojeda, Peter Zijlstra, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Thu, May 16, 2019 at 08:14:25PM -0700, Ivan Babrou wrote:
> We are building the upstream kernel. There are a few patches, but
> nothing related to objtool.
> 
> Unless you mean mainline/stable by upstream, I haven't tried that. We
> stick to LTS.

Please work and all of these issues fixed up in Linus's tree and then I
will be glad to take the fixed into the stable releases.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  5:09           ` Greg KH
@ 2019-05-17  7:38             ` Peter Zijlstra
  2019-05-17  8:35               ` Miguel Ojeda
  0 siblings, 1 reply; 31+ messages in thread
From: Peter Zijlstra @ 2019-05-17  7:38 UTC (permalink / raw)
  To: Greg KH
  Cc: Ivan Babrou, Josh Poimboeuf, Miguel Ojeda, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 07:09:31AM +0200, Greg KH wrote:
> On Thu, May 16, 2019 at 08:14:25PM -0700, Ivan Babrou wrote:
> > We are building the upstream kernel. There are a few patches, but
> > nothing related to objtool.
> > 
> > Unless you mean mainline/stable by upstream, I haven't tried that. We
> > stick to LTS.
> 
> Please work and all of these issues fixed up in Linus's tree and then I
> will be glad to take the fixed into the stable releases.

Right; if there is anything you can reproduce on linus.git I'll happily
have a look. If it doesn't reproduce all you have to do is find the
patches that make it work and ask Greg.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  7:38             ` Peter Zijlstra
@ 2019-05-17  8:35               ` Miguel Ojeda
  2019-05-17  8:51                 ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Miguel Ojeda @ 2019-05-17  8:35 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Greg KH, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Fri, May 17, 2019 at 07:09:31AM +0200, Greg KH wrote:
> > On Thu, May 16, 2019 at 08:14:25PM -0700, Ivan Babrou wrote:
> > > We are building the upstream kernel. There are a few patches, but
> > > nothing related to objtool.
> > >
> > > Unless you mean mainline/stable by upstream, I haven't tried that. We
> > > stick to LTS.
> >
> > Please work and all of these issues fixed up in Linus's tree and then I
> > will be glad to take the fixed into the stable releases.
>
> Right; if there is anything you can reproduce on linus.git I'll happily
> have a look. If it doesn't reproduce all you have to do is find the
> patches that make it work and ask Greg.

Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  8:35               ` Miguel Ojeda
@ 2019-05-17  8:51                 ` Greg KH
  2019-05-17  9:01                   ` Miguel Ojeda
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-05-17  8:51 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> >
> > On Fri, May 17, 2019 at 07:09:31AM +0200, Greg KH wrote:
> > > On Thu, May 16, 2019 at 08:14:25PM -0700, Ivan Babrou wrote:
> > > > We are building the upstream kernel. There are a few patches, but
> > > > nothing related to objtool.
> > > >
> > > > Unless you mean mainline/stable by upstream, I haven't tried that. We
> > > > stick to LTS.
> > >
> > > Please work and all of these issues fixed up in Linus's tree and then I
> > > will be glad to take the fixed into the stable releases.
> >
> > Right; if there is anything you can reproduce on linus.git I'll happily
> > have a look. If it doesn't reproduce all you have to do is find the
> > patches that make it work and ask Greg.
> 
> Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.

Great!  Care to find the patches that did that work and send me the git
commit ids so that I can queue them up?  I don't have gcc9 here yet on
my systems, so I can not test for this.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  8:51                 ` Greg KH
@ 2019-05-17  9:01                   ` Miguel Ojeda
  2019-05-17  9:23                     ` Greg KH
                                       ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Miguel Ojeda @ 2019-05-17  9:01 UTC (permalink / raw)
  To: Greg KH
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 10:51 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > >
> > > Right; if there is anything you can reproduce on linus.git I'll happily
> > > have a look. If it doesn't reproduce all you have to do is find the
> > > patches that make it work and ask Greg.
> >
> > Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.
>
> Great!  Care to find the patches that did that work and send me the git
> commit ids so that I can queue them up?  I don't have gcc9 here yet on
> my systems, so I can not test for this.

I am unsure about the perf and the objtools parts (Peter/Josh?), but
about the -Wmissing-attributes I cleaned, they were these:

a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
init/cleanup_module")
c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >= 9)")
ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
aliases as __pure")

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:01                   ` Miguel Ojeda
@ 2019-05-17  9:23                     ` Greg KH
  2019-05-17  9:27                       ` Miguel Ojeda
  2019-05-17  9:48                     ` Greg KH
  2019-05-17 15:22                     ` Arnaldo Carvalho de Melo
  2 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-05-17  9:23 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda wrote:
> On Fri, May 17, 2019 at 10:51 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >
> > > > Right; if there is anything you can reproduce on linus.git I'll happily
> > > > have a look. If it doesn't reproduce all you have to do is find the
> > > > patches that make it work and ask Greg.
> > >
> > > Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.
> >
> > Great!  Care to find the patches that did that work and send me the git
> > commit ids so that I can queue them up?  I don't have gcc9 here yet on
> > my systems, so I can not test for this.
> 
> I am unsure about the perf and the objtools parts (Peter/Josh?), but
> about the -Wmissing-attributes I cleaned, they were these:
> 
> a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> init/cleanup_module")

That patch I applied now.

> c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >= 9)")

This one will take some work to backport, let me see what is needed
here...

> ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> aliases as __pure")

I'll get to this as well.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:23                     ` Greg KH
@ 2019-05-17  9:27                       ` Miguel Ojeda
  2019-05-17  9:42                         ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Miguel Ojeda @ 2019-05-17  9:27 UTC (permalink / raw)
  To: Greg KH
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 11:23 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda wrote:
>
> > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> > init/cleanup_module")
>
> That patch I applied now.

Note that this one requires the second one (c0d9782f5b6d).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:27                       ` Miguel Ojeda
@ 2019-05-17  9:42                         ` Greg KH
  2019-05-17 11:52                           ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-05-17  9:42 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 11:27:41AM +0200, Miguel Ojeda wrote:
> On Fri, May 17, 2019 at 11:23 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda wrote:
> >
> > > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> > > init/cleanup_module")
> >
> > That patch I applied now.
> 
> Note that this one requires the second one (c0d9782f5b6d).

Oops, yeah, my build boxes just blew up :)

Let me go take the time to do this correctly now...

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:01                   ` Miguel Ojeda
  2019-05-17  9:23                     ` Greg KH
@ 2019-05-17  9:48                     ` Greg KH
  2019-05-17 15:22                     ` Arnaldo Carvalho de Melo
  2 siblings, 0 replies; 31+ messages in thread
From: Greg KH @ 2019-05-17  9:48 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda wrote:
> On Fri, May 17, 2019 at 10:51 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >
> > > > Right; if there is anything you can reproduce on linus.git I'll happily
> > > > have a look. If it doesn't reproduce all you have to do is find the
> > > > patches that make it work and ask Greg.
> > >
> > > Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.
> >
> > Great!  Care to find the patches that did that work and send me the git
> > commit ids so that I can queue them up?  I don't have gcc9 here yet on
> > my systems, so I can not test for this.
> 
> I am unsure about the perf and the objtools parts (Peter/Josh?), but
> about the -Wmissing-attributes I cleaned, they were these:
> 
> a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> init/cleanup_module")
> c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >= 9)")
> ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> aliases as __pure")

This last patch is not needed, as that only resolves something that
showed in in 4.20.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:42                         ` Greg KH
@ 2019-05-17 11:52                           ` Greg KH
  0 siblings, 0 replies; 31+ messages in thread
From: Greg KH @ 2019-05-17 11:52 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Peter Zijlstra, Ivan Babrou, Josh Poimboeuf, Ingo Molnar,
	Arnaldo Carvalho de Melo, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Fri, May 17, 2019 at 11:42:17AM +0200, Greg KH wrote:
> On Fri, May 17, 2019 at 11:27:41AM +0200, Miguel Ojeda wrote:
> > On Fri, May 17, 2019 at 11:23 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda wrote:
> > >
> > > > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> > > > init/cleanup_module")
> > >
> > > That patch I applied now.
> > 
> > Note that this one requires the second one (c0d9782f5b6d).
> 
> Oops, yeah, my build boxes just blew up :)
> 
> Let me go take the time to do this correctly now...

Ugh, that is a mess.  I'm going to leave this alone for now as I have
other things to work on.

If someone wants to send a properly backported set of patches, for
4.19.y and older, that would be wonderful :)

Otherwise this is going to have to wait for a while...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17  9:01                   ` Miguel Ojeda
  2019-05-17  9:23                     ` Greg KH
  2019-05-17  9:48                     ` Greg KH
@ 2019-05-17 15:22                     ` Arnaldo Carvalho de Melo
  2019-05-17 17:23                       ` Ivan Babrou
  2 siblings, 1 reply; 31+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-05-17 15:22 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Greg KH, Peter Zijlstra, Ivan Babrou, Josh Poimboeuf,
	Ingo Molnar, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel, Linux Kbuild mailing list, kernel-team

Em Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda escreveu:
> On Fri, May 17, 2019 at 10:51 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > >
> > > > Right; if there is anything you can reproduce on linus.git I'll happily
> > > > have a look. If it doesn't reproduce all you have to do is find the
> > > > patches that make it work and ask Greg.
> > >
> > > Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.
> >
> > Great!  Care to find the patches that did that work and send me the git
> > commit ids so that I can queue them up?  I don't have gcc9 here yet on
> > my systems, so I can not test for this.
> 
> I am unsure about the perf and the objtools parts (Peter/Josh?), but

I'm not noticing these while building upstream perf with gcc 9.1.1 on at
least fedora:30.

    33	fedora:30                     : Ok   gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)

> about the -Wmissing-attributes I cleaned, they were these:
 
> a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> init/cleanup_module")
> c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >= 9)")
> ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> aliases as __pure")
> 
> Cheers,
> Miguel

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17 15:22                     ` Arnaldo Carvalho de Melo
@ 2019-05-17 17:23                       ` Ivan Babrou
  2019-05-17 17:37                         ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 31+ messages in thread
From: Ivan Babrou @ 2019-05-17 17:23 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Miguel Ojeda, Greg KH, Peter Zijlstra, Josh Poimboeuf,
	Ingo Molnar, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel, Linux Kbuild mailing list, kernel-team

On Fri, May 17, 2019 at 8:22 AM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
>
> Em Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda escreveu:
> > On Fri, May 17, 2019 at 10:51 AM Greg KH <gregkh@linuxfoundation.org> wrote:
> > >
> > > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra <peterz@infradead.org> wrote:
> > > > >
> > > > > Right; if there is anything you can reproduce on linus.git I'll happily
> > > > > have a look. If it doesn't reproduce all you have to do is find the
> > > > > patches that make it work and ask Greg.
> > > >
> > > > Just to clarify: Linus' master is clean of these issues with GCC 9.1.1.
> > >
> > > Great!  Care to find the patches that did that work and send me the git
> > > commit ids so that I can queue them up?  I don't have gcc9 here yet on
> > > my systems, so I can not test for this.
> >
> > I am unsure about the perf and the objtools parts (Peter/Josh?), but
>
> I'm not noticing these while building upstream perf with gcc 9.1.1 on at
> least fedora:30.
>
>     33  fedora:30                     : Ok   gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)

I've tried to replicate this in fedora:30 docker container and it's there:

[root@linuxkit-025000000001 perf]# gcc --version
gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)

[root@linuxkit-025000000001 perf]# pwd
/tmp/linux-4.19.44/tools/perf

[root@linuxkit-025000000001 perf]# make -j1
...
trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_kvm_cmd’:
trace/beauty/ioctl.c:85:82: error: array subscript [-2147483648, -1]
is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
   85 |  if (nr < strarray__kvm_ioctl_cmds.nr_entries &&
strarray__kvm_ioctl_cmds.entries[nr] != NULL)
      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from trace/beauty/ioctl.c:82:
/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:1:20:
note: while referencing ‘kvm_ioctl_cmds’
    1 | static const char *kvm_ioctl_cmds[] = {
      |                    ^~~~~~~~~~~~~~
In file included from /usr/include/string.h:494,
                 from util/debug.h:7,
                 from builtin-help.c:15:
In function ‘strncpy’,
    inlined from ‘add_man_viewer’ at builtin-help.c:192:2,
    inlined from ‘perf_help_config’ at builtin-help.c:284:3:
/usr/include/bits/string_fortified.h:106:10: error:
‘__builtin_strncpy’ output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
builtin-help.c: In function ‘perf_help_config’:
builtin-help.c:187:15: note: length computed here
  187 |  size_t len = strlen(name);
      |               ^~~~~~~~~~~~
trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_perf_cmd’:
trace/beauty/ioctl.c:109:84: error: array subscript [-2147483648, -1]
is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
  109 |  if (nr < strarray__perf_ioctl_cmds.nr_entries &&
strarray__perf_ioctl_cmds.entries[nr] != NULL)
      |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
In file included from trace/beauty/ioctl.c:106:
/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/perf_ioctl_array.c:1:20:
note: while referencing ‘perf_ioctl_cmds’
    1 | static const char *perf_ioctl_cmds[] = {
      |                    ^~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

> > about the -Wmissing-attributes I cleaned, they were these:
>
> > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> > init/cleanup_module")
> > c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >= 9)")
> > ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> > aliases as __pure")
> >
> > Cheers,
> > Miguel
>
> --
>
> - Arnaldo

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17 17:23                       ` Ivan Babrou
@ 2019-05-17 17:37                         ` Arnaldo Carvalho de Melo
  2019-06-10  7:21                           ` Ivan Babrou
  0 siblings, 1 reply; 31+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-05-17 17:37 UTC (permalink / raw)
  To: Ivan Babrou, Arnaldo Carvalho de Melo
  Cc: Miguel Ojeda, Greg KH, Peter Zijlstra, Josh Poimboeuf,
	Ingo Molnar, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel, Linux Kbuild mailing list, kernel-team

On May 17, 2019 2:23:10 PM GMT-03:00, Ivan Babrou <ivan@cloudflare.com> wrote:
>On Fri, May 17, 2019 at 8:22 AM Arnaldo Carvalho de Melo
><arnaldo.melo@gmail.com> wrote:
>>
>> Em Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda escreveu:
>> > On Fri, May 17, 2019 at 10:51 AM Greg KH
><gregkh@linuxfoundation.org> wrote:
>> > >
>> > > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
>> > > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra
><peterz@infradead.org> wrote:
>> > > > >
>> > > > > Right; if there is anything you can reproduce on linus.git
>I'll happily
>> > > > > have a look. If it doesn't reproduce all you have to do is
>find the
>> > > > > patches that make it work and ask Greg.
>> > > >
>> > > > Just to clarify: Linus' master is clean of these issues with
>GCC 9.1.1.
>> > >
>> > > Great!  Care to find the patches that did that work and send me
>the git
>> > > commit ids so that I can queue them up?  I don't have gcc9 here
>yet on
>> > > my systems, so I can not test for this.
>> >
>> > I am unsure about the perf and the objtools parts (Peter/Josh?),
>but
>>
>> I'm not noticing these while building upstream perf with gcc 9.1.1 on
                                                                       ^^^^^^^^^^^^^^^

>at
>> least fedora:30.
>>
>>     33  fedora:30                     : Ok   gcc (GCC) 9.1.1 20190503
>(Red Hat 9.1.1-1)
>
>I've tried to replicate this in fedora:30 docker container and it's
>there:
>
>[root@linuxkit-025000000001 perf]# gcc --version
>gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)
>
>[root@linuxkit-025000000001 perf]# pwd
>/tmp/linux-4.19.44/tools/perf
             ^^^^^^^^^^^^^^

That is not upstream perf, please look for patches from 4.19 to Linus' master Branch for fixes.

I'll triple check here in a f30 container just in case meanwhile.

Thanks,

- Arnaldo
>
>[root@linuxkit-025000000001 perf]# make -j1
>...
>trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_kvm_cmd’:
>trace/beauty/ioctl.c:85:82: error: array subscript [-2147483648, -1]
>is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
>   85 |  if (nr < strarray__kvm_ioctl_cmds.nr_entries &&
>strarray__kvm_ioctl_cmds.entries[nr] != NULL)
>      |
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>In file included from trace/beauty/ioctl.c:82:
>/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:1:20:
>note: while referencing ‘kvm_ioctl_cmds’
>    1 | static const char *kvm_ioctl_cmds[] = {
>      |                    ^~~~~~~~~~~~~~
>In file included from /usr/include/string.h:494,
>                 from util/debug.h:7,
>                 from builtin-help.c:15:
>In function ‘strncpy’,
>    inlined from ‘add_man_viewer’ at builtin-help.c:192:2,
>    inlined from ‘perf_help_config’ at builtin-help.c:284:3:
>/usr/include/bits/string_fortified.h:106:10: error:
>‘__builtin_strncpy’ output truncated before terminating nul copying as
>many bytes from a string as its length [-Werror=stringop-truncation]
>106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos
>(__dest));
>|         
>^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>builtin-help.c: In function ‘perf_help_config’:
>builtin-help.c:187:15: note: length computed here
>  187 |  size_t len = strlen(name);
>      |               ^~~~~~~~~~~~
>trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_perf_cmd’:
>trace/beauty/ioctl.c:109:84: error: array subscript [-2147483648, -1]
>is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
>  109 |  if (nr < strarray__perf_ioctl_cmds.nr_entries &&
>strarray__perf_ioctl_cmds.entries[nr] != NULL)
>      |
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
>In file included from trace/beauty/ioctl.c:106:
>/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/perf_ioctl_array.c:1:20:
>note: while referencing ‘perf_ioctl_cmds’
>    1 | static const char *perf_ioctl_cmds[] = {
>      |                    ^~~~~~~~~~~~~~~
>cc1: all warnings being treated as errors
>
>> > about the -Wmissing-attributes I cleaned, they were these:
>>
>> > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
>> > init/cleanup_module")
>> > c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >=
>9)")
>> > ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
>> > aliases as __pure")
>> >
>> > Cheers,
>> > Miguel
>>
>> --
>>
>> - Arnaldo


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-05-17 17:37                         ` Arnaldo Carvalho de Melo
@ 2019-06-10  7:21                           ` Ivan Babrou
  2019-06-10  7:45                             ` Greg KH
  2019-06-10 15:14                             ` Arnaldo Carvalho de Melo
  0 siblings, 2 replies; 31+ messages in thread
From: Ivan Babrou @ 2019-06-10  7:21 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Miguel Ojeda, Greg KH, Peter Zijlstra, Josh Poimboeuf,
	Ingo Molnar, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel, Linux Kbuild mailing list, kernel-team

Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
perf still doesn't want to compile:

[07:15:32]In file included from /usr/include/string.h:635,
[07:15:32] from util/debug.h:7,
[07:15:32] from builtin-help.c:15:
[07:15:32]In function 'strncpy',
[07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
[07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
[07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
'__builtin_strncpy' output truncated before terminating nul copying as
many bytes from a string as its length [-Werror=stringop-truncation]
[07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
__bos (__dest));
[07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[07:15:32]builtin-help.c: In function 'perf_help_config':
[07:15:32]builtin-help.c:187:15: note: length computed here
[07:15:32] 187 | size_t len = strlen(name);
[07:15:32] | ^~~~~~~~~~~~
[07:15:32]cc1: all warnings being treated as errors



On Fri, May 17, 2019 at 11:27 AM Arnaldo Carvalho de Melo
<arnaldo.melo@gmail.com> wrote:
>
> On May 17, 2019 2:23:10 PM GMT-03:00, Ivan Babrou <ivan@cloudflare.com> wrote:
> >On Fri, May 17, 2019 at 8:22 AM Arnaldo Carvalho de Melo
> ><arnaldo.melo@gmail.com> wrote:
> >>
> >> Em Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda escreveu:
> >> > On Fri, May 17, 2019 at 10:51 AM Greg KH
> ><gregkh@linuxfoundation.org> wrote:
> >> > >
> >> > > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> >> > > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra
> ><peterz@infradead.org> wrote:
> >> > > > >
> >> > > > > Right; if there is anything you can reproduce on linus.git
> >I'll happily
> >> > > > > have a look. If it doesn't reproduce all you have to do is
> >find the
> >> > > > > patches that make it work and ask Greg.
> >> > > >
> >> > > > Just to clarify: Linus' master is clean of these issues with
> >GCC 9.1.1.
> >> > >
> >> > > Great!  Care to find the patches that did that work and send me
> >the git
> >> > > commit ids so that I can queue them up?  I don't have gcc9 here
> >yet on
> >> > > my systems, so I can not test for this.
> >> >
> >> > I am unsure about the perf and the objtools parts (Peter/Josh?),
> >but
> >>
> >> I'm not noticing these while building upstream perf with gcc 9.1.1 on
>                                                                        ^^^^^^^^^^^^^^^
>
> >at
> >> least fedora:30.
> >>
> >>     33  fedora:30                     : Ok   gcc (GCC) 9.1.1 20190503
> >(Red Hat 9.1.1-1)
> >
> >I've tried to replicate this in fedora:30 docker container and it's
> >there:
> >
> >[root@linuxkit-025000000001 perf]# gcc --version
> >gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)
> >
> >[root@linuxkit-025000000001 perf]# pwd
> >/tmp/linux-4.19.44/tools/perf
>              ^^^^^^^^^^^^^^
>
> That is not upstream perf, please look for patches from 4.19 to Linus' master Branch for fixes.
>
> I'll triple check here in a f30 container just in case meanwhile.
>
> Thanks,
>
> - Arnaldo
> >
> >[root@linuxkit-025000000001 perf]# make -j1
> >...
> >trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_kvm_cmd’:
> >trace/beauty/ioctl.c:85:82: error: array subscript [-2147483648, -1]
> >is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
> >   85 |  if (nr < strarray__kvm_ioctl_cmds.nr_entries &&
> >strarray__kvm_ioctl_cmds.entries[nr] != NULL)
> >      |
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> >In file included from trace/beauty/ioctl.c:82:
> >/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:1:20:
> >note: while referencing ‘kvm_ioctl_cmds’
> >    1 | static const char *kvm_ioctl_cmds[] = {
> >      |                    ^~~~~~~~~~~~~~
> >In file included from /usr/include/string.h:494,
> >                 from util/debug.h:7,
> >                 from builtin-help.c:15:
> >In function ‘strncpy’,
> >    inlined from ‘add_man_viewer’ at builtin-help.c:192:2,
> >    inlined from ‘perf_help_config’ at builtin-help.c:284:3:
> >/usr/include/bits/string_fortified.h:106:10: error:
> >‘__builtin_strncpy’ output truncated before terminating nul copying as
> >many bytes from a string as its length [-Werror=stringop-truncation]
> >106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos
> >(__dest));
> >|
> >^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >builtin-help.c: In function ‘perf_help_config’:
> >builtin-help.c:187:15: note: length computed here
> >  187 |  size_t len = strlen(name);
> >      |               ^~~~~~~~~~~~
> >trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_perf_cmd’:
> >trace/beauty/ioctl.c:109:84: error: array subscript [-2147483648, -1]
> >is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
> >  109 |  if (nr < strarray__perf_ioctl_cmds.nr_entries &&
> >strarray__perf_ioctl_cmds.entries[nr] != NULL)
> >      |
> >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> >In file included from trace/beauty/ioctl.c:106:
> >/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/perf_ioctl_array.c:1:20:
> >note: while referencing ‘perf_ioctl_cmds’
> >    1 | static const char *perf_ioctl_cmds[] = {
> >      |                    ^~~~~~~~~~~~~~~
> >cc1: all warnings being treated as errors
> >
> >> > about the -Wmissing-attributes I cleaned, they were these:
> >>
> >> > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> >> > init/cleanup_module")
> >> > c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >=
> >9)")
> >> > ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> >> > aliases as __pure")
> >> >
> >> > Cheers,
> >> > Miguel
> >>
> >> --
> >>
> >> - Arnaldo
>

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10  7:21                           ` Ivan Babrou
@ 2019-06-10  7:45                             ` Greg KH
  2019-06-10  9:32                               ` Ignat Korchagin
  2019-06-10 15:14                             ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-06-10  7:45 UTC (permalink / raw)
  To: Ivan Babrou
  Cc: Arnaldo Carvalho de Melo, Miguel Ojeda, Peter Zijlstra,
	Josh Poimboeuf, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 12:21:51AM -0700, Ivan Babrou wrote:
> Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
> perf still doesn't want to compile:
> 
> [07:15:32]In file included from /usr/include/string.h:635,
> [07:15:32] from util/debug.h:7,
> [07:15:32] from builtin-help.c:15:
> [07:15:32]In function 'strncpy',
> [07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
> [07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
> [07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> '__builtin_strncpy' output truncated before terminating nul copying as
> many bytes from a string as its length [-Werror=stringop-truncation]
> [07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
> __bos (__dest));
> [07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [07:15:32]builtin-help.c: In function 'perf_help_config':
> [07:15:32]builtin-help.c:187:15: note: length computed here
> [07:15:32] 187 | size_t len = strlen(name);
> [07:15:32] | ^~~~~~~~~~~~
> [07:15:32]cc1: all warnings being treated as errors


Any chance in finding a patch in Linus's tree that resolves this?  I
don't have gcc9 on my systems here yet to test this.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10  7:45                             ` Greg KH
@ 2019-06-10  9:32                               ` Ignat Korchagin
  2019-06-10 14:21                                 ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Ignat Korchagin @ 2019-06-10  9:32 UTC (permalink / raw)
  To: Greg KH
  Cc: Ivan Babrou, Arnaldo Carvalho de Melo, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

Hi Greg,

For us it seems applying the following 4 mainline patches makes 4.19.x
branch perf compile with GCC-9:

4d0f16d059ddb91424480d88473f7392f24aebdc: perf ui helpline: Use
strlcpy() as a shorter form of strncpy() + explicit set nul
b6313899f4ed2e76b8375cf8069556f5b94fbff0: perf help: Remove needless
use of strncpy()
5192bde7d98c99f2cd80225649e3c2e7493722f7: perf header: Fix unchecked
usage of strncpy()
97acec7df172cd1e450f81f5e293c0aa145a2797: perf data: Fix 'strncat may
truncate' build failure with recent gcc

I also checked that 4.19.49 compiles fine with GCC 9, although with a
lot of warnings, mostly from objtool, like "warning: objtool:
sock_register()+0xd: sibling call from callable instruction with
modified stack frame". But it's a start.

Can we apply the above-mentioned patches, please?

Regards,
Ignat


On Mon, Jun 10, 2019 at 8:45 AM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Jun 10, 2019 at 12:21:51AM -0700, Ivan Babrou wrote:
> > Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
> > perf still doesn't want to compile:
> >
> > [07:15:32]In file included from /usr/include/string.h:635,
> > [07:15:32] from util/debug.h:7,
> > [07:15:32] from builtin-help.c:15:
> > [07:15:32]In function 'strncpy',
> > [07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
> > [07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
> > [07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> > '__builtin_strncpy' output truncated before terminating nul copying as
> > many bytes from a string as its length [-Werror=stringop-truncation]
> > [07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
> > __bos (__dest));
> > [07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > [07:15:32]builtin-help.c: In function 'perf_help_config':
> > [07:15:32]builtin-help.c:187:15: note: length computed here
> > [07:15:32] 187 | size_t len = strlen(name);
> > [07:15:32] | ^~~~~~~~~~~~
> > [07:15:32]cc1: all warnings being treated as errors
>
>
> Any chance in finding a patch in Linus's tree that resolves this?  I
> don't have gcc9 on my systems here yet to test this.
>
> thanks,
>
> greg k-h
>
> --
> You received this message because you are subscribed to the Google Groups "kernel-team" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@cloudflare.com.
> To view this discussion on the web visit https://groups.google.com/a/cloudflare.com/d/msgid/kernel-team/20190610074510.GA24746%40kroah.com.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10  9:32                               ` Ignat Korchagin
@ 2019-06-10 14:21                                 ` Greg KH
  2019-06-10 14:42                                   ` Miguel Ojeda
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-06-10 14:21 UTC (permalink / raw)
  To: Ignat Korchagin
  Cc: Ivan Babrou, Arnaldo Carvalho de Melo, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 10:32:25AM +0100, Ignat Korchagin wrote:
> Hi Greg,
> 
> For us it seems applying the following 4 mainline patches makes 4.19.x
> branch perf compile with GCC-9:
> 
> 4d0f16d059ddb91424480d88473f7392f24aebdc: perf ui helpline: Use
> strlcpy() as a shorter form of strncpy() + explicit set nul
> b6313899f4ed2e76b8375cf8069556f5b94fbff0: perf help: Remove needless
> use of strncpy()
> 5192bde7d98c99f2cd80225649e3c2e7493722f7: perf header: Fix unchecked
> usage of strncpy()
> 97acec7df172cd1e450f81f5e293c0aa145a2797: perf data: Fix 'strncat may
> truncate' build failure with recent gcc
> 
> I also checked that 4.19.49 compiles fine with GCC 9, although with a
> lot of warnings, mostly from objtool, like "warning: objtool:
> sock_register()+0xd: sibling call from callable instruction with
> modified stack frame". But it's a start.
> 
> Can we apply the above-mentioned patches, please?

I'll look into these after the next round of kernels are released.  I
guess I'll go find a distro that has gcc9 on it to actually test
things...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 14:21                                 ` Greg KH
@ 2019-06-10 14:42                                   ` Miguel Ojeda
  2019-06-10 14:48                                     ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Miguel Ojeda @ 2019-06-10 14:42 UTC (permalink / raw)
  To: Greg KH
  Cc: Ignat Korchagin, Ivan Babrou, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 4:21 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> > I also checked that 4.19.49 compiles fine with GCC 9, although with a
> > lot of warnings, mostly from objtool, like "warning: objtool:
> > sock_register()+0xd: sibling call from callable instruction with
> > modified stack frame". But it's a start.

I think Josh Poimboeuf added support for a few related things in GCC 8
(e.g. 13810435b9a7 ("objtool: Support GCC 8's cold subfunctions")).

> I'll look into these after the next round of kernels are released.  I
> guess I'll go find a distro that has gcc9 on it to actually test
> things...

I typically compile a bare-bones GCC for those things, it is quite quick.

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 14:42                                   ` Miguel Ojeda
@ 2019-06-10 14:48                                     ` Greg KH
  2019-06-10 15:01                                       ` Ignat Korchagin
  2019-06-10 15:04                                       ` Miguel Ojeda
  0 siblings, 2 replies; 31+ messages in thread
From: Greg KH @ 2019-06-10 14:48 UTC (permalink / raw)
  To: Miguel Ojeda
  Cc: Ignat Korchagin, Ivan Babrou, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 04:42:27PM +0200, Miguel Ojeda wrote:
> On Mon, Jun 10, 2019 at 4:21 PM Greg KH <gregkh@linuxfoundation.org> wrote:
> >
> > > I also checked that 4.19.49 compiles fine with GCC 9, although with a
> > > lot of warnings, mostly from objtool, like "warning: objtool:
> > > sock_register()+0xd: sibling call from callable instruction with
> > > modified stack frame". But it's a start.
> 
> I think Josh Poimboeuf added support for a few related things in GCC 8
> (e.g. 13810435b9a7 ("objtool: Support GCC 8's cold subfunctions")).

That commit is already in all stable releases, so does there need to be
a gcc 9 specific one?

> > I'll look into these after the next round of kernels are released.  I
> > guess I'll go find a distro that has gcc9 on it to actually test
> > things...
> 
> I typically compile a bare-bones GCC for those things, it is quite quick.

Pointers to how to do that is appreciated.  It's been years since I had
to build gcc "from scratch".

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 14:48                                     ` Greg KH
@ 2019-06-10 15:01                                       ` Ignat Korchagin
  2019-06-10 15:04                                       ` Miguel Ojeda
  1 sibling, 0 replies; 31+ messages in thread
From: Ignat Korchagin @ 2019-06-10 15:01 UTC (permalink / raw)
  To: Greg KH
  Cc: Miguel Ojeda, Ivan Babrou, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 3:49 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> >
> > I typically compile a bare-bones GCC for those things, it is quite quick.
>
> Pointers to how to do that is appreciated.  It's been years since I had
> to build gcc "from scratch".

This is how we do it, but we use it for some other projects as well,
so need ligcc and c++ support. I suspect for kernel-only there may be
a more lightweight approach (for example, by dropping c++):

Env: Debian Stretch (we run in a simple official docker container with
build-essential and make installed) - but probably should work on any
distro
Assuming the sources are extracted into $(BUILDDIR)/gcc-$(VERSION)

cd $(BUILDDIR)/gcc-$(VERSION)
./contrib/download_prerequisites
cd ..
mkdir gcc-build
cd gcc-build
../gcc-$(VERSION)/configure --enable-languages=c,c++
--build=x86_64-linux-gnu --disable-multilib
make -j<something>
sudo make install (or install into alternative dir and point Linux
build system there)

Regards,
Ignat

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 14:48                                     ` Greg KH
  2019-06-10 15:01                                       ` Ignat Korchagin
@ 2019-06-10 15:04                                       ` Miguel Ojeda
  1 sibling, 0 replies; 31+ messages in thread
From: Miguel Ojeda @ 2019-06-10 15:04 UTC (permalink / raw)
  To: Greg KH
  Cc: Ignat Korchagin, Ivan Babrou, Arnaldo Carvalho de Melo,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 10, 2019 at 4:49 PM Greg KH <gregkh@linuxfoundation.org> wrote:
>
> On Mon, Jun 10, 2019 at 04:42:27PM +0200, Miguel Ojeda wrote:
> > I think Josh Poimboeuf added support for a few related things in GCC 8
> > (e.g. 13810435b9a7 ("objtool: Support GCC 8's cold subfunctions")).
>
> That commit is already in all stable releases, so does there need to be
> a gcc 9 specific one?

Ah, you are right. Hm... I recall discussing this at some point when
cleaning up for GCC 9, let me take a look...

> > I typically compile a bare-bones GCC for those things, it is quite quick.
>
> Pointers to how to do that is appreciated.  It's been years since I had
> to build gcc "from scratch".

We crossed emails -- I copy it here on-list in case someone else wants it :-)

mkdir ${BUILD_PATH} \
    && cd ${BUILD_PATH} \
    && ${REPO_PATH}/configure \
        --enable-languages=c,c++ \
        --disable-multilib \
        --disable-bootstrap \
        --disable-nls \
        --prefix=${INSTALL_PATH} \
    && time make \
    && time make install

The key thing is disabling bootstrap to have a single-pass compilation
-- that speeds up things a lot (although, of course, you get less
testing). I would guess you can also disable c++ for the kernel for
even a faster build. You can also use -j, but even without it it does
not really take long (1 hour? -- way less than LLVM anyway). The
installed size nowadays is about 1 GiB.

To get the actual code, I use the git mirror in github for speed
(although it is not that big anyway):

  git clone https://github.com/gcc-mirror/gcc

The tags you want to use look like:

  gcc-9_1_0-release

Also, the first time you run this, you may need some extra dependencies:

  libgmp-dev (maybe named gmp-devel)
  libmpfr-dev (mpfr-devel)
  libmpc-dev (libmpc-devel)

Unless your distro is quite old, I think they should simply work (a
few years ago I had to compile those manually, but nowadays I don't
seem to need them anymore).

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10  7:21                           ` Ivan Babrou
  2019-06-10  7:45                             ` Greg KH
@ 2019-06-10 15:14                             ` Arnaldo Carvalho de Melo
  2019-06-10 15:25                               ` Greg KH
  1 sibling, 1 reply; 31+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-06-10 15:14 UTC (permalink / raw)
  To: Ivan Babrou
  Cc: Arnaldo Carvalho de Melo, Miguel Ojeda, Greg KH, Peter Zijlstra,
	Josh Poimboeuf, Ingo Molnar, Alexander Shishkin, Jiri Olsa,
	Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

Em Mon, Jun 10, 2019 at 12:21:51AM -0700, Ivan Babrou escreveu:
> Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
> perf still doesn't want to compile:
> 
> [07:15:32]In file included from /usr/include/string.h:635,
> [07:15:32] from util/debug.h:7,
> [07:15:32] from builtin-help.c:15:
> [07:15:32]In function 'strncpy',
> [07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
> [07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
> [07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> '__builtin_strncpy' output truncated before terminating nul copying as
> many bytes from a string as its length [-Werror=stringop-truncation]
> [07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
> __bos (__dest));
> [07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> [07:15:32]builtin-help.c: In function 'perf_help_config':
> [07:15:32]builtin-help.c:187:15: note: length computed here
> [07:15:32] 187 | size_t len = strlen(name);
> [07:15:32] | ^~~~~~~~~~~~
> [07:15:32]cc1: all warnings being treated as errors

The patch below should've taken care of that, and it has a Fixes: tag,
i.e. the stable scripts should've noticed that, and it was noticed with
gcc 8.2.

- Arnaldo

commit b6313899f4ed2e76b8375cf8069556f5b94fbff0
Author: Arnaldo Carvalho de Melo <acme@redhat.com>
Date:   Thu Dec 6 11:20:21 2018 -0300

    perf help: Remove needless use of strncpy()

    Since we make sure the destination buffer has at least strlen(orig) + 1,
    no need to do a strncpy(dest, orig, strlen(orig)), just use strcpy(dest,
    orig).

    This silences this gcc 8.2 warning on Alpine Linux:

      In function 'add_man_viewer',
          inlined from 'perf_help_config' at builtin-help.c:284:3:
      builtin-help.c:192:2: error: 'strncpy' output truncated before terminating nul copying as many bytes from a string as its length [-Werror=stringop-truncation]
        strncpy((*p)->name, name, len);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      builtin-help.c: In function 'perf_help_config':
      builtin-help.c:187:15: note: length computed here
        size_t len = strlen(name);
                     ^~~~~~~~~~~~

    Cc: Adrian Hunter <adrian.hunter@intel.com>
    Cc: Jiri Olsa <jolsa@kernel.org>
    Cc: Namhyung Kim <namhyung@kernel.org>
    Fixes: 078006012401 ("perf_counter tools: add in basic glue from Git")
    Link: https://lkml.kernel.org/n/tip-2f69l7drca427ob4km8i7kvo@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

> On Fri, May 17, 2019 at 11:27 AM Arnaldo Carvalho de Melo
> <arnaldo.melo@gmail.com> wrote:
> >
> > On May 17, 2019 2:23:10 PM GMT-03:00, Ivan Babrou <ivan@cloudflare.com> wrote:
> > >On Fri, May 17, 2019 at 8:22 AM Arnaldo Carvalho de Melo
> > ><arnaldo.melo@gmail.com> wrote:
> > >>
> > >> Em Fri, May 17, 2019 at 11:01:45AM +0200, Miguel Ojeda escreveu:
> > >> > On Fri, May 17, 2019 at 10:51 AM Greg KH
> > ><gregkh@linuxfoundation.org> wrote:
> > >> > >
> > >> > > On Fri, May 17, 2019 at 10:35:29AM +0200, Miguel Ojeda wrote:
> > >> > > > On Fri, May 17, 2019 at 9:38 AM Peter Zijlstra
> > ><peterz@infradead.org> wrote:
> > >> > > > >
> > >> > > > > Right; if there is anything you can reproduce on linus.git
> > >I'll happily
> > >> > > > > have a look. If it doesn't reproduce all you have to do is
> > >find the
> > >> > > > > patches that make it work and ask Greg.
> > >> > > >
> > >> > > > Just to clarify: Linus' master is clean of these issues with
> > >GCC 9.1.1.
> > >> > >
> > >> > > Great!  Care to find the patches that did that work and send me
> > >the git
> > >> > > commit ids so that I can queue them up?  I don't have gcc9 here
> > >yet on
> > >> > > my systems, so I can not test for this.
> > >> >
> > >> > I am unsure about the perf and the objtools parts (Peter/Josh?),
> > >but
> > >>
> > >> I'm not noticing these while building upstream perf with gcc 9.1.1 on
> >                                                                        ^^^^^^^^^^^^^^^
> >
> > >at
> > >> least fedora:30.
> > >>
> > >>     33  fedora:30                     : Ok   gcc (GCC) 9.1.1 20190503
> > >(Red Hat 9.1.1-1)
> > >
> > >I've tried to replicate this in fedora:30 docker container and it's
> > >there:
> > >
> > >[root@linuxkit-025000000001 perf]# gcc --version
> > >gcc (GCC) 9.1.1 20190503 (Red Hat 9.1.1-1)
> > >
> > >[root@linuxkit-025000000001 perf]# pwd
> > >/tmp/linux-4.19.44/tools/perf
> >              ^^^^^^^^^^^^^^
> >
> > That is not upstream perf, please look for patches from 4.19 to Linus' master Branch for fixes.
> >
> > I'll triple check here in a f30 container just in case meanwhile.
> >
> > Thanks,
> >
> > - Arnaldo
> > >
> > >[root@linuxkit-025000000001 perf]# make -j1
> > >...
> > >trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_kvm_cmd’:
> > >trace/beauty/ioctl.c:85:82: error: array subscript [-2147483648, -1]
> > >is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
> > >   85 |  if (nr < strarray__kvm_ioctl_cmds.nr_entries &&
> > >strarray__kvm_ioctl_cmds.entries[nr] != NULL)
> > >      |
> > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> > >In file included from trace/beauty/ioctl.c:82:
> > >/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/kvm_ioctl_array.c:1:20:
> > >note: while referencing ‘kvm_ioctl_cmds’
> > >    1 | static const char *kvm_ioctl_cmds[] = {
> > >      |                    ^~~~~~~~~~~~~~
> > >In file included from /usr/include/string.h:494,
> > >                 from util/debug.h:7,
> > >                 from builtin-help.c:15:
> > >In function ‘strncpy’,
> > >    inlined from ‘add_man_viewer’ at builtin-help.c:192:2,
> > >    inlined from ‘perf_help_config’ at builtin-help.c:284:3:
> > >/usr/include/bits/string_fortified.h:106:10: error:
> > >‘__builtin_strncpy’ output truncated before terminating nul copying as
> > >many bytes from a string as its length [-Werror=stringop-truncation]
> > >106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos
> > >(__dest));
> > >|
> > >^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > >builtin-help.c: In function ‘perf_help_config’:
> > >builtin-help.c:187:15: note: length computed here
> > >  187 |  size_t len = strlen(name);
> > >      |               ^~~~~~~~~~~~
> > >trace/beauty/ioctl.c: In function ‘ioctl__scnprintf_perf_cmd’:
> > >trace/beauty/ioctl.c:109:84: error: array subscript [-2147483648, -1]
> > >is outside array bounds of ‘const char *[0]’ [-Werror=array-bounds]
> > >  109 |  if (nr < strarray__perf_ioctl_cmds.nr_entries &&
> > >strarray__perf_ioctl_cmds.entries[nr] != NULL)
> > >      |
> > >~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
> > >In file included from trace/beauty/ioctl.c:106:
> > >/tmp/linux-4.19.44/tools/perf/trace/beauty/generated/ioctl/perf_ioctl_array.c:1:20:
> > >note: while referencing ‘perf_ioctl_cmds’
> > >    1 | static const char *perf_ioctl_cmds[] = {
> > >      |                    ^~~~~~~~~~~~~~~
> > >cc1: all warnings being treated as errors
> > >
> > >> > about the -Wmissing-attributes I cleaned, they were these:
> > >>
> > >> > a6e60d84989f ("include/linux/module.h: copy __init/__exit attrs to
> > >> > init/cleanup_module")
> > >> > c0d9782f5b6d ("Compiler Attributes: add support for __copy (gcc >=
> > >9)")
> > >> > ff98e20ef208 ("lib/crc32.c: mark crc32_le_base/__crc32c_le_base
> > >> > aliases as __pure")
> > >> >
> > >> > Cheers,
> > >> > Miguel
> > >>
> > >> --
> > >>
> > >> - Arnaldo
> >

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 15:14                             ` Arnaldo Carvalho de Melo
@ 2019-06-10 15:25                               ` Greg KH
  2019-06-10 19:14                                 ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-06-10 15:25 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: Ivan Babrou, Miguel Ojeda, Peter Zijlstra, Josh Poimboeuf,
	Ingo Molnar, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	linux-kernel, Linux Kbuild mailing list, kernel-team

On Mon, Jun 10, 2019 at 12:14:07PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, Jun 10, 2019 at 12:21:51AM -0700, Ivan Babrou escreveu:
> > Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
> > perf still doesn't want to compile:
> > 
> > [07:15:32]In file included from /usr/include/string.h:635,
> > [07:15:32] from util/debug.h:7,
> > [07:15:32] from builtin-help.c:15:
> > [07:15:32]In function 'strncpy',
> > [07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
> > [07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
> > [07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> > '__builtin_strncpy' output truncated before terminating nul copying as
> > many bytes from a string as its length [-Werror=stringop-truncation]
> > [07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
> > __bos (__dest));
> > [07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > [07:15:32]builtin-help.c: In function 'perf_help_config':
> > [07:15:32]builtin-help.c:187:15: note: length computed here
> > [07:15:32] 187 | size_t len = strlen(name);
> > [07:15:32] | ^~~~~~~~~~~~
> > [07:15:32]cc1: all warnings being treated as errors
> 
> The patch below should've taken care of that, and it has a Fixes: tag,
> i.e. the stable scripts should've noticed that, and it was noticed with
> gcc 8.2.

No, stable scripts do not always pick up the "Fixes:" tag, they are only
guaranteed to pick up the "cc: stable@" tag.  Sometimes we catch the
fixes ones too, but not always by far.

Anyway, I'll queue this patch up after this next round of kernels are
released, thanks!

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 15:25                               ` Greg KH
@ 2019-06-10 19:14                                 ` Arnaldo Carvalho de Melo
  2019-06-24 10:42                                   ` Ignat Korchagin
  0 siblings, 1 reply; 31+ messages in thread
From: Arnaldo Carvalho de Melo @ 2019-06-10 19:14 UTC (permalink / raw)
  To: Greg KH
  Cc: Arnaldo Carvalho de Melo, Ivan Babrou, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

Em Mon, Jun 10, 2019 at 05:25:42PM +0200, Greg KH escreveu:
> On Mon, Jun 10, 2019 at 12:14:07PM -0300, Arnaldo Carvalho de Melo wrote:
> > Em Mon, Jun 10, 2019 at 12:21:51AM -0700, Ivan Babrou escreveu:
> > > Looks like 4.19.49 received some patches for GCC 9+, but unfortunately
> > > perf still doesn't want to compile:
> > > 
> > > [07:15:32]In file included from /usr/include/string.h:635,
> > > [07:15:32] from util/debug.h:7,
> > > [07:15:32] from builtin-help.c:15:
> > > [07:15:32]In function 'strncpy',
> > > [07:15:32] inlined from 'add_man_viewer' at builtin-help.c:192:2,
> > > [07:15:32] inlined from 'perf_help_config' at builtin-help.c:284:3:
> > > [07:15:32]/usr/include/x86_64-linux-gnu/bits/string3.h:126:10: error:
> > > '__builtin_strncpy' output truncated before terminating nul copying as
> > > many bytes from a string as its length [-Werror=stringop-truncation]
> > > [07:15:32] 126 | return __builtin___strncpy_chk (__dest, __src, __len,
> > > __bos (__dest));
> > > [07:15:32] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > [07:15:32]builtin-help.c: In function 'perf_help_config':
> > > [07:15:32]builtin-help.c:187:15: note: length computed here
> > > [07:15:32] 187 | size_t len = strlen(name);
> > > [07:15:32] | ^~~~~~~~~~~~
> > > [07:15:32]cc1: all warnings being treated as errors
> > 
> > The patch below should've taken care of that, and it has a Fixes: tag,
> > i.e. the stable scripts should've noticed that, and it was noticed with
> > gcc 8.2.
> 
> No, stable scripts do not always pick up the "Fixes:" tag, they are only

Humm, I thought it picked those, or is it that AUTOSEL thing? Ok, I'll
add stable@ when I add Fixes: then.

> guaranteed to pick up the "cc: stable@" tag.  Sometimes we catch the
> fixes ones too, but not always by far.
> 
> Anyway, I'll queue this patch up after this next round of kernels are
> released, thanks!
> 
> greg k-h

-- 

- Arnaldo

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-10 19:14                                 ` Arnaldo Carvalho de Melo
@ 2019-06-24 10:42                                   ` Ignat Korchagin
  2019-06-25  7:50                                     ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Ignat Korchagin @ 2019-06-24 10:42 UTC (permalink / raw)
  To: Greg KH
  Cc: Arnaldo Carvalho de Melo, Ivan Babrou, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

Hi Greg,

> > For us it seems applying the following 4 mainline patches makes 4.19.x
> > branch perf compile with GCC-9:
> >
> > 4d0f16d059ddb91424480d88473f7392f24aebdc: perf ui helpline: Use
> > strlcpy() as a shorter form of strncpy() + explicit set nul
> > b6313899f4ed2e76b8375cf8069556f5b94fbff0: perf help: Remove needless
> > use of strncpy()
> > 5192bde7d98c99f2cd80225649e3c2e7493722f7: perf header: Fix unchecked
> > usage of strncpy()
> > 97acec7df172cd1e450f81f5e293c0aa145a2797: perf data: Fix 'strncat may
> > truncate' build failure with recent gcc
> >
> > I also checked that 4.19.49 compiles fine with GCC 9, although with a
> > lot of warnings, mostly from objtool, like "warning: objtool:
> > sock_register()+0xd: sibling call from callable instruction with
> > modified stack frame". But it's a start.
> >
> > Can we apply the above-mentioned patches, please?

> I'll look into these after the next round of kernels are released.  I

Did you by any chance forget to queue these patches? :) (the build is
still broken for GCC 9.1)

> guess I'll go find a distro that has gcc9 on it to actually test
> things...

BTW, Arch already has GCC 9.1 package, so no need to compile your own
anymore for testing:
https://www.archlinux.org/packages/core/x86_64/gcc/

Regards,
Ignat

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-24 10:42                                   ` Ignat Korchagin
@ 2019-06-25  7:50                                     ` Greg KH
  2019-06-25  8:08                                       ` Greg KH
  0 siblings, 1 reply; 31+ messages in thread
From: Greg KH @ 2019-06-25  7:50 UTC (permalink / raw)
  To: Ignat Korchagin
  Cc: Arnaldo Carvalho de Melo, Ivan Babrou, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Mon, Jun 24, 2019 at 11:42:34AM +0100, Ignat Korchagin wrote:
> Hi Greg,
> 
> > > For us it seems applying the following 4 mainline patches makes 4.19.x
> > > branch perf compile with GCC-9:
> > >
> > > 4d0f16d059ddb91424480d88473f7392f24aebdc: perf ui helpline: Use
> > > strlcpy() as a shorter form of strncpy() + explicit set nul
> > > b6313899f4ed2e76b8375cf8069556f5b94fbff0: perf help: Remove needless
> > > use of strncpy()
> > > 5192bde7d98c99f2cd80225649e3c2e7493722f7: perf header: Fix unchecked
> > > usage of strncpy()
> > > 97acec7df172cd1e450f81f5e293c0aa145a2797: perf data: Fix 'strncat may
> > > truncate' build failure with recent gcc
> > >
> > > I also checked that 4.19.49 compiles fine with GCC 9, although with a
> > > lot of warnings, mostly from objtool, like "warning: objtool:
> > > sock_register()+0xd: sibling call from callable instruction with
> > > modified stack frame". But it's a start.
> > >
> > > Can we apply the above-mentioned patches, please?
> 
> > I'll look into these after the next round of kernels are released.  I
> 
> Did you by any chance forget to queue these patches? :) (the build is
> still broken for GCC 9.1)

I am on the road and getting to backports for this stuff is on the
bottom of my list until next week at the earliest, sorry.

> > guess I'll go find a distro that has gcc9 on it to actually test
> > things...
> 
> BTW, Arch already has GCC 9.1 package, so no need to compile your own
> anymore for testing:
> https://www.archlinux.org/packages/core/x86_64/gcc/

Yes, my laptop just updated, so I'm building here.  Some gcc9 patches
did just get backported, but not for perf.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: Linux 4.19 and GCC 9
  2019-06-25  7:50                                     ` Greg KH
@ 2019-06-25  8:08                                       ` Greg KH
  0 siblings, 0 replies; 31+ messages in thread
From: Greg KH @ 2019-06-25  8:08 UTC (permalink / raw)
  To: Ignat Korchagin
  Cc: Arnaldo Carvalho de Melo, Ivan Babrou, Miguel Ojeda,
	Peter Zijlstra, Josh Poimboeuf, Ingo Molnar, Alexander Shishkin,
	Jiri Olsa, Namhyung Kim, linux-kernel, Linux Kbuild mailing list,
	kernel-team

On Tue, Jun 25, 2019 at 03:50:29PM +0800, Greg KH wrote:
> On Mon, Jun 24, 2019 at 11:42:34AM +0100, Ignat Korchagin wrote:
> > Hi Greg,
> > 
> > > > For us it seems applying the following 4 mainline patches makes 4.19.x
> > > > branch perf compile with GCC-9:
> > > >
> > > > 4d0f16d059ddb91424480d88473f7392f24aebdc: perf ui helpline: Use
> > > > strlcpy() as a shorter form of strncpy() + explicit set nul
> > > > b6313899f4ed2e76b8375cf8069556f5b94fbff0: perf help: Remove needless
> > > > use of strncpy()
> > > > 5192bde7d98c99f2cd80225649e3c2e7493722f7: perf header: Fix unchecked
> > > > usage of strncpy()
> > > > 97acec7df172cd1e450f81f5e293c0aa145a2797: perf data: Fix 'strncat may
> > > > truncate' build failure with recent gcc
> > > >
> > > > I also checked that 4.19.49 compiles fine with GCC 9, although with a
> > > > lot of warnings, mostly from objtool, like "warning: objtool:
> > > > sock_register()+0xd: sibling call from callable instruction with
> > > > modified stack frame". But it's a start.
> > > >
> > > > Can we apply the above-mentioned patches, please?
> > 
> > > I'll look into these after the next round of kernels are released.  I
> > 
> > Did you by any chance forget to queue these patches? :) (the build is
> > still broken for GCC 9.1)
> 
> I am on the road and getting to backports for this stuff is on the
> bottom of my list until next week at the earliest, sorry.

Oh nevermind, I just queued them up now.

If there are any other gcc9 patches that you see that I've missed,
please let me know.

Now, to try to track down the fix for all of those build warnings, those
need to get fixed up...

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2019-06-25  8:08 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CABWYdi06NUOWRLingNuybgZZsTZPjhmsOx-9oCGK94qZGYbzcw@mail.gmail.com>
     [not found] ` <CANiq72kvpiC-i53AXM-YsCUvWroHQemmqxsXjnB330ZEeHahUg@mail.gmail.com>
     [not found]   ` <CABWYdi1zhTTaN-GSgH0DnPfz7p=SRw0wts5QVYYVtfvoiS0qnQ@mail.gmail.com>
2019-05-16 21:20     ` Linux 4.19 and GCC 9 Miguel Ojeda
2019-05-16 21:24       ` Ivan Babrou
2019-05-17  2:03       ` Josh Poimboeuf
2019-05-17  3:14         ` Ivan Babrou
2019-05-17  5:09           ` Greg KH
2019-05-17  7:38             ` Peter Zijlstra
2019-05-17  8:35               ` Miguel Ojeda
2019-05-17  8:51                 ` Greg KH
2019-05-17  9:01                   ` Miguel Ojeda
2019-05-17  9:23                     ` Greg KH
2019-05-17  9:27                       ` Miguel Ojeda
2019-05-17  9:42                         ` Greg KH
2019-05-17 11:52                           ` Greg KH
2019-05-17  9:48                     ` Greg KH
2019-05-17 15:22                     ` Arnaldo Carvalho de Melo
2019-05-17 17:23                       ` Ivan Babrou
2019-05-17 17:37                         ` Arnaldo Carvalho de Melo
2019-06-10  7:21                           ` Ivan Babrou
2019-06-10  7:45                             ` Greg KH
2019-06-10  9:32                               ` Ignat Korchagin
2019-06-10 14:21                                 ` Greg KH
2019-06-10 14:42                                   ` Miguel Ojeda
2019-06-10 14:48                                     ` Greg KH
2019-06-10 15:01                                       ` Ignat Korchagin
2019-06-10 15:04                                       ` Miguel Ojeda
2019-06-10 15:14                             ` Arnaldo Carvalho de Melo
2019-06-10 15:25                               ` Greg KH
2019-06-10 19:14                                 ` Arnaldo Carvalho de Melo
2019-06-24 10:42                                   ` Ignat Korchagin
2019-06-25  7:50                                     ` Greg KH
2019-06-25  8:08                                       ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).