Linux-Trace-Devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] trace-cmd: Fix build with gcc-10
@ 2020-04-17 20:39 Sudip Mukherjee
  2020-04-20 19:43 ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Sudip Mukherjee @ 2020-04-17 20:39 UTC (permalink / raw)
  To: rostedt; +Cc: linux-trace-devel, Sudip Mukherjee

The build fails while building with gcc-10 with the error:
multiple definition of `common_type_field'

Rename the field in trace-hist.c and trace-mem.c to satisfy gcc-10.

Bug-Link: https://bugs.debian.org/957879
Signed-off-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
---
 tracecmd/trace-hist.c | 8 ++++----
 tracecmd/trace-mem.c  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/tracecmd/trace-hist.c b/tracecmd/trace-hist.c
index c458c25..c4d8b40 100644
--- a/tracecmd/trace-hist.c
+++ b/tracecmd/trace-hist.c
@@ -27,7 +27,7 @@ static int kernel_stack_type;
 
 static int long_size;
 
-static struct tep_format_field *common_type_field;
+static struct tep_format_field *common_type_hist;
 static struct tep_format_field *common_pid_field;
 static struct tep_format_field *sched_wakeup_comm_field;
 static struct tep_format_field *sched_wakeup_new_comm_field;
@@ -568,7 +568,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
 	unsigned long long val;
 	int type;
 
-	tep_read_number_field(common_type_field, record->data, &val);
+	tep_read_number_field(common_type_hist, record->data, &val);
 	type = val;
 
 	if (type == function_type)
@@ -956,8 +956,8 @@ static void do_trace_hist(struct tracecmd_input *handle)
 
 	long_size = tracecmd_long_size(handle);
 
-	common_type_field = tep_find_common_field(event, "common_type");
-	if (!common_type_field)
+	common_type_hist = tep_find_common_field(event, "common_type");
+	if (!common_type_hist)
 		die("Can't find a 'type' field?");
 
 	common_pid_field = tep_find_common_field(event, "common_pid");
diff --git a/tracecmd/trace-mem.c b/tracecmd/trace-mem.c
index 465b182..76f38fa 100644
--- a/tracecmd/trace-mem.c
+++ b/tracecmd/trace-mem.c
@@ -30,7 +30,7 @@ static int kmem_cache_alloc_type;
 static int kmem_cache_alloc_node_type;
 static int kmem_cache_free_type;
 
-static struct tep_format_field *common_type_field;
+static struct tep_format_field *common_type_mem;
 
 static struct tep_format_field *kmalloc_callsite_field;
 static struct tep_format_field *kmalloc_bytes_req_field;
@@ -369,7 +369,7 @@ process_record(struct tep_handle *pevent, struct tep_record *record)
 	unsigned long long val;
 	int type;
 
-	tep_read_number_field(common_type_field, record->data, &val);
+	tep_read_number_field(common_type_mem, record->data, &val);
 	type = val;
 
 	if (type == kmalloc_type)
@@ -490,8 +490,8 @@ static void do_trace_mem(struct tracecmd_input *handle)
 	ret = tep_data_type(pevent, record);
 	event = tep_find_event(pevent, ret);
 
-	common_type_field = tep_find_common_field(event, "common_type");
-	if (!common_type_field)
+	common_type_mem = tep_find_common_field(event, "common_type");
+	if (!common_type_mem)
 		die("Can't find a 'type' field?");
 
 	update_kmalloc(pevent);
-- 
2.11.0


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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-04-17 20:39 [PATCH] trace-cmd: Fix build with gcc-10 Sudip Mukherjee
@ 2020-04-20 19:43 ` Steven Rostedt
  2020-04-20 19:53   ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2020-04-20 19:43 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-trace-devel

On Fri, 17 Apr 2020 21:39:14 +0100
Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:

> The build fails while building with gcc-10 with the error:
> multiple definition of `common_type_field'

I'd say this is a bug in gcc.

Both variables are static to the files. Why is it complaining?

If its a new "feature" of gcc, I would look to see if there's a way to
quiet the warning, and adding that to the Makefile instead.

-- Steve

> 
> Rename the field in trace-hist.c and trace-mem.c to satisfy gcc-10.
> 

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-04-20 19:43 ` Steven Rostedt
@ 2020-04-20 19:53   ` Steven Rostedt
  2020-04-20 22:37     ` Sudip Mukherjee
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2020-04-20 19:53 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-trace-devel

On Mon, 20 Apr 2020 15:43:25 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 17 Apr 2020 21:39:14 +0100
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> 
> > The build fails while building with gcc-10 with the error:
> > multiple definition of `common_type_field'  
> 
> I'd say this is a bug in gcc.
> 
> Both variables are static to the files. Why is it complaining?
> 
> If its a new "feature" of gcc, I would look to see if there's a way to
> quiet the warning, and adding that to the Makefile instead.
> 

And when doing a search of "gcc 10" "multiple definitions" the first hit
was this:

  https://patchwork.kernel.org/patch/11372767/


Which is Tzvetomir's patch (which I accepted, but didn't think too much
about it).

I was thinking of just adding -fcommon, but then took a look at the
definition of this:

"-fcommon

    In C code, this option controls the placement of global variables defined without an initializer, known as tentative definitions in the C standard. Tentative definitions are distinct from declarations of a variable with the extern keyword, which do not allocate storage.

    The default is -fno-common, which specifies that the compiler places uninitialized global variables in the BSS section of the object file. This inhibits the merging of tentative definitions by the linker so you get a multiple-definition error if the same variable is accidentally defined in more than one compilation unit.

    The -fcommon places uninitialized global variables in a common block. This allows the linker to resolve all tentative definitions of the same variable in different compilation units to the same object, or to a non-tentative definition. This behavior is inconsistent with C++, and on many targets implies a speed and code size penalty on global variable references. It is mainly useful to enable legacy code to link without errors.
"

OK, so this has a warning due to linking optimizations, and when there's
common names, it causes linking to do some more tricks, and can cause
issues when linking with C++ programs (like KernelShark).

OK, I'll take this patch, and may even enable a -fno-common to find other
cases of this without having to wait till my distro adds gcc 10 by default.

-- Steve

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-04-20 19:53   ` Steven Rostedt
@ 2020-04-20 22:37     ` Sudip Mukherjee
  2020-05-08 12:46       ` Sudip Mukherjee
  0 siblings, 1 reply; 11+ messages in thread
From: Sudip Mukherjee @ 2020-04-20 22:37 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel

On Mon, Apr 20, 2020 at 8:53 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Mon, 20 Apr 2020 15:43:25 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
>
> > On Fri, 17 Apr 2020 21:39:14 +0100
> > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> >
> > > The build fails while building with gcc-10 with the error:
> > > multiple definition of `common_type_field'
> >
<snip>
>
> OK, I'll take this patch, and may even enable a -fno-common to find other
> cases of this without having to wait till my distro adds gcc 10 by default.

Thanks Steve. We have gcc-10 in the experimental release of Debian and
I am using that to build. Looks like this was the only one case which
gcc found.


-- 
Regards
Sudip

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-04-20 22:37     ` Sudip Mukherjee
@ 2020-05-08 12:46       ` Sudip Mukherjee
  2020-05-08 14:11         ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Sudip Mukherjee @ 2020-05-08 12:46 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Linux Trace Devel

On Mon, Apr 20, 2020 at 11:37 PM Sudip Mukherjee
<sudipm.mukherjee@gmail.com> wrote:
>
> On Mon, Apr 20, 2020 at 8:53 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > On Mon, 20 Apr 2020 15:43:25 -0400
> > Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > > On Fri, 17 Apr 2020 21:39:14 +0100
> > > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > > The build fails while building with gcc-10 with the error:
> > > > multiple definition of `common_type_field'
> > >
> <snip>
> >
> > OK, I'll take this patch, and may even enable a -fno-common to find other
> > cases of this without having to wait till my distro adds gcc 10 by default.

A gentle ping.

-- 
Regards
Sudip

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-08 12:46       ` Sudip Mukherjee
@ 2020-05-08 14:11         ` Steven Rostedt
  2020-05-09 18:30           ` Sudip Mukherjee
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2020-05-08 14:11 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Linux Trace Devel

On Fri, 8 May 2020 13:46:19 +0100
Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:

> On Mon, Apr 20, 2020 at 11:37 PM Sudip Mukherjee
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > On Mon, Apr 20, 2020 at 8:53 PM Steven Rostedt <rostedt@goodmis.org> wrote:  
> > >
> > > On Mon, 20 Apr 2020 15:43:25 -0400
> > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > >  
> > > > On Fri, 17 Apr 2020 21:39:14 +0100
> > > > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> > > >  
> > > > > The build fails while building with gcc-10 with the error:
> > > > > multiple definition of `common_type_field'  
> > > >  
> > <snip>  
> > >
> > > OK, I'll take this patch, and may even enable a -fno-common to find other
> > > cases of this without having to wait till my distro adds gcc 10 by default.  
> 
> A gentle ping.
> 

Thanks for the reminder, I haven't forgotten about it, just had other
things added on top of my "todo" list.

I'll go apply this now.

Cheers!

-- Steve

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-08 14:11         ` Steven Rostedt
@ 2020-05-09 18:30           ` Sudip Mukherjee
  2020-05-09 18:48             ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Sudip Mukherjee @ 2020-05-09 18:30 UTC (permalink / raw)
  To: Steven Rostedt, Yordan Karadzhov (VMware); +Cc: Linux Trace Devel

On Fri, May 8, 2020 at 3:11 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 8 May 2020 13:46:19 +0100
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
>
> > On Mon, Apr 20, 2020 at 11:37 PM Sudip Mukherjee
> > <sudipm.mukherjee@gmail.com> wrote:
> > >
> > > On Mon, Apr 20, 2020 at 8:53 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> > > >
> > > > On Mon, 20 Apr 2020 15:43:25 -0400
> > > > Steven Rostedt <rostedt@goodmis.org> wrote:
> > > >
> > > > > On Fri, 17 Apr 2020 21:39:14 +0100
> > > > > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> > > > >
> > > > > > The build fails while building with gcc-10 with the error:
> > > > > > multiple definition of `common_type_field'
> > > > >
> > > <snip>
> > > >
> > > > OK, I'll take this patch, and may even enable a -fno-common to find other
> > > > cases of this without having to wait till my distro adds gcc 10 by default.
> >
> > A gentle ping.
> >
>
> Thanks for the reminder, I haven't forgotten about it, just had other
> things added on top of my "todo" list.
>
> I'll go apply this now.

Thanks. And now kernelshark fails. :(

/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsGLWidget.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsGLWidget.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsDualMarker.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsDualMarker.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsTraceGraph.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsTraceGraph.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsTraceViewer.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsTraceViewer.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsMainWindow.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsMainWindow.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsQuickContextMenu.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/moc_KsQuickContextMenu.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsUtils.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsUtils.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsModels.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsModels.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsSession.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsSession.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsGLWidget.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsGLWidget.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsSearchFSM.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsSearchFSM.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsDualMarker.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsDualMarker.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsWidgetsLib.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsWidgetsLib.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsTraceGraph.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsTraceGraph.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsTraceViewer.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsTraceViewer.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsMainWindow.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsMainWindow.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsCaptureDialog.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsCaptureDialog.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsQuickContextMenu.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsQuickContextMenu.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsAdvFilteringDialog.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:43:
multiple definition of `stringWidth';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:43:
first defined here
/usr/bin/ld: CMakeFiles/kshark-gui.dir/KsAdvFilteringDialog.cpp.o:/build/trace-cmd/kernel-shark/src/KsUtils.hpp:35:
multiple definition of `fontHeight';
CMakeFiles/kshark-gui.dir/moc_KsUtils.cpp.o:/build/trace-cmd/kernel-shark/build/src/../../src/KsUtils.hpp:35:
first defined here



-- 
Regards
Sudip

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-09 18:30           ` Sudip Mukherjee
@ 2020-05-09 18:48             ` Steven Rostedt
  2020-05-09 19:11               ` Sudip Mukherjee
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2020-05-09 18:48 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Yordan Karadzhov (VMware), Linux Trace Devel

On Sat, 9 May 2020 19:30:38 +0100
Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
>
> > Thanks for the reminder, I haven't forgotten about it, just had other
> > things added on top of my "todo" list.
> >
> > I'll go apply this now.  
> 
> Thanks. And now kernelshark fails. :(
> 

Have you tried doing a make clean and building again? Sometimes the
updates leave objects in place that need to be recompiled, but the
dependencies may miss them.

-- Steve

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-09 18:48             ` Steven Rostedt
@ 2020-05-09 19:11               ` Sudip Mukherjee
  2020-05-09 21:12                 ` Steven Rostedt
  0 siblings, 1 reply; 11+ messages in thread
From: Sudip Mukherjee @ 2020-05-09 19:11 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Yordan Karadzhov (VMware), Linux Trace Devel

On Sat, May 9, 2020 at 7:48 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Sat, 9 May 2020 19:30:38 +0100
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> >
> > > Thanks for the reminder, I haven't forgotten about it, just had other
> > > things added on top of my "todo" list.
> > >
> > > I'll go apply this now.
> >
> > Thanks. And now kernelshark fails. :(
> >
>
> Have you tried doing a make clean and building again? Sometimes the
> updates leave objects in place that need to be recompiled, but the
> dependencies may miss them.

The build will be done in a new chroot every time so there is no
chance of objects from a previous build. Just to make sure I did 'git
clone' in a new folder and tried to build again. And it’s the same
failure. Also did 'make clean' and built again with the same failure.


-- 
Regards
Sudip

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-09 19:11               ` Sudip Mukherjee
@ 2020-05-09 21:12                 ` Steven Rostedt
  2020-05-09 23:27                   ` Sudip Mukherjee
  0 siblings, 1 reply; 11+ messages in thread
From: Steven Rostedt @ 2020-05-09 21:12 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Yordan Karadzhov (VMware), Linux Trace Devel

On Sat, 9 May 2020 20:11:09 +0100
Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:

> On Sat, May 9, 2020 at 7:48 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> >
> > On Sat, 9 May 2020 19:30:38 +0100
> > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:  
> > >  
> > > > Thanks for the reminder, I haven't forgotten about it, just had other
> > > > things added on top of my "todo" list.
> > > >
> > > > I'll go apply this now.  
> > >
> > > Thanks. And now kernelshark fails. :(
> > >  
> >
> > Have you tried doing a make clean and building again? Sometimes the
> > updates leave objects in place that need to be recompiled, but the
> > dependencies may miss them.  
> 
> The build will be done in a new chroot every time so there is no
> chance of objects from a previous build. Just to make sure I did 'git
> clone' in a new folder and tried to build again. And it’s the same
> failure. Also did 'make clean' and built again with the same failure.
> 
> 

Hmm, I wonder if something like this fixes it?

-- Steve

diff --git a/kernel-shark/src/KsUtils.hpp b/kernel-shark/src/KsUtils.hpp
index f44139bb..272a27d1 100644
--- a/kernel-shark/src/KsUtils.hpp
+++ b/kernel-shark/src/KsUtils.hpp
@@ -32,7 +32,7 @@
 
 //! @cond Doxygen_Suppress
 
-auto fontHeight = []()
+static auto fontHeight = []()
 {
 	QFont font;
 	QFontMetrics fm(font);
@@ -40,7 +40,7 @@ auto fontHeight = []()
 	return fm.height();
 };
 
-auto stringWidth = [](QString s)
+static auto stringWidth = [](QString s)
 {
 	QFont font;
 	QFontMetrics fm(font);

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

* Re: [PATCH] trace-cmd: Fix build with gcc-10
  2020-05-09 21:12                 ` Steven Rostedt
@ 2020-05-09 23:27                   ` Sudip Mukherjee
  0 siblings, 0 replies; 11+ messages in thread
From: Sudip Mukherjee @ 2020-05-09 23:27 UTC (permalink / raw)
  To: Steven Rostedt; +Cc: Yordan Karadzhov (VMware), Linux Trace Devel

On Sat, May 9, 2020 at 10:12 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Sat, 9 May 2020 20:11:09 +0100
> Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
>
> > On Sat, May 9, 2020 at 7:48 PM Steven Rostedt <rostedt@goodmis.org> wrote:
> > >
> > > On Sat, 9 May 2020 19:30:38 +0100
> > > Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> > > >
> > > > > Thanks for the reminder, I haven't forgotten about it, just had other
> > > > > things added on top of my "todo" list.
> > > > >
> > > > > I'll go apply this now.
> > > >
> > > > Thanks. And now kernelshark fails. :(
> > > >
> > >
> > > Have you tried doing a make clean and building again? Sometimes the
> > > updates leave objects in place that need to be recompiled, but the
> > > dependencies may miss them.
> >
> > The build will be done in a new chroot every time so there is no
> > chance of objects from a previous build. Just to make sure I did 'git
> > clone' in a new folder and tried to build again. And it’s the same
> > failure. Also did 'make clean' and built again with the same failure.
> >
> >
>
> Hmm, I wonder if something like this fixes it?

Yes, it does. :)


-- 
Regards
Sudip

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

end of thread, back to index

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-17 20:39 [PATCH] trace-cmd: Fix build with gcc-10 Sudip Mukherjee
2020-04-20 19:43 ` Steven Rostedt
2020-04-20 19:53   ` Steven Rostedt
2020-04-20 22:37     ` Sudip Mukherjee
2020-05-08 12:46       ` Sudip Mukherjee
2020-05-08 14:11         ` Steven Rostedt
2020-05-09 18:30           ` Sudip Mukherjee
2020-05-09 18:48             ` Steven Rostedt
2020-05-09 19:11               ` Sudip Mukherjee
2020-05-09 21:12                 ` Steven Rostedt
2020-05-09 23:27                   ` Sudip Mukherjee

Linux-Trace-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-trace-devel/0 linux-trace-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-trace-devel linux-trace-devel/ https://lore.kernel.org/linux-trace-devel \
		linux-trace-devel@vger.kernel.org
	public-inbox-index linux-trace-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-trace-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git