Skip to contentSkip to conversation

x86: suppress duplicate symbol warnings for CONFIG_GCOV

PATCH In review Jan Beulich 4 participants 4 messages Mar 30, 2017 – Mar 31, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 x86: suppress duplicate symbol warnings for CONFIG_GCOV

There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. In other environments allow the user to control this, unless Live patching is enabled.

---
v2: Make this a separate config option, selected by GCOV.
---
I'm surprised ARM doesn't use --warn-dup at all so far.

xen/Kconfig.debug +1 -0
@@ -31,6 +31,7 @@ config FRAME_POINTER
 config GCOV
 	bool "Gcov Support"
 	depends on !LIVEPATCH
+	select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
 	---help---
 	  Enable gcov (a test coverage program in GCC) support.
 
xen/arch/x86/Makefile +4 -1
@@ -90,6 +90,9 @@ else
 all_symbols =
 endif
 
+syms-warn-dup-y := --warn-dup
+syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
+
 $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 	./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) 0x100000 \
 	               `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdata_end$$/0x\1/p'`
@@ -131,7 +134,7 @@ $(TARGET)-syms: prelink.o xen.lds $(BASE
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
 	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
-		| $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort --warn-dup \
+		| $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
 		>$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
xen/common/Kconfig +10 -0
@@ -238,6 +238,16 @@ config FAST_SYMBOL_LOOKUP
 
 	  If unsure, say Y.
 
+config SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
+	bool "Suppress duplicate symbol warnings" if !LIVEPATCH
+	default y if !LIVEPATCH
+	---help---
+	  Multiple symbols with the same name aren't generally a problem
+	  unless Live patching is to be used, so these warnings can be
+	  suppressed by enabling this option.  Certain other options (known
+	  to produce many duplicate names) may select this to avoid the
+	  build becoming overly verbose.
+
 config CMDLINE
 	string "Built-in hypervisor command string" if EXPERT = "y"
 	default ""

x86: suppress duplicate symbol warnings for CONFIG_GCOV

There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. In other environments allow the user to control this, unless Live patching is enabled.

---
v2: Make this a separate config option, selected by GCOV.
---
I'm surprised ARM doesn't use --warn-dup at all so far.

xen/Kconfig.debug +1 -0
@@ -31,6 +31,7 @@ config FRAME_POINTER
 config GCOV
 	bool "Gcov Support"
 	depends on !LIVEPATCH
+	select SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
 	---help---
 	  Enable gcov (a test coverage program in GCC) support.
 
xen/arch/x86/Makefile +4 -1
@@ -90,6 +90,9 @@ else
 all_symbols =
 endif
 
+syms-warn-dup-y := --warn-dup
+syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) :=
+
 $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32
 	./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) 0x100000 \
 	               `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdata_end$$/0x\1/p'`
@@ -131,7 +134,7 @@ $(TARGET)-syms: prelink.o xen.lds $(BASE
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
 	    $(@D)/.$(@F).0.o -o $(@D)/.$(@F).1
 	$(NM) -pa --format=sysv $(@D)/.$(@F).1 \
-		| $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort --warn-dup \
+		| $(BASEDIR)/tools/symbols $(all_symbols) --sysv --sort $(syms-warn-dup-y) \
 		>$(@D)/.$(@F).1.S
 	$(MAKE) -f $(BASEDIR)/Rules.mk $(@D)/.$(@F).1.o
 	$(LD) $(LDFLAGS) -T xen.lds -N prelink.o $(build_id_linker) \
xen/common/Kconfig +10 -0
@@ -238,6 +238,16 @@ config FAST_SYMBOL_LOOKUP
 
 	  If unsure, say Y.
 
+config SUPPRESS_DUPLICATE_SYMBOL_WARNINGS
+	bool "Suppress duplicate symbol warnings" if !LIVEPATCH
+	default y if !LIVEPATCH
+	---help---
+	  Multiple symbols with the same name aren't generally a problem
+	  unless Live patching is to be used, so these warnings can be
+	  suppressed by enabling this option.  Certain other options (known
+	  to produce many duplicate names) may select this to avoid the
+	  build becoming overly verbose.
+
 config CMDLINE
 	string "Built-in hypervisor command string" if EXPERT = "y"
 	default ""

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Jan Beulich

There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. In other environments allow the user to control this, unless Live patching is enabled.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by
#2 lore raw
Quoted 8 lines · Wei Liu
Quoted 6 lines · Jan Beulich

There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. In other environments allow the user to control this, unless Live patching is enabled.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

Reviewed-by on v2 1/1
#3 lore raw
In reply to Jan Beulich
Quoted 6 lines · Jan Beulich

There are quite a few of these, and as the option is a development one only, duplicate symbol names should not be an issue there. In other environments allow the user to control this, unless Live patching is enabled.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel