From c72dd3c713cc2b21eacae39ce6898f8e5c14e0ad Mon Sep 17 00:00:00 2001 From: Przemysław Pawełczyk Date: Sat, 6 Feb 2010 20:24:06 -0500 Subject: undocumented, obfuscated, *evil* option to suppress -Werror during module building * session.h (omit_werror): New flag. * buildrun.cxx (compile_pass): Use it. * main.cxx (main): Set it. --- buildrun.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'buildrun.cxx') diff --git a/buildrun.cxx b/buildrun.cxx index 3091c511..d6fc52ee 100644 --- a/buildrun.cxx +++ b/buildrun.cxx @@ -153,7 +153,7 @@ compile_pass (systemtap_session& s) o << "_KBUILD_CFLAGS := $(call flags,KBUILD_CFLAGS)" << endl; o << "stap_check_gcc = $(shell " << superverbose << " if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo \"$(1)\"; else echo \"$(2)\"; fi)" << endl; - o << "CHECK_BUILD := $(CC) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(LINUXINCLUDE) $(_KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\" -Werror -S -o /dev/null -xc " << endl; + o << "CHECK_BUILD := $(CC) $(KBUILD_CPPFLAGS) $(CPPFLAGS) $(LINUXINCLUDE) $(_KBUILD_CFLAGS) $(CFLAGS_KERNEL) $(EXTRA_CFLAGS) $(CFLAGS) -DKBUILD_BASENAME=\\\"" << s.module_name << "\\\"" << (s.omit_werror ? "" : " -Werror") << " -S -o /dev/null -xc " << endl; o << "stap_check_build = $(shell " << superverbose << " if $(CHECK_BUILD) $(1) " << redirecterrors << " ; then echo \"$(2)\"; else echo \"$(3)\"; fi)" << endl; o << "SYSTEMTAP_RUNTIME = \"" << s.runtime_path << "\"" << endl; @@ -251,7 +251,7 @@ compile_pass (systemtap_session& s) o << "EXTRA_CFLAGS += $(call cc-option,-Wframe-larger-than=600)" << endl; // Assumes linux 2.6 kbuild - o << "EXTRA_CFLAGS += -Wno-unused -Werror" << endl; + o << "EXTRA_CFLAGS += -Wno-unused" << (s.omit_werror ? "" : " -Werror") << endl; #if CHECK_POINTER_ARITH_PR5947 o << "EXTRA_CFLAGS += -Wpointer-arith" << endl; #endif @@ -494,7 +494,7 @@ make_tracequery(systemtap_session& s, string& name, string makefile(dir + "/Makefile"); ofstream omf(makefile.c_str()); // force debuginfo generation, and relax implicit functions - omf << "EXTRA_CFLAGS := -g -Wno-implicit-function-declaration -Werror" << endl; + omf << "EXTRA_CFLAGS := -g -Wno-implicit-function-declaration" << (s.omit_werror ? "" : " -Werror") << endl; omf << "obj-m := " + basename + ".o" << endl; omf.close(); -- cgit