This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: SystemTap on 2.6.23-rc8-mm2
- From: David Smith <dsmith at redhat dot com>
- To: Mike Mason <mmlnx at us dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Thu, 04 Oct 2007 13:33:54 -0500
- Subject: Re: SystemTap on 2.6.23-rc8-mm2
- References: <470512D6.3010906@us.ibm.com>
Mike Mason wrote:
Just a heads up... I had to patch buildrun.cxx to get scripts to build
on 2.6.23-rc8-mm2 (CFLAGS changed to KBUILD_CFLAGS, CPPFLAGS changed to
KBUILD_CPPFLAGS). I've attached the patch below. I don't know when or
if this change will go into Linus' kernel. I'm also not sure of the
best way to ensure the correct CFLAGS are used in build_run.cxx (maybe
check s.kernel_release?).
I've seen this also (and in fact I meant to check something in but got
distracted by my other marker work). I believe my solution will be
backwards compatible to 2.6.9 kernels - I've tested it on RHEL4 but I
wanted to test f7 and RHEL5 to make sure I didn't break anything.
Basically I moved all our flag settings to EXTRA_CFLAGS (which is used
by both kernels). See the attached patch for details.
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
Index: buildrun.cxx
===================================================================
RCS file: /cvs/systemtap/src/buildrun.cxx,v
retrieving revision 1.43
diff -u -p -r1.43 buildrun.cxx
--- buildrun.cxx 24 Sep 2007 19:35:48 -0000 1.43
+++ buildrun.cxx 4 Oct 2007 18:29:37 -0000
@@ -42,7 +42,7 @@ compile_pass (systemtap_session& s)
// Clever hacks copied from vmware modules
o << "stap_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl;
- o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(CPPFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
+ o << "stap_check_build = $(shell " << "set -x; " << " if $(CC) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc $(1) > /dev/null ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl;
o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl;
@@ -59,10 +59,10 @@ compile_pass (systemtap_session& s)
o << module_cflags << " += $(call stap_check_build, $(SYSTEMTAP_RUNTIME)/autoconf-ktime-get-real.c, -DSTAPCONF_KTIME_GET_REAL,)" << endl;
for (unsigned i=0; i<s.macros.size(); i++)
- o << "CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
+ o << "EXTRA_CFLAGS += -D " << lex_cast_qstring(s.macros[i]) << endl;
if (s.verbose > 2)
- o << "CFLAGS += -ftime-report -Q" << endl;
+ o << "EXTRA_CFLAGS += -ftime-report -Q" << endl;
// XXX: unfortunately, -save-temps can't work since linux kbuild cwd
// is not writeable.
@@ -70,13 +70,13 @@ compile_pass (systemtap_session& s)
// if (s.keep_tmpdir)
// o << "CFLAGS += -fverbose-asm -save-temps" << endl;
- o << "CFLAGS += -freorder-blocks" << endl; // improve on -Os
+ o << "EXTRA_CFLAGS += -freorder-blocks" << endl; // improve on -Os
// o << "CFLAGS += -fno-unit-at-a-time" << endl;
// Assumes linux 2.6 kbuild
- o << "CFLAGS += -Wno-unused -Werror" << endl;
- o << "CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
+ o << "EXTRA_CFLAGS += -Wno-unused -Werror" << endl;
+ o << "EXTRA_CFLAGS += -I\"" << s.runtime_path << "\"" << endl;
// XXX: this may help ppc toc overflow
// o << "CFLAGS := $(subst -Os,-O2,$(CFLAGS)) -fminimal-toc" << endl;
o << "obj-m := " << s.module_name << ".o" << endl;