From: Chen Cao <kcao@redhat.com>
To: lmr@redhat.com, autotest@test.kernel.org
Cc: kvm@vger.kernel.org
Subject: [Autotest PATCH] client test - perfmon: Patch the source code of perfmon to remove the -Werror switch
Date: Thu, 27 May 2010 17:32:03 +0800 [thread overview]
Message-ID: <20100527093028.7588.38561.stgit@dhcp-91-198.nay.redhat.com> (raw)
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@redhat.com>
---
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
+
_______________________________________________
Autotest mailing list
Autotest@test.kernel.org
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest
reply other threads:[~2010-05-27 9:32 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100527093028.7588.38561.stgit@dhcp-91-198.nay.redhat.com \
--to=kcao@redhat.com \
--cc=autotest@test.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=lmr@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).