@@ -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')
new file mode 100644
@@ -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
+