[Autotest PATCH] client test - perfmon: Patch the source code of perfmon to remove the -Werror switch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On some OSes, the compilation will failed because of this switch,

...
gcc -O2 -g -Wall -Werror
+-I/home/kcao/projects/autotest/client/tests/perfmon/perfmon-tests-0.3/libpfm-3.
+52/lib/../include -D_REENTRANT -DCONFIG_PFMLIB_ARCH_X86_64 -I. -c
+pfmlib_os_linux.c
cc1: warnings being treated as errors
pfmlib_os_linux.c: In function ‘pfm_init_syscalls_sysfs’:
pfmlib_os_linux.c:398: error: ignoring return value of ‘fscanf’, declared with
+attribute warn_unused_result
make[2]: *** [pfmlib_os_linux.o] Error 1
make[2]: Leaving directory
+`/home/kcao/projects/autotest/client/tests/perfmon/perfmon-tests-0.3/libpfm-3.5
+2/lib'
make[1]: *** [lib] Error 2


Signed-off-by: Chen Cao <kcao@xxxxxxxxxx>
---
 client/tests/perfmon/perfmon.py                 |    8 +++
 client/tests/perfmon/remove-werror-switch.patch |   55 +++++++++++++++++++++++
 2 files changed, 63 insertions(+), 0 deletions(-)
 create mode 100644 client/tests/perfmon/remove-werror-switch.patch

diff --git a/client/tests/perfmon/perfmon.py b/client/tests/perfmon/perfmon.py
index ec1145f..39c6fb2 100644
--- a/client/tests/perfmon/perfmon.py
+++ b/client/tests/perfmon/perfmon.py
@@ -10,6 +10,14 @@ class perfmon(test.test):
         tarball = utils.unmap_url(self.bindir, tarball, self.tmpdir)
         utils.extract_tarball_to_dir(tarball, self.srcdir)
         os.chdir(self.srcdir)
+        # Apply the patch to remove the -Werror switch,
+        # because there are warnings while compiling,
+        # if the compiler sticks to the rules, the source building
+        # will fail, although it seems that fedora and rhel ignore
+        # these warnings.
+        p1 = 'patch -p1 < ../remove-werror-switch.patch'
+        utils.system(p1)
+
         utils.system('make')
 
 
diff --git a/client/tests/perfmon/remove-werror-switch.patch b/client/tests/perfmon/remove-werror-switch.patch
new file mode 100644
index 0000000..6a5062c
--- /dev/null
+++ b/client/tests/perfmon/remove-werror-switch.patch
@@ -0,0 +1,55 @@
+diff --git a/Makefile b/Makefile
+index 6ba6fba..884274d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -28,6 +28,7 @@ TOPDIR  := $(shell if [ "$$PWD" != "" ]; then echo $$PWD; else pwd; fi)
+ include config.mk
+ 
+ DIRS=tests
++PATCHNAME=remove-libpfm-werror.patch
+ 
+ all:  libpfm
+ 	@echo Compiling for \'$(ARCH)\' target
+@@ -36,6 +37,7 @@ all:  libpfm
+ libpfm:
+ 	@echo Compiling $(LIBPFM)
+ 	@tar zxf $(LIBPFM).tar.gz
++	@(cd $(LIBPFM) && patch -p1 < ../$(PATCHNAME) && cd ..)
+ 	@ln -sf $(LIBPFM) libpfm
+ 	@$(MAKE) -C $(LIBPFM) lib
+ clean: 
+diff --git a/config.mk b/config.mk
+index a110111..7321f2d 100644
+--- a/config.mk
++++ b/config.mk
+@@ -163,7 +163,7 @@ INSTALL=install
+ LN=ln -sf
+ PFMINCDIR=$(TOPDIR)/libpfm/include
+ PFMLIBDIR=$(TOPDIR)/libpfm/lib
+-DBG?=-g -Wall -Werror
++DBG?=-g -Wall
+ # gcc/mips64 bug
+ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
+ OPTIM?=-O
+diff --git a/remove-libpfm-werror.patch b/remove-libpfm-werror.patch
+new file mode 100644
+index 0000000..252aaa0
+--- /dev/null
++++ b/remove-libpfm-werror.patch
+@@ -0,0 +1,13 @@
++diff --git a/config.mk b/config.mk
++index 8c76f59..bbf1fc0 100644
++--- a/config.mk
+++++ b/config.mk
++@@ -164,7 +164,7 @@ INSTALL=install
++ LN=ln -sf
++ PFMINCDIR=$(TOPDIR)/include
++ PFMLIBDIR=$(TOPDIR)/lib
++-DBG?=-g -Wall -Werror
+++DBG?=-g -Wall
++ # gcc/mips64 bug
++ ifeq ($(CONFIG_PFMLIB_ARCH_SICORTEX),y)
++ OPTIM?=-O
+-- 
+1.7.0.4
+

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux